Expand description
Model and weight cache directory resolution.
Local providers download model weights to a per-provider, per-model directory. This module determines where that directory lives based on (in priority order):
- A per-model
cache_diroption in the spec’s JSON options. - The
UNI_CACHE_DIRenvironment variable (global root override). - A default
.uni_cache/directory relative to the working directory.
Constants§
- CACHE_
ROOT_ ENV - The environment variable used to override the root cache directory.
Functions§
- resolve_
cache_ dir - Resolve the cache directory for a given provider and model.
- resolve_
provider_ cache_ root - Resolve the root cache directory for a provider (no model sub-directory).
- sanitize_
model_ name - Replace
/with--and strip characters that are unsafe in directory names.