packages/kilo-docs/pages/ai-providers/lmstudio.md
Kilo Code supports running models locally using LM Studio. LM Studio provides a user-friendly interface for downloading, configuring, and running local language models. It also includes a built-in local inference server that emulates the OpenAI API, making it easy to integrate with Kilo Code.
Website: https://lmstudio.ai/
Download and Install LM Studio: Download LM Studio from the LM Studio website.
Download a Model: Use the LM Studio interface to search for and download a model. Some recommended models include:
codellama:7b-code, codellama:13b-code, codellama:34b-code)mistralai/Mistral-7B-Instruct-v0.1)deepseek-coder:6.7b-base)Look for models in the GGUF format. LM Studio provides a search interface to find and download models.
Start the Local Server:
<->).{% tabs %} {% tab label="VSCode (Legacy)" %}
codellama-7b.Q4_0.gguf). You can find this in the LM Studio "Local Server" tab.http://localhost:1234. If you've configured LM Studio to use a different address or port, enter the full URL here.{% /tab %} {% tab label="VSCode" %}
Open Settings (gear icon) and go to the Providers tab to add LM Studio. No API key is needed since LM Studio runs locally. You can configure the base URL if LM Studio is running on a different host or port.
The extension stores this in your kilo.json config file. You can also edit the config file directly — see the CLI tab for the file format.
{% /tab %} {% tab label="CLI" %}
LM Studio runs locally, so no API key is needed. Configure the base URL if LM Studio is running on a different host or port:
Config file (~/.config/kilo/kilo.jsonc or ./kilo.jsonc):
{
"provider": {
"lmstudio": {
"options": {
"baseURL": "http://localhost:1234/v1",
},
},
},
}
Then set your default model:
{
"model": "lmstudio/codellama-7b",
}
{% /tab %} {% /tabs %}
If the model you loaded in LM Studio doesn't appear in the Kilo model picker, you can register it as a custom model in your config file:
{
"model": "lmstudio/my-custom-model",
"provider": {
"lmstudio": {
"models": {
"my-custom-model": {
"name": "My Custom Model",
},
},
},
},
}
The model key (my-custom-model) must match the model identifier that LM Studio serves. If the display name you want differs from the API identifier, use the id field to set the API-facing name separately:
{
"provider": {
"lmstudio": {
"models": {
"my-llama": {
"id": "meta-llama-3.1-8b-instruct",
"name": "Llama 3.1 8B (Local)",
},
},
},
},
}
See Custom Models for the full list of configuration fields and more examples.