Skip to content

fix: use configured models instead of hardcoded defaults#564

Open
jowitte wants to merge 1 commit intotobi:mainfrom
jowitte:fix/config-model-loading
Open

fix: use configured models instead of hardcoded defaults#564
jowitte wants to merge 1 commit intotobi:mainfrom
jowitte:fix/config-model-loading

Conversation

@jowitte
Copy link
Copy Markdown

@jowitte jowitte commented Apr 12, 2026

Summary

status, embed, and pull commands ignore models.embed / models.generate / models.rerank from index.yml and the corresponding QMD_*_MODEL env vars. They always use the hardcoded defaults (e.g. embeddinggemma-300M).

Root cause: These commands reference the compile-time constants (DEFAULT_EMBED_MODEL_URI etc.) directly, bypassing the LlamaCpp instance that getStore() already configures via setDefaultLlamaCpp().

Fix: Read model URIs from getDefaultLlamaCpp().embedModelName (and new generateModelName / rerankModelName getters) instead of the constants.

Changes

  • src/cli/qmd.ts: 3 call sites updated (status display, embed command, pull command)
  • src/llm.ts: Added generateModelName and rerankModelName getters to LlamaCpp (mirrors existing embedModelName)

Test plan

  • qmd status shows configured model (not default) when models.embed is set in index.yml
  • qmd embed -f uses configured model
  • qmd pull downloads configured models
  • Without config: falls back to defaults as before

Fixes #562

…mbed/pull

The `status`, `embed`, and `pull` commands used the hardcoded
DEFAULT_EMBED_MODEL_URI / DEFAULT_GENERATE_MODEL_URI / DEFAULT_RERANK_MODEL_URI
constants instead of reading the user-configured models from index.yml.

This means `models.embed` (and generate/rerank) in the YAML config as well as
QMD_EMBED_MODEL env var were silently ignored by these three commands, even
though getStore() correctly calls setDefaultLlamaCpp() with the config values.

Fix: read model URIs from the LlamaCpp instance (which already resolves
config → env → default) instead of using the compile-time constants.

Also adds generateModelName and rerankModelName getters to LlamaCpp
(embedModelName already existed).

Fixes tobi#562
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.

embed/status/pull commands ignore config models, always use hardcoded defaults

1 participant