Skip to main content

persist_model_cache

Function persist_model_cache 

pub fn persist_model_cache(
    config: &Config,
    provider_name: &str,
    models: &[String],
) -> Result<()>
Expand description

Persist the fetched model catalog to the shared cache location so that /model can display available models without a live probe.

The cache is written to <data_dir>/state/models_cache.json — the canonical instance-wide runtime-state directory (databases, daemon state), honoring ZEROCLAW_DATA_DIR overrides. Both the CLI writer and the channel reader resolve this same path via Config::data_dir.