fix(models): strip :cloud/-cloud suffix from models.dev Ollama Cloud IDs - #16192
Closed
briandevans wants to merge 1 commit into
Closed
fix(models): strip :cloud/-cloud suffix from models.dev Ollama Cloud IDs#16192briandevans wants to merge 1 commit into
briandevans wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Ollama Cloud model ID duplication and invalid selections by normalizing models.dev-sourced IDs to match the live Ollama Cloud API, preventing :cloud / -cloud-suffixed entries from leaking into /model and hermes model.
Changes:
- Added
_strip_ollama_cloud_suffix()to remove trailing:cloud/-cloudfrom Ollama Cloud model IDs. - Applied normalization during the models.dev merge in
fetch_ollama_cloud_models()so deduplication works correctly. - Added targeted unit/integration tests to verify suffix stripping and dedup behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
hermes_cli/models.py |
Adds suffix-stripping helper and normalizes models.dev IDs during the merge to prevent duplicates/broken IDs. |
tests/hermes_cli/test_ollama_cloud_provider.py |
Adds coverage for :cloud / -cloud stripping and confirms no duplicates when live API and models.dev disagree. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
15 tasks
models.dev appends :cloud and -cloud suffixes to Ollama Cloud model IDs (e.g. kimi-k2.6:cloud, qwen3-coder:480b-cloud) that the live Ollama Cloud API does not use. Without normalisation, these suffixed IDs bypass the dedup check and appear alongside the correct clean IDs, causing 400/404 errors when users select them in /model or hermes model. Add _strip_ollama_cloud_suffix() and apply it to mdev entries before the dedup merge in fetch_ollama_cloud_models() so all model IDs stored in the disk cache use the canonical form the API accepts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briandevans
force-pushed
the
fix/ollama-cloud-strip-cloud-suffix-16179
branch
from
May 1, 2026 22:24
b9ba3a1 to
aa9797c
Compare
Contributor
|
Salvaged via #19881 onto current main - your commit authorship was preserved. Thanks! |
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.
Summary
fetch_ollama_cloud_models()merges live API results with models.dev additions:cloud/-cloudsuffixes to Ollama Cloud IDs (e.g.kimi-k2.6:cloud,qwen3-coder:480b-cloud) that the live API does not use/modelandhermes modelThe bug
models.devlists Ollama Cloud model IDs with appended:cloud/-cloudsuffixes. The live Ollama Cloud API (https://ollama.com/v1/models) returns the same models without those suffixes. In the merge loop:Users end up with entries like
kimi-k2.6:cloudin the model picker. Selecting one triggers a 400/404 from the Ollama API because that ID does not exist.The fix
Added
_strip_ollama_cloud_suffix(model_id)that removes:cloudand-cloudtail suffixes, and applies it to each mdev model ID before the dedup check:Applies to both the case where live API models are available (prevents suffixed duplicates) and the no-API-key fallback (strips suffixes from mdev-only results).
Test plan
['kimi-k2.6', 'glm-5.1', 'kimi-k2.6:cloud', 'glm-5.1:cloud', 'qwen3-coder:480b-cloud']— confirmed locallytest_no_duplicate_when_live_clean_and_mdev_suffixed— exactly onekimi-k2.6, no:cloudentries:cloudsuffix stripping:test_strips_colon_cloud_suffix-cloudsuffix stripping:test_strips_dash_cloud_suffixtest_unsuffixed_model_id_unchangedtest_strip_suffix_helpertest_ollama_cloud_provider.pytests passRelated
🤖 Generated with Claude Code