Repository navigation
Resolve bare Ollama model names to their :latest tag - #235
Conversation
…ame resolves to :latest
…t for async unification in tests
…calise the same way
|
Caution Review failedThe pull request is closed. WalkthroughThe change adds Ollama-only resolution from an untagged model name to its ChangesOllama model resolution
Priority: Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Client
participant ProxyHandler
participant UnifiedMemoryModelRegistry
participant OllamaEndpoint
participant Stats
Client->>ProxyHandler: Send request with bare model name
ProxyHandler->>UnifiedMemoryModelRegistry: Resolve model and canonical name
UnifiedMemoryModelRegistry-->>ProxyHandler: Return Ollama endpoint and :latest name
ProxyHandler->>OllamaEndpoint: Forward request with original model name
ProxyHandler->>Stats: Record request under canonical model name
Possibly related PRs
Suggested reviewers: Merge Risk:
|
…latest # Conflicts: # docs/content/about/release-notes.md # internal/adapter/registry/unified_memory_registry.go # internal/adapter/unifier/catalog_store.go
Summary
Ollama lists a model pulled without a tag as
name:latest, and Ollama itself treats a barenameasname:latest. Olla did exact lookups only, soall-minilmgot 404model_not_foundon every route:/olla/ollama/api/*,/v1/*,/olla/anthropic/...and/olla/models/{id}. The v0.0.30 notes for the TEI work already pointed at this fix.The lookup order is now:
name:latestagainst Ollama-sourced models.The backend still receives the client's spelling. Stats and model-keyed sticky sessions key on the native name, so both spellings share one row and one key, including alias targets. The lookup only goes one way,
nametoname:latest, because Ollama always lists models tagged.Type of change
How was this tested?
New tests:
registry/ollama_default_tag_test.go, including the cases mixed-case Ollama vs vLLM, exact catalogue match beats the fallback, and mixed-case canonical nameunifier/catalog_store_ollama_tag_test.godomain/model_tag_test.goproxy/core/model_rewrite_test.gohandlers/handler_proxy_ollama_default_tag_test.go: the route table over both engines and strict and optimistic modes68 subtests fail against
1cda972.A live run on
integration/test-october(85f9244) against real Ollama checked:all-minilmreturns 200 on/olla/ollama/api/embed,/olla/proxy/v1/embeddingsand/olla/proxy/api/embed;/olla/models/all-minilmreturns 200;all-minilm:latest;Checklist
make readypasses atdc5192aconcepts/model-routing.md,integrations/backend/ollama.md,api-reference/ollama.md,concepts/model-aliases.md, and the v0.0.30 release notesKnown limitations. Neither is worse than main, where every bare name 404s.
FOO:latest),fooandfoo:latestrecord separate stats rows and sticky keys.ollama cp) can leaveGET /olla/models/fooreturning 404. Requests still route.prefix_hashsticky keys hash the raw body, so they still differ between spellings. That behaviour predates this PR.Commit history:
fcbab95,60d2094and349502dare cherry-picks that only passmake readywithc1f3028. Review the branch as a unit, or squash it.Summary by CodeRabbit
:latestmodel when no exact name is available. Exact matches take precedence, and this fallback applies only to Ollama models.