Expand description
XDG-compliant model cache directory layout.
Resolution order for the model cache root:
FRANKENSEARCH_MODEL_DIR— explicit override (CI, Docker, shared cache)FRANKENSEARCH_DATA_DIR— override data home for all frankensearch dataXDG_DATA_HOME/frankensearch/models/— XDG spec (Linux)~/Library/Application Support/frankensearch/models/— macOS (when XDG unset)~/.local/share/frankensearch/models/— POSIX fallback
Within the cache root, each model gets a base directory. Versioned subdirectories are also provisioned for forward-compatible migrations:
<root>/
potion-base-128M/
all-MiniLM-L6-v2/
onnx/model.onnx
tokenizer.json
config.json
manifest.json
potion-base-128M/
v1/
model.safetensors
tokenizer.json
config.json
manifest.jsonStructs§
- Known
Model - Metadata for a known model in the cache layout.
- Model
Cache Layout - Description of the full cache directory tree.
- Model
DirEntry - One model’s directory entry within the cache layout.
Constants§
- ENV_
DATA_ DIR - Environment variable: override data home for all frankensearch data.
- ENV_
MODEL_ DIR - Environment variable: explicit model cache directory override.
- MODEL_
CACHE_ LAYOUT_ VERSION - Schema version for the cache layout format.
Functions§
- ensure_
cache_ layout - Ensure the cache layout directories exist on disk.
- ensure_
default_ cache - Resolve the cache root and ensure all directories exist.
- is_
model_ installed - Check whether a specific model appears installed (all expected files present).
- known_
models - Return all known models in the cache layout.
- model_
file_ path - Resolve the expected path for a specific model file within the cache.
- resolve_
cache_ root - Resolve the model cache root directory using the priority chain.