Skip to content

fix(ollama): preserve cloud model suffixes in picker - #52613

Open
deranaz wants to merge 1 commit into
NousResearch:mainfrom
deranaz:fix/ollama-cloud-model-picker-suffix
Open

fix(ollama): preserve cloud model suffixes in picker#52613
deranaz wants to merge 1 commit into
NousResearch:mainfrom
deranaz:fix/ollama-cloud-model-picker-suffix

Conversation

@deranaz

@deranaz deranaz commented Jun 25, 2026

Copy link
Copy Markdown

What does this PR do?

Preserves Ollama Cloud model IDs from models.dev in the model picker output while still using suffix-stripped IDs only for deduplication. This prevents cloud-only IDs such as qwen3-coder:480b-cloud from being shown as local-looking IDs like qwen3-coder:480b.

Related Issue

Fixes #52599

Type of Change

  • Bug fix
  • Tests

Changes Made

  • hermes_cli/models.py: keep the original Ollama Cloud model ID when adding merged entries, but dedupe by the normalized suffix-stripped key.
  • tests/hermes_cli/test_ollama_cloud_provider.py: update suffix tests to assert cloud IDs are preserved when models.dev is the source, and add coverage for live/API dedupe with suffixed IDs.
  • tests/hermes_cli/test_ollama_cloud_provider.py: add explicit UTF-8 encodings in cache test file I/O to satisfy the Windows compatibility checker.

How to Test

  1. Run uv run --extra dev pytest tests/hermes_cli/test_ollama_cloud_provider.py tests/hermes_cli/test_setup_ollama_cloud_force_refresh.py -q.
  2. Run uv run python scripts/check-windows-footguns.py --diff upstream/main.
  3. Run git diff --check.

Checklist

Code

  • I read the contributing guide.
  • Commit message follows Conventional Commits: fix(ollama): preserve cloud model suffixes in picker.
  • I searched existing issues/PRs before opening this PR.
  • PR is focused on one logical bug fix.
  • Added/updated regression tests for the bug.
  • Platform tested: macOS, focused Python test suite.

Documentation & Housekeeping

  • Documentation update: N/A, no user-facing docs changed.
  • cli-config.yaml.example: N/A, no config keys changed.
  • CONTRIBUTING.md / AGENTS.md: N/A, no architecture/workflow changed.
  • Cross-platform impact considered; scripts/check-windows-footguns.py --diff upstream/main passes.
  • Tool descriptions/schemas: N/A, no tool schema changed.

Screenshots / Logs

46 passed in 11.59s
✓ No Windows footguns found (2 file(s) scanned).

@deranaz
deranaz force-pushed the fix/ollama-cloud-model-picker-suffix branch from 6205ecf to ec19ec7 Compare June 25, 2026 18:07
@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 labels Jun 25, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused regression coverage. The current merge does still normalize models.dev-only IDs, but this patch reverses a documented compatibility decision that needs endpoint-specific handling.

Problems

  • hermes_cli/models.py:3615 changes the saved/returned models.dev ID globally. Current main deliberately stores the normalized ID at hermes_cli/models.py:3767-3772; commit eadf34633e038c595dcf615845b992a45443e380 records that the hosted Ollama Cloud API uses clean IDs and rejected suffixed ones with 400/404 responses.
  • The patch has no base_url distinction. The related local-proxy report in #59819 identifies routing through a local Ollama daemon as the case where tags may be required, which is different from the hosted default at hermes_cli/models.py:3742.

Suggested changes

  • Preserve the hosted-endpoint normalization, and make any tag preservation/retagging conditional on a verified endpoint mode.
  • Cover hosted and local-proxy merge/cache results separately.

Automated hermes-sweeper review.

Comment thread hermes_cli/models.py
if normalized and normalized not in seen:
seen.add(normalized)
merged.append(normalized)
merged.append(m)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This globally changes the cached picker ID, but current main intentionally appends the normalized value because commit eadf346 documents hosted Ollama Cloud rejecting suffixed IDs. Please scope tag preservation to a verified endpoint mode (for example, a local daemon proxy) rather than applying it to every models.dev fallback.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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 P3 Low — cosmetic, nice to have provider/ollama Ollama / local models sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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.

[Bug]: Ollama Cloud model picker shows local models instead of cloud models

3 participants