Skip to main content

resolve_cache_dir

Function resolve_cache_dir 

Source
pub fn resolve_cache_dir(
    root: &Path,
    model_repo: &str,
    override_dir: Option<&Path>,
) -> PathBuf
Expand description

Resolve the cache directory for a project + model combination.

Resolution priority:

  1. override_dir parameter (highest)
  2. .ripvec/config.toml in directory tree (repo-local)
  3. RIPVEC_CACHE environment variable
  4. XDG cache dir (~/.cache/ripvec/)

For repo-local, the cache lives at .ripvec/cache/ directly (no project hash or version subdirectory — the config.toml pins the model and version).

For user-level cache, layout is <base>/<project_hash>/v<VERSION>-<model_slug>/.