Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Run a coding agent on your own computer

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.

Hardware requirements

  • 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

Windows PC Users

  1. Install LM Studio: download the Windows installer from lmstudio.ai and run it.

  2. Install Node.js if needed. In a terminal:

    winget install OpenJS.NodeJS.LTS
    
  3. Install Git if needed. In a terminal:

    winget install Git.Git
    
  4. Make sure your NVIDIA driver is current (GeForce Experience or nvidia.com).

  5. Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:

    lms --version
    

    LM Studio sets this up automatically. If the command isn't recognized, run cmd /c %USERPROFILE%\.lmstudio\bin\lms.exe bootstrap once, then open a new terminal.

That's the platform setup done — continue with Step 1 below.

Mac Users

  1. Install LM Studio: download the Apple Silicon build from lmstudio.ai and drag it into Applications.

  2. Install Node.js: download the LTS installer from nodejs.org.

  3. Git: if git isn't installed already, macOS offers to install it the first time you use it. Accept.

  4. Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:

    lms --version
    

    LM Studio sets this up automatically. If the command isn't recognized, run ~/.lmstudio/bin/lms bootstrap once, then open a new terminal.

That's the platform setup done — continue with Step 1 below.

Linux Users

  1. Install LM Studio: download the AppImage from lmstudio.ai, make it executable (chmod +x), and run it.

  2. Install Node.js (LTS) and Git with your package manager.

  3. Make sure your NVIDIA driver is current.

  4. Open LM Studio once, then open a terminal in VS Code (Terminal -> New Terminal) and check the CLI works:

    lms --version
    

    LM Studio sets this up automatically. If the command isn't recognized, run ~/.lmstudio/bin/lms bootstrap once, then open a new terminal.

That's the platform setup done — continue with Step 1 below.

Step 1: download the model and chat with it

  1. Open LM Studio and click the Discover tab (magnifying glass).

  2. Search for Qwen3.8-27B. Pick the upload by unsloth called Qwen3.8-27B-GGUF.

  3. In the download options, choose the Q4_K_M quantization (about 18 GB) and download it.

  4. In the VS Code terminal, check it arrived:

    lms ls
    

    You should see qwen3.8-27b.

  5. Check it fits in memory before loading:

    lms load qwen3.8-27b -c 32768 --gpu max --estimate-only
    

    Expect 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 32768 with -c 16384 here and in the next step. On a 24 GB GPU, expect to need -c 16384.

  6. Load it:

    lms load qwen3.8-27b -c 32768 --gpu max --speculative-draft-mtp -y
    

    If the --speculative-draft-mtp flag gives an error on your machine, drop it and run the command without it.

  7. 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.

Step 2: install the fixed chat template and run OpenCode

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.

  1. 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.)

  2. 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.

  3. Reload the model so the template takes effect:

    lms unload --all
    lms load qwen3.8-27b -c 32768 --gpu max --speculative-draft-mtp -y
    
  4. Start the local server:

    lms server start -p 1234
    

    To check it's up: curl http://localhost:1234/v1/models (on Windows PowerShell, type curl.exe instead of curl). You should see qwen3.8-27b in the reply.

  5. Install OpenCode:

    npm install -g opencode-ai
    
  6. Get the store project:

    git clone https://github.com/ed-donner/store
    
  7. In VS Code, open the store folder (File -> Open Folder), then open a terminal there and run:

    opencode
    

    The project already contains the configuration that points OpenCode at your local server, plus the spec for the store and sensible permissions.

  8. Tell Qwen:

    Deliver Phase 1 of the spec
    

    Then watch it work. When it finishes, run the checks listed under Phase 1 in AGENTS.md — you'll run npm install and npm run dev yourself and open the address it prints in your browser.

  9. For the later phases, quit OpenCode and start a fresh opencode session for each one. Small models work much better when each session starts clean, and the code on disk carries everything forward between sessions.

Footnotes

  1. No suitable machine at all? You can rent a GPU by the hour on RunPod (an RTX 3090 is about $0.50/hr, a 48 GB L40S about $1/hr) and run the same steps there.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages