Skip to content

[BUG] Model Path Validation Is Inconsistent #227

@olddev94

Description

@olddev94

Project

vgrep

Description

Description

The model path handling has inconsistent behavior:

  1. embedding_model_path() returns a path even if file doesn't exist
  2. Only has_embedding_model() checks existence
  3. Path resolution logic is duplicated and can diverge
  4. Relative paths resolved differently in different contexts

Error Message

Cryptic model loading errors when path is wrong.

Debug Logs

System Information

- Bounty Version: 0.1.0
- OS: Ubuntu 24.04 LTS
- Rust: 1.75+

Screenshots

No response

Steps to Reproduce

# Set a non-existent model path
vgrep config set embedding_model "/nonexistent/model.gguf"

# Try to serve
vgrep serve
# Error: Failed to load embedding model (cryptic llama-cpp error)

Expected Behavior

  1. embedding_model_path() returns Err if model not found
  2. Clear error message indicating which path was tried
  3. Suggest downloading if model not found
  4. Single source of truth for path resolution

Actual Behavior

  1. Path returned even if file doesn't exist
  2. Cryptic llama-cpp errors
  3. No helpful suggestions
  4. Inconsistent path handling

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvalidValid issuevgrep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions