fix(ollama-cloud): preserve :cloud tags for local-daemon proxy in model catalog - #59819
Open
allenramirez-arch wants to merge 1 commit into
Open
Conversation
…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>
Collaborator
Duplicate of #52613 — both patch |
13 tasks
Contributor
|
Thanks for tracing the suffix loss. The premise is still present on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When Ollama Cloud is routed through the local Ollama daemon (
base_urlhostlocalhost/127.0.0.1/::1/*.local), cloud models must keep their Ollama tag suffixes:kimi-k2.6→kimi-k2.6:cloudqwen3-coder:480b→qwen3-coder:480b-cloudfetch_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 thehermes modelpicker) 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 (name→name:cloud,name:tag→name:tag-cloud) while preserving hostedollama.com/v1IDs 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).