Skip to main content

prime_free_model_cache

Function prime_free_model_cache 

Source
pub fn prime_free_model_cache()
Expand description

Prime the free-model cache synchronously at startup.

Called from Router::new() via spawn_blocking so the initial blocking subprocess doesn’t stall the Tokio runtime. Runs run_opencode_models_discovery_async() in a dedicated thread with its own tokio runtime, avoiding block_on restrictions when called from within an existing runtime (e.g. #[tokio::test] or a nested runtime context).