Ensure model is ready
ensure_modelPrepares a local AI model by pulling if needed, checking VRAM fit, evicting models when required, loading it, and verifying readiness; use dryRun to preview the plan.
Instructions
Make a model ready in one call: optionally pull it, check it fits current free VRAM, unload other models if needed (evict: 'lru' or 'all'), load it, and verify. Use dryRun:true to get the plan without changing anything.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>"
},
"name": "ensure_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| evict | No | Unload other models to make room: none (default), lru (least recently used first), all | |
| model | Yes | Model id/name | |
| dryRun | No | Return the plan only (default false) | |
| provider | No | Provider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set). | |
| allowPull | No | Download the model if it is not installed (default false) | |
| keepAlive | No | Keep-alive for the loaded model, e.g. '30m' | |
| kvCacheType | No | KV cache precision used for the fit estimate (default f16) | |
| contextLength | No | Context window to fit and load with (default 4096) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | ||
| plan | Yes | ||
| model | Yes | ||
| ready | Yes | ||
| provider | Yes | ||
| verified | No | false when the runtime could not be asked whether the model is loaded after loading it |