lmstudio_optimize_settings
Finds model load settings that fit your hardware by testing context length, GPU offload, and KV-cache precision against LM Studio's memory estimator, then optionally loads the chosen configuration.
Instructions
Find the best load settings for a model on this hardware, using LM Studio's own memory estimator (no guessing). Searches context length, GPU offload and KV-cache precision so the model fits VRAM/RAM with headroom. Goals: balanced (32k context, full GPU if possible), max_context (largest context that fits), max_speed (everything on GPU, 8k context), max_quality (unquantized KV cache). Set apply=true to load it.
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": "lmstudio_optimize_settings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | No | Default balanced. | |
| apply | No | Load the model with the chosen settings (default false = just recommend). | |
| model | Yes | Model key (partial names work if unique). | |
| identifier | No | ||
| min_context | No | Never pick less than this (default 4096). | |
| single_user | No | Set max_parallel_predictions=1 so one conversation gets the full context and speed (default true). | |
| ttl_seconds | No | ||
| replace_loaded | No | When applying, first unload instances of this same model (default true). | |
| target_context | No | Desired context; overrides the goal's default. | |
| ram_headroom_pct | No | RAM to keep free (default 20). | |
| vram_headroom_pct | No | VRAM to keep free for the OS/other apps (default 10). |