LM Studio: load model
load_modelLoad a model into memory with settings like GPU offload, context length, and TTL. Keeps an already loaded model unless replace is set to true.
Instructions
Load a model into memory. Large models can take minutes and most of the RAM: run estimate_load first and get the user's OK for big ones. If the model is already loaded it is kept as it is; pass replace: true to reload it with other settings. Saved model_defaults fill in missing settings. ttl, gpu, parallel and identifier use the lms CLI (LM Studio on this machine only); flash_attention, eval_batch_size, num_experts and offload_kv_cache_to_gpu use the REST API. The two groups can't be mixed in one call.
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": "load_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gpu | No | GPU offload: "off", "max" or a ratio such as "0.5". | |
| ttl | No | Unload automatically after this many idle seconds. | |
| model | Yes | Model key from list_models. | |
| replace | No | Unload the loaded instance(s) of this model first, then load it with these settings. | |
| parallel | No | How many predictions may run at the same time. | |
| identifier | No | Custom instance id; loads a separate instance even if the model is already loaded. | |
| num_experts | No | Active experts for MoE models (llama.cpp engine only). | |
| context_length | No | Context window in tokens. Default: the saved default, else the model's own setting. Leave it out unless the user asks for a specific context: a saved default is the user's choice for this model. | |
| eval_batch_size | No | Tokens per evaluation batch (llama.cpp engine only). | |
| flash_attention | No | Flash attention (llama.cpp engine only). | |
| offload_kv_cache_to_gpu | No | false keeps the KV cache in RAM (llama.cpp engine only). |