{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-lmstudio"
],
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
}
}
}
}```
OpenCode plugin for enhanced LM Studio support with auto-detection and dynamic model discovery.
/v1/models endpoint to discover available modelsorganizationOwner field from model IDslmstudio provider if detected but not configurednpm install opencode-lmstudio
# or
bun add opencode-lmstudio
Add the plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-lmstudio@latest"
],
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
}
}
}
}
If you don't configure the lmstudio provider, the plugin will automatically detect LM Studio if it's running on one of the common ports and create the provider configuration for you.
You can also manually configure the provider with specific models:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-lmstudio@latest"
],
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"google/gemma-3n-e4b": {
"name": "Gemma 3n-e4b (local)"
}
}
}
}
}
The plugin will automatically discover and add any additional models available in LM Studio that aren't already configured.
config hook is calledlmstudio provider is found, it checks if LM Studio is accessible/v1/models endpointhttp://127.0.0.1:1234/v1MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Sign in to leave a comment.