Skip to content

Usability Issue: Mandatory positional arguments override environment variables, confusing configuration hierarchy #98

Description

@daryltucker

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:

  1. 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).
  2. Environment Variable: If the flag is absent, use the value from OLLAMA_EMBEDDING_MODEL.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions