Skip to content

feat: add Ollama Cloud as built-in provider#6038

Closed
kshitijk4poor wants to merge 1 commit into
NousResearch:mainfrom
kshitijk4poor:feat/ollama-cloud-provider
Closed

feat: add Ollama Cloud as built-in provider#6038
kshitijk4poor wants to merge 1 commit into
NousResearch:mainfrom
kshitijk4poor:feat/ollama-cloud-provider

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Add Ollama Cloud (ollama.com) as a first-class built-in provider. Users can now use --provider ollama-cloud (or the ollama alias) instead of manually configuring provider: "custom" + base_url.

Before (workaround):

model:
  provider: "custom"
  base_url: "https://ollama.com/v1"
# + OLLAMA_API_KEY in .env

After:

model:
  provider: "ollama-cloud"
# + OLLAMA_API_KEY in .env

Changes

Provider registration (13 files)

File What
hermes_cli/auth.py PROVIDER_REGISTRY entry + aliases (ollamaollama-cloud)
hermes_cli/config.py OLLAMA_API_KEY + OLLAMA_BASE_URL in OPTIONAL_ENV_VARS
hermes_cli/models.py Label, aliases, provider order + fetch_ollama_cloud_models()
hermes_cli/model_normalize.py Added to _PASSTHROUGH_PROVIDERS
hermes_cli/providers.py HermesOverlay + label entries
hermes_cli/main.py Setup flow, --provider choices, provider dispatch
hermes_cli/setup.py Setup wizard integration
agent/model_metadata.py _PROVIDER_PREFIXES + _URL_TO_PROVIDER mapping
agent/models_dev.py PROVIDER_TO_MODELS_DEV mapping
agent/auxiliary_client.py Default aux model (nemotron-3-nano:30b)
.env.example Documented env vars
cli-config.yaml.example Provider list + auxiliary comments

Dynamic model discovery

No static model list — models are discovered dynamically with merged sources and disk caching:

  1. Disk cache (< 1hr TTL) — instant startup when fresh
  2. Live /v1/models endpoint (primary) — freshest source
  3. models.dev registry (secondary) — fills gaps for models not listed by the API
  4. Merge: live models first, then models.dev additions (deduped, order-preserving)
  5. Stale fallback: if both live sources fail, expired cache is used rather than returning nothing

This means Ollama Cloud model lists stay current as Ollama adds/removes models without any Hermes code changes.

Test coverage

37 tests in tests/hermes_cli/test_ollama_cloud_provider.py:

  • Provider registry, aliases, auto-detection
  • Credential resolution (API key, custom base URL, runtime)
  • Model normalization (passthrough — preserves model:tag format)
  • URL-to-provider mapping
  • Agent init (no SyntaxError, correct chat_completions mode)
  • models.dev integration
  • New providers.py system (overlay, label, resolution)
  • Merged model discovery (merge ordering, dedup, disk cache, stale fallback, force refresh)
  • Auxiliary model configuration

Test plan

  • python -m pytest tests/hermes_cli/test_ollama_cloud_provider.py -v — 37 passed
  • python -m pytest tests/hermes_cli/test_ollama_cloud_auth.py -v — 31 passed (pre-existing tests)
  • python -m pytest tests/hermes_cli/test_gemini_provider.py -v — 42 passed (no regression)
  • Full suite python -m pytest tests/ -q
  • hermes setup model → select ollama-cloud → models fetched dynamically
  • hermes chat --provider ollama-cloud with OLLAMA_API_KEY set

Closes #3926

Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama, ollama_cloud -> ollama-cloud
- models.dev integration for 35+ models with accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in new providers.py system
- CLI --provider choices, setup flow, config docs
- 37 provider-specific tests

Dynamic model discovery — no static model list to maintain:
  1. Disk cache (< 1hr TTL, stale fallback on total failure)
  2. Live /v1/models endpoint (primary — freshest source)
  3. models.dev registry (secondary — fills gaps)
  4. Merge: live models first, then models.dev additions (deduped)

Closes NousResearch#3926
@kshitijk4poor kshitijk4poor force-pushed the feat/ollama-cloud-provider branch from 7974962 to 7b2059d Compare April 8, 2026 05:30
teknium1 pushed a commit that referenced this pull request Apr 16, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR #6038 by kshitijk4poor. Closes #3926
teknium1 pushed a commit that referenced this pull request Apr 16, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR #6038 by kshitijk4poor. Closes #3926
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #10782. Your Ollama Cloud provider implementation was cherry-picked onto current main with your authorship preserved in git log. Thanks for the thorough work — 37 tests, dynamic model discovery, the full provider integration. Closes #3926.

@teknium1 teknium1 closed this Apr 16, 2026
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR NousResearch#6038 by kshitijk4poor. Closes NousResearch#3926
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR NousResearch#6038 by kshitijk4poor. Closes NousResearch#3926
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR NousResearch#6038 by kshitijk4poor. Closes NousResearch#3926
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR NousResearch#6038 by kshitijk4poor. Closes NousResearch#3926
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Add ollama-cloud as a first-class provider with full parity to existing
API-key providers (gemini, zai, minimax, etc.):

- PROVIDER_REGISTRY entry with OLLAMA_API_KEY env var
- Provider aliases: ollama -> custom (local), ollama_cloud -> ollama-cloud
- models.dev integration for accurate context lengths
- URL-to-provider mapping (ollama.com -> ollama-cloud)
- Passthrough model normalization (preserves Ollama model:tag format)
- Default auxiliary model (nemotron-3-nano:30b)
- HermesOverlay in providers.py
- CLI --provider choices, CANONICAL_PROVIDERS entry
- Dynamic model discovery with disk caching (1hr TTL)
- 37 provider-specific tests

Cherry-picked from PR NousResearch#6038 by kshitijk4poor. Closes NousResearch#3926
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.

Add Ollama Cloud as built-in provider

2 participants