load_model
Load a model into memory for inference. Specify the model key and optional settings like context length or flash attention.
Instructions
Load a model into memory so it is ready for inference.
If context_length is omitted, the model's configured default is used. Only LLMs loaded via LM Studio's llama.cpp engine honor flash_attention, num_experts, eval_batch_size and offload_kv_cache_to_gpu.
Examples: load_model(model_key="qwen/qwen3-4b-2507") load_model(model_key="openai/gpt-oss-20b", context_length=16384, flash_attention=True)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_key | Yes | ||
| num_experts | No | ||
| context_length | No | ||
| eval_batch_size | No | ||
| flash_attention | No | ||
| offload_kv_cache_to_gpu | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||