Skip to content

fix: embed and pull commands now respect models config and env vars#571

Open
beorn wants to merge 1 commit intotobi:mainfrom
beorn:fix/embed-model-config
Open

fix: embed and pull commands now respect models config and env vars#571
beorn wants to merge 1 commit intotobi:mainfrom
beorn:fix/embed-model-config

Conversation

@beorn
Copy link
Copy Markdown

@beorn beorn commented Apr 13, 2026

Summary

  • qmd embed and qmd pull hardcoded DEFAULT_*_MODEL_URI, ignoring the models: section in index.yml and QMD_EMBED_MODEL / QMD_RERANK_MODEL / QMD_GENERATE_MODEL environment variables
  • qmd status always displayed default model URIs even when custom models were configured
  • Only query and vsearch honored custom models (via the LlamaCpp instance set up in getStore())

Fix

Adds a module-level models object initialized with defaults, resolved to configured values (config > env > default) during getStore() initialization. The embed, pull, and status commands 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-8B via models.embed in index.ymlqmd query used the configured model correctly, but qmd embed -f always re-embedded with the default 300M model.

Test plan

  • All 250 existing tests pass
  • Verified qmd embed prints configured model URI (was: always embeddinggemma-300M)
  • Verified qmd status shows configured model

Happy to add CLI-level tests for model config propagation if desired.

Relates to #494 (v2.1.0 fix only covered LlamaCpp init, not embed/pull/status code paths).

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).
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.

1 participant