This guide gets you running Qwen3.8-27B, a strong open-weight coding model, on your own machine with LM Studio. Then you'll connect it to OpenCode, a coding agent, and have it build a small online store.
The guide has two parts. First there are one-off installation steps that depend on your platform: find your section below (Windows, Mac or Linux) and work through it. Then come the main steps — Step 1 and Step 2 — which are the same for everyone.
- Mac: Apple Silicon with 32 GB of memory or more.
- Windows or Linux PC: an NVIDIA GPU with 24 GB of VRAM or more (RTX 3090 or RTX 4090 class). 32 GB (RTX 5090) gives you more room.
If your machine has less than this, you can still follow along: in the model download step, pick a smaller model instead — for example the 9B version of Qwen3.8 at 4-bit. The steps are the same; the results will be weaker.1
-
Install LM Studio: download the Windows installer from lmstudio.ai and run it.
-
Install Node.js if needed. In a terminal:
winget install OpenJS.NodeJS.LTS -
Install Git if needed. In a terminal:
winget install Git.Git -
Make sure your NVIDIA driver is current (GeForce Experience or nvidia.com).
-
Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:
lms --versionLM Studio sets this up automatically. If the command isn't recognized, run
cmd /c %USERPROFILE%\.lmstudio\bin\lms.exe bootstraponce, then open a new terminal.
That's the platform setup done — continue with Step 1 below.
-
Install LM Studio: download the Apple Silicon build from lmstudio.ai and drag it into Applications.
-
Install Node.js: download the LTS installer from nodejs.org.
-
Git: if
gitisn't installed already, macOS offers to install it the first time you use it. Accept. -
Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:
lms --versionLM Studio sets this up automatically. If the command isn't recognized, run
~/.lmstudio/bin/lms bootstraponce, then open a new terminal.
That's the platform setup done — continue with Step 1 below.
-
Install LM Studio: download the AppImage from lmstudio.ai, make it executable (
chmod +x), and run it. -
Install Node.js (LTS) and Git with your package manager.
-
Make sure your NVIDIA driver is current.
-
Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:
lms --versionLM Studio sets this up automatically. If the command isn't recognized, run
~/.lmstudio/bin/lms bootstraponce, then open a new terminal.
That's the platform setup done — continue with Step 1 below.
-
Open LM Studio and click the Discover tab (magnifying glass).
-
Search for
Qwen3.8-27B. Pick the upload by unsloth called Qwen3.8-27B-GGUF. -
In the download options, choose the Q4_K_M quantization (about 18 GB) and download it.
-
In the VS Code terminal, check it arrived:
lms lsYou should see
qwen3.8-27b. -
Check it fits in memory before loading:
lms load qwen3.8-27b -c 32768 --gpu max --estimate-onlyExpect an estimate of 18-19 GB. If the estimate is more than your machine can take (over about 21 GB on a 32 GB Mac, or over your GPU's VRAM on a PC), use a smaller context: replace
-c 32768with-c 16384here and in the next step. On a 24 GB GPU, expect to need-c 16384. -
Load it:
lms load qwen3.8-27b -c 32768 --gpu max --speculative-draft-mtp -yIf the
--speculative-draft-mtpflag gives an error on your machine, drop it and run the command without it. -
Chat with the model in the LM Studio chat tab. Ask it for a small function in any language, then a follow-up question. Expect roughly 10-20 tokens per second on an M1 Max Mac, and more on a recent NVIDIA card. The model thinks out loud at length before answering; the next step deals with that.
The chat template that ships with the model has a bug that breaks tool calling, which the coding agent needs. The fix is to paste in a corrected template. This step is demonstrated in the video.
-
Open
chat_template.jinja— it's included in this repo. Select all of it and copy it. (It comes from froggeric's Qwen-Fixed-Chat-Templates on Hugging Face.) -
In LM Studio, go to My Models, click the gear icon next to the Qwen model, then Load -> Advanced Load Params -> Chat Template. Paste the template over what's there and save.
-
Reload the model so the template takes effect:
lms unload --all lms load qwen3.8-27b -c 32768 --gpu max --speculative-draft-mtp -y -
Start the local server:
lms server start -p 1234To check it's up:
curl http://localhost:1234/v1/models(on Windows PowerShell, typecurl.exeinstead ofcurl). You should seeqwen3.8-27bin the reply. -
Install OpenCode:
npm install -g opencode-ai -
Get the store project:
git clone https://github.com/ed-donner/store -
In VS Code, open the
storefolder (File -> Open Folder), then open a terminal there and run:opencodeThe project already contains the configuration that points OpenCode at your local server, plus the spec for the store and sensible permissions.
-
Tell Qwen:
Deliver Phase 1 of the specThen watch it work. When it finishes, run the checks listed under Phase 1 in AGENTS.md — you'll run
npm installandnpm run devyourself and open the address it prints in your browser. -
For the later phases, quit OpenCode and start a fresh
opencodesession for each one. Small models work much better when each session starts clean, and the code on disk carries everything forward between sessions.