Repository navigation
Studio: stop hiding every model pulled with ollama pull - #10222
Conversation
1879e4e to
2da65bc
Compare
|
@codex review Focus on whether admitting these five Ollama metadata layer types is correct and complete, and iterate with me until this converges — I will keep pushing fixes and re-requesting review until you have no open findings. Specific things worth attacking:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b6eb633b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "application/vnd.ollama.image.template", | ||
| "application/vnd.ollama.image.params", | ||
| "application/vnd.ollama.image.system", | ||
| "application/vnd.ollama.image.messages", | ||
| "application/vnd.ollama.image.prompt", |
There was a problem hiding this comment.
Preserve behavior-bearing metadata before admitting it
When a tag was built with a custom Modelfile—such as a SYSTEM persona, seeded MESSAGES, a custom TEMPLATE, or PARAMETER stop values—admitting these layers exposes the tag as loadable even though _ollama_model_info_from_manifest materializes only the model and projector blobs. Selecting that named Ollama tag therefore silently runs the base GGUF without behavior that may define the model, and a missing template or stop sequence can also corrupt chat turn boundaries. Preserve these settings during the llama.cpp load, or continue withholding manifests whose settings cannot be shown to match the GGUF defaults.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not taking this one, and the turn-boundary half of it does not hold for the case the PR is about.
I checked the exemplar rather than reasoning about it. A real ollama pull qwen2.5:0.5b writes image.model 397,807,936 B, image.system 68 B, image.template 1,482 B, image.license 11,343 B. Reading both sides of that store:
- the GGUF carries its own
tokenizer.chat_template, and it renders the same<|im_start|>system/<|im_start|>userstructure the ollama Go template does. The two are not byte-equal because they are different template languages, not because they frame turns differently. - the 68-byte
image.systemlayer isYou are Qwen, created by Alibaba Cloud. You are a helpful assistant., which is the same default string the GGUF's own template emits when no system message is supplied.
So for a pulled tag the template and system layers are a re-expression of what the GGUF already carries, and dropping them does not corrupt turn boundaries. The case where a template layer is load-bearing is a GGUF with no embedded chat template of its own, and there the exposure is not specific to Ollama: Studio already lists any such .gguf sitting in a models folder or an HF cache and loads it the same way. This gate was the only place in the product holding that file to a stricter bar, and holding it there costs every normally pulled model.
The remedy as written also reinstates the defect. "Continue withholding manifests whose settings cannot be shown to match the GGUF defaults" is, in practice, withholding everything: proving a Go template and a Jinja template agree is not something the read-only inventory walk can do, and it would put a GGUF header read into scan_ollama_dir, which is the hot path the codebase deliberately keeps free of them (classification already does its header reads later, off the scan, in a thread).
The other remedy — actually carrying SYSTEM, TEMPLATE and PARAMETER stop into the llama.cpp load — is the right thing to want, and it is a feature rather than a fix: it needs Go-template translation and a params mapping, and it changes loads that work today. Worth its own PR; it should not gate restoring visibility for models that are already on disk.
The trade is stated where the decision is made, in the comment above _OLLAMA_METADATA_LAYER_MEDIA_TYPES.
| _OLLAMA_ADMITTED_LAYER_MEDIA_TYPES = ( | ||
| _OLLAMA_LOADABLE_LAYER_MEDIA_TYPES | _OLLAMA_METADATA_LAYER_MEDIA_TYPES |
There was a problem hiding this comment.
Admit ignorable draft and legacy embed layers
When a valid manifest includes application/vnd.ollama.image.draft or the legacy application/vnd.ollama.image.embed, this allowlist still classifies it as unsupported, so inventory hides the otherwise usable primary model and direct resolution rejects it. A draft model only accelerates output-equivalent speculative decoding, while Ollama itself has ignored the deprecated embed layer since 0.1.2, so dropping either does not prevent llama.cpp from loading the primary GGUF; the recommended-folder probe will nevertheless count such a manifest and can expose a chip whose picker is empty.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 703b9f829. Both are now admitted, in their own set rather than folded into the Modelfile-metadata one, because the reason differs: a draft model only feeds speculative decoding, which is output-equivalent by construction, and image.embed has been dead since ollama 0.1.2 and is ignored by ollama's own load (server/images.go logs "embeddings in modelfiles have been deprecated and will be ignored").
test_an_ignorable_layer_does_not_hide_the_primary_model covers each of the two. It fails on the previous head for both parameters and passes now.
The chip/picker point is right and is worth stating precisely: _dir_has_downloaded_model counts a folder on a resolvable image.model layer alone, without this gate, so before this PR it advertised a chip for every normally pulled model while scan_ollama_dir returned nothing for it. That disagreement is what the PR closes. It survives only for image.adapter and unknown future layers now, which is the intended conservative direction.
|
@codex review
I did not take the P1, and the reply on that thread has the measurements — the short version is that a pulled tag's This is the last round I plan unless something new lands, so please concentrate on whether the new set is wrong rather than restating the metadata trade: is a |
GitHub Actions reproductionBoth branches run the same generated workflow, the same probe, the same runner image and the same What the pull actually wrote, identical on both sides:
Unit-level A/B on the same trees: the two added tests fail on The negative side fails at the intended assertion, not on setup — both jobs completed the install, the pull and the probe. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Studio UI before/afterTwo isolated Studio installs on one machine — merge base The On Device list, filtered to
Read from each photographed server's own
One caveat on reading the picture: the word "qwen" appears on both sides, because this box's HF cache holds a dozen Qwen3 repos. The row that moves is the Ollama one, which is what Also worth recording, since it is a property of the row rather than of the list: the Ollama row's |
|
Confirmed against main: the loadable set in studio/backend/hub/services/models/ollama.py only admits model, projector and license, so the template and system layers a normal ollama pull writes drop the row entirely at the scan. Will get this reviewed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Tested this against the current PR head with a real Before, Studio found nothing. After, the model showed up and resolved to the original GGUF, while unsupported layers stayed blocked. Also confirmed in the UI: 0 rows before, 1 after. The PR fixes the reported issue without weakening the existing layer checks. |
|
Tested against the current head with a real Ollama pull. The issue reproduces on base and is fixed here, while unsupported layers remain rejected. CI is green. Looks good to merge. |

Studio hides an Ollama model if its manifest holds a layer type it does not load, and that list includes the template, params, system, messages and prompt layers that almost every pulled model has. The On Device section and the chat picker end up empty with the files sitting on disk and nothing saying why.
Those layers only hold Modelfile settings that never reach the load anyway. The adapter layer stays hidden because it changes the weights. Tested with a real ollama pull of qwen2.5:0.5b: the list showed zero Ollama rows before and one after.