Skip to content

Validate embedding model availability at runtime, not just during setup #14

@ernestkoe

Description

@ernestkoe

Problem

The embedding model (e.g., nomic-embed-text for Ollama) is only validated during obsidian-rag setup. At runtime — indexing, searching, watching — the configured model name is passed directly to the API with no pre-flight check. If the model isn't available, the user gets a raw HTTP error with no actionable message.

Expected behavior

Before starting an embedding operation, verify the model is available and surface a clear error like:

Model "nomic-embed-text" is not available in Ollama. Run ollama pull nomic-embed-text to install it.

Where to fix

  • create_embedder() in src/obsidian_rag/indexer.py — could call get_ollama_models() / get_lmstudio_models() and validate before returning the embedder
  • Alternatively, each embedder's embed() could catch the first failure and wrap it in a descriptive error

Relevant code

  • get_ollama_models(): src/obsidian_rag/indexer.py:477
  • is_ollama_running(): src/obsidian_rag/indexer.py:448
  • create_embedder(): src/obsidian_rag/indexer.py:499

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions