Skip to main content

Opencode Setup

Opencode is an AI-powered CLI tool for software engineering tasks, running locally via LM Studio.

For this setup we will be on your preferred development system.

Installation

curl -fsSL https://opencode.ai/install.sh | sh

Verify:

opencode --version

Configuration

Create a configuration file:

mkdir -p ~/.config/opencode

Edit ~/.config/opencode/opencode.json

Here you want to ensure the model keys match the names of the models loaded in LM Studio, the "name" key within is an alias showed within Opencode.

You may need to adjust baseURL depending on where you are hosting LM Studio.

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"Qwen3.6-35B-A3B-UD-IQ4_XS": {
"name": "Qwen",
"tools": true
}
}
}
}
}