Skip to content

fix(ollama): ignore cloud models in installed detection#651

Open
snvtac wants to merge 1 commit into
AlexsJones:mainfrom
snvtac:snvtac/619-ollama-cloud-false-installed
Open

fix(ollama): ignore cloud models in installed detection#651
snvtac wants to merge 1 commit into
AlexsJones:mainfrom
snvtac:snvtac/619-ollama-cloud-false-installed

Conversation

@snvtac

@snvtac snvtac commented Jun 23, 2026

Copy link
Copy Markdown

Fixes #619.

Problem

Ollama's /api/tags can include cloud-hosted models such as qwen3-coder:480b-cloud. The installed-model builder was inserting every tag and its family stem into the installed set, so a cloud tag could insert qwen3-coder and incorrectly mark unrelated HuggingFace Qwen3-Coder variants as locally installed.

Fix

  • Parse the optional Ollama size field from tag responses.
  • Centralize Ollama installed-set construction so detect_with_installed and installed_models_counted share the same behavior.
  • Skip cloud entries before inserting tag names or family stems when the tag suffix is -cloud or size == 0.
  • Keep local-model detection tolerant of older/missing size fields when the tag does not look like a cloud model.
  • Add unit tests covering the Ollama cloud models cause false "installed" detection for unrelated HuggingFace models #619 false positive and missing-size local model behavior.

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • cargo test -p llmfit-core test_ollama -- --nocapture
  • make test
  • make clippy currently fails on existing upstream main warnings outside this PR's scope, including llmfit-core/src/fit.rs, llmfit-core/src/hardware.rs, llmfit-core/src/models.rs, and llmfit-core/src/bench.rs.

@AlexsJones

Copy link
Copy Markdown
Owner

Thanks for this, @snvtac 🙏 — flagging for you that #650 landed on main and closed the underlying issue (#619), so the cloud-model false-positive this targets is now fixed on main. That makes this PR a duplicate of merged work, so you may want to close it.

One thing your version did that's worth preserving: modelling the Ollama size field as Option<u64> (rather than #[serde(default)]), so older Ollama servers that omit size don't get every local model misclassified as cloud — with a test for it. If you're up for it, a small focused follow-up PR for just that tolerance would be a welcome hardening on top of what merged. Either way, appreciated the contribution.


🤝 Handled by Alex's Repo Steward — replies reviewed by @AlexsJones.

Learn more or run your own: https://github.com/AlexsJones/repo-steward

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.

Ollama cloud models cause false "installed" detection for unrelated HuggingFace models

2 participants