fix: embed and pull commands now respect models config and env vars#571
Open
fix: embed and pull commands now respect models config and env vars#571
Conversation
The `embed` and `pull` commands hardcoded DEFAULT_*_MODEL_URI, ignoring both the `models:` section in index.yml and QMD_*_MODEL environment variables. Only `query` and `vsearch` honored custom models (via the LlamaCpp instance set up in getStore). Adds a module-level `models` object that resolves URIs once during store initialization (config > env var > default). The embed, pull, and status commands now read from this object instead of hardcoded defaults. Fixes tobi#494 (partially — the v2.1.0 fix only covered LlamaCpp init in getStore, not the embed/pull/status code paths).
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
qmd embedandqmd pullhardcodedDEFAULT_*_MODEL_URI, ignoring themodels:section inindex.ymlandQMD_EMBED_MODEL/QMD_RERANK_MODEL/QMD_GENERATE_MODELenvironment variablesqmd statusalways displayed default model URIs even when custom models were configuredqueryandvsearchhonored custom models (via theLlamaCppinstance set up ingetStore())Fix
Adds a module-level
modelsobject initialized with defaults, resolved to configured values (config > env > default) duringgetStore()initialization. Theembed,pull, andstatuscommands read from this object instead of hardcoded defaults.The catch path in
getStore()also resolves models from env/defaults, so the POJO is never stale even if config loading fails.Motivation
Discovered while trying to use
Qwen3-Embedding-8Bviamodels.embedinindex.yml—qmd queryused the configured model correctly, butqmd embed -falways re-embedded with the default 300M model.Test plan
qmd embedprints configured model URI (was: alwaysembeddinggemma-300M)qmd statusshows configured modelHappy to add CLI-level tests for model config propagation if desired.
Relates to #494 (v2.1.0 fix only covered
LlamaCppinit, notembed/pull/statuscode paths).