Summary
The current implementation of the rlama rag command requires a mandatory positional argument for the model name (e.g., rlama rag <model_name>), which overrides the OLLAMA_EMBEDDING_MODEL environment variable.
This design is counter-intuitive to standard command-line interface (CLI) best practices, where environment variables typically define defaults that can be optionally overridden by flags or arguments. This behavior makes system-wide configuration via environment variables redundant and confusing.
Proposed Solution
The model name argument should be optional. The hierarchy for configuration should follow standard practices:
- Command-line Flags (Highest Priority): Allow users to specify the model using a flag (e.g.,
--model=nomic-embed-text or -m nomic-embed-text).
- Environment Variable: If the flag is absent, use the value from
OLLAMA_EMBEDDING_MODEL.
- Application Default (Lowest Priority): If neither of the above is present, the application should provide a sensible default or explicitly prompt the user if one is missing.
Rationale (Why the alternative is superior)
- Predictable Configuration: Users expect environment variables to set reliable defaults across all commands.
- Flexibility: It allows administrators to set a single default model for an entire system, only requiring users to override it when necessary for specific tasks.
- Better UX: It reduces the need for users to type redundant information in every command execution when a default is already defined.
Example of Current Behavior
export OLLAMA_EMBEDDING_MODEL="bge-m3"
rlama rag nomic-embed-text myrag ./docs
- Result: The environment variable is ignored;
nomic-embed-text is used.
Example of Desired Behavior
export OLLAMA_EMBEDDING_MODEL="bge-m3"
rlama rag myrag ./docs
- Result: The
bge-m3 model from the environment variable is used as the default.
export OLLAMA_EMBEDDING_MODEL="bge-m3"
rlama rag myrag ./docs --model=Qwen3-Embedding-4B-Q8_0:latest
- Result: The
Qwen3-Embedding-4B-Q8_0:latest model from the command line overrides the environment variable.
Thank you for considering this usability improvement.
Summary
The current implementation of the
rlama ragcommand requires a mandatory positional argument for the model name (e.g.,rlama rag <model_name>), which overrides theOLLAMA_EMBEDDING_MODELenvironment variable.This design is counter-intuitive to standard command-line interface (CLI) best practices, where environment variables typically define defaults that can be optionally overridden by flags or arguments. This behavior makes system-wide configuration via environment variables redundant and confusing.
Proposed Solution
The model name argument should be optional. The hierarchy for configuration should follow standard practices:
--model=nomic-embed-textor-m nomic-embed-text).OLLAMA_EMBEDDING_MODEL.Rationale (Why the alternative is superior)
Example of Current Behavior
export OLLAMA_EMBEDDING_MODEL="bge-m3"rlama rag nomic-embed-text myrag ./docsnomic-embed-textis used.Example of Desired Behavior
export OLLAMA_EMBEDDING_MODEL="bge-m3"rlama rag myrag ./docsbge-m3model from the environment variable is used as the default.export OLLAMA_EMBEDDING_MODEL="bge-m3"rlama rag myrag ./docs --model=Qwen3-Embedding-4B-Q8_0:latestQwen3-Embedding-4B-Q8_0:latestmodel from the command line overrides the environment variable.Thank you for considering this usability improvement.