LM Studio and OpenCode: local coding setup
Connect LM Studio to OpenCode as a custom provider, add /v1 to the server URL, and test file creation with Qwen 3.5 9B.
Player not loading? Watch on YouTube
This tutorial connects LM Studio to OpenCode so a local LLM can act as a coding assistant. The speaker starts LM Studio's server in the Developer section, then adds a custom provider in OpenCode. The setup uses the server URL with /v1 appended, an empty API key field, and the model ID copied from LM Studio.
The example uses Qwen 3.5 with 9 billion parameters, identified as an Instruct MTP variant with NVFP4 compression. The speaker says the model needs tool calling for agentic tasks. Model loading settings stay in LM Studio, including context length. He recommends more than 64,000 tokens for coding, but this is his preference, and available memory limits how high the context can go. His example allocates roughly 11 GB of a 16 GB system.
After connecting, the speaker tests a chat in Plan mode, then switches to Build mode and requests a website in vanilla HTML, CSS, and JavaScript with pastel colors. He opens the generated site to inspect the result.
The walkthrough also covers adding models later. In the interface shown, the speaker edits OpenCode's JSON configuration because he cannot reopen the provider setup form. The supplied description gives configuration directories for Windows, macOS, and Linux. Image, video, and audio analysis are described as dependent on the chosen model, rather than demonstrated here.