Skip to content

fix(ollama-cloud): preserve :cloud tags for local-daemon proxy in model catalog - #59819

Open
allenramirez-arch wants to merge 1 commit into
NousResearch:mainfrom
allenramirez-arch:fix/ollama-cloud-local-proxy-tags
Open

fix(ollama-cloud): preserve :cloud tags for local-daemon proxy in model catalog#59819
allenramirez-arch wants to merge 1 commit into
NousResearch:mainfrom
allenramirez-arch:fix/ollama-cloud-local-proxy-tags

Conversation

@allenramirez-arch

Copy link
Copy Markdown

Problem

When Ollama Cloud is routed through the local Ollama daemon (base_url host localhost / 127.0.0.1 / ::1 / *.local), cloud models must keep their Ollama tag suffixes:

  • kimi-k2.6kimi-k2.6:cloud
  • qwen3-coder:480bqwen3-coder:480b-cloud

fetch_ollama_cloud_models() merged the live list with the models.dev catalog and ran every models.dev ID through _strip_ollama_cloud_suffix(), which unconditionally removed :cloud/-cloud. The merged/cached list (and therefore the hermes model picker) then offered bare IDs that the local proxy cannot serve.

Fix

Replace the unconditional strip with intent-separated helpers:

  • _ollama_cloud_suffix_key() — suffix-agnostic value used only as a dedup equivalence key (never saved as a model ID).
  • _ollama_cloud_base_is_local_proxy() — detects local-daemon routing.
  • _ollama_cloud_model_for_endpoint() — re-tags catalog IDs for the local proxy (namename:cloud, name:tagname:tag-cloud) while preserving hosted ollama.com/v1 IDs as-is.

The merge keeps the real, tagged IDs and uses the stripped value only for equivalence, so bare/suffixed duplicates still collapse to one entry.

Tests

Extends tests/hermes_cli/test_ollama_cloud_provider.py (45 passing locally).

…el catalog

When Ollama Cloud is routed through the local Ollama daemon (base_url host
localhost / 127.0.0.1 / ::1 / *.local), cloud models must keep their Ollama
tag suffixes: `kimi-k2.6` -> `kimi-k2.6:cloud`,
`qwen3-coder:480b` -> `qwen3-coder:480b-cloud`. The old
`_strip_ollama_cloud_suffix()` unconditionally stripped `:cloud`/`-cloud`
from models.dev catalog IDs before the dedup merge, producing bare IDs the
local proxy cannot serve (`hermes model` picker + cache then offer unusable
model names).

Replace the unconditional strip with:
- `_ollama_cloud_suffix_key()` — suffix-agnostic key used ONLY for dedup
- `_ollama_cloud_base_is_local_proxy()` — detect local-daemon routing
- `_ollama_cloud_model_for_endpoint()` — re-tag catalog IDs for the local
  proxy while preserving hosted `ollama.com/v1` IDs as-is

The merge now keeps the real (tagged) IDs and uses the suffix-stripped value
only as an equivalence key, so bare/suffixed duplicates still collapse.
Extends tests/hermes_cli/test_ollama_cloud_provider.py.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/ollama Ollama / local models P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #52613 — both patch fetch_ollama_cloud_models() in hermes_cli/models.py to use _strip_ollama_cloud_suffix only as a dedup equivalence key and preserve the real tagged model ID, fixing the same over-stripping bug from #52599. #52613 is the earliest open version and is canonical; this PR adds extra local-proxy re-tag helpers but the core mechanism is identical.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for tracing the suffix loss. The premise is still present on current main: hermes_cli/models.py:4067-4070 strips each models.dev ID before adding it to the picker/cache.

Problems

  • The proposed endpoint-shaped IDs need endpoint-aware caching. Current fetch_ollama_cloud_models() returns the shared disk cache before resolving base_url (hermes_cli/models.py:4032-4042), while _save_ollama_cloud_cache() stores only models and a timestamp (hermes_cli/models.py:4005-4011). A local-proxy refresh could therefore make a later hosted request reuse tagged IDs, or vice versa.

Suggested changes

  • Key the cache by endpoint shape/base URL, or transform cached canonical IDs after resolving the selected endpoint.
  • Add a cache-hit regression covering a local-proxy call followed by a hosted call (and the reverse), not only force_refresh=True.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/ollama Ollama / local models sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants