Skip to content

feat(ollama-cloud): add Ollama Cloud provider with cookie-based quota scraping#103

Open
mattfinlayson wants to merge 1 commit into
slkiser:mainfrom
mattfinlayson:main
Open

feat(ollama-cloud): add Ollama Cloud provider with cookie-based quota scraping#103
mattfinlayson wants to merge 1 commit into
slkiser:mainfrom
mattfinlayson:main

Conversation

@mattfinlayson
Copy link
Copy Markdown

@mattfinlayson mattfinlayson commented May 28, 2026

Adds an Ollama Cloud provider that scrapes usage data from ollama.com/settings.

Closes #38

What it does

  • Scrapes session and weekly usage percentages, plan tier, and reset times from the Ollama Cloud settings page
  • Supports cookie config via OLLAMA_USAGE_COOKIE env var, ~/.config/opencode/opencode-quota/ollama-cloud.json, or ~/.config/ollama-usage/config.yaml
  • Normalizes __Secure-session= cookie prefix if the user includes it in their config

Files changed

  • src/lib/ollama-cloud.ts — settings page scraper with HTML parsing
  • src/lib/ollama-cloud-config.ts — cookie config resolution (env > JSON > YAML)
  • src/providers/ollama-cloud.ts — QuotaProvider interface implementation
  • src/lib/provider-metadata.ts — canonical ID, labels, shapes, runtime IDs
  • src/lib/types.ts — OllamaCloudWindow and OllamaCloudResult types
  • src/providers/registry.ts — registered in provider list
  • tests/lib.provider-metadata.test.ts — updated expected shapes
  • README.md — provider table entry and setup instructions

… scraping

- Add Ollama Cloud provider that scrapes usage from ollama.com/settings
- Support cookie config via OLLAMA_USAGE_COOKIE env var, JSON, or YAML
- Normalize __Secure-session= cookie prefix if user includes it
- Add to provider registry, metadata, shapes, and labels
- Update README with provider setup section
- Fix stale provider-metadata test to include ollama-cloud entry
@slkiser
Copy link
Copy Markdown
Owner

slkiser commented May 28, 2026

@mattfinlayson Thanks for contribution, will review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: adds ollama cloud provider

2 participants