Run local AI models on your Mac with LM Studio
Run Qwen3.5 9B on an Apple silicon Mac with LM Studio and MLX in 25 minutes, then connect OpenCode or Pi for free, private coding help.

What you need
LM Studio doesn't run on Intel Macs. MLX models need Apple silicon, so on Windows and Linux LM Studio uses GGUF models instead.
Step 1: Install LM Studio
3 minLM Studio downloads, runs and serves local models, and on a Mac it can use Apple's MLX framework.
- Go to lmstudio.ai/download and download the Mac version.
- Open the downloaded file, drag LM Studio into Applications, then open it.
- Open a terminal and run
lms --helpto check the command line tool.
You should see the LM Studio window, and a list of
lmscommands in the terminal.The terminal can't find
lms?The tool ships with the app but needs one launch first. Open LM Studio once, then open a new terminal window and try again.
The lmstudio.ai home page now leads with Bionic, a separate agent app. This guide uses the LM Studio app.
Step 2: Download Qwen3.5 9B as MLX
6 minMLX builds are made for Apple silicon, and LM Studio lists 7 GB of memory as the minimum for this model.
- Press ⌘ + 2 to open the Discover tab, then search for
qwen3.5 9b. - Pick the MLX build at 4-bit and start the download.
- Or skip the app and run the command below in a terminal.
Or run thislms get qwen/qwen3.5-9b --mlx
You should see Qwen3.5 9B listed in the My Models tab once the download ends.
Not sure which download option to pick?
Choose the MLX build at 4-bit. LM Studio advises 4-bit or higher. The 8-bit build is a little sharper but needs about twice the memory.
- Press ⌘ + 2 to open the Discover tab, then search for
Step 3: Load it with a long context
4 minCoding agents send long prompts, and Qwen advises at least 128K tokens of context to keep the model's thinking intact.
- Run
lms lsand copy the model key, such asqwen/qwen3.5-9b. - Load it with the command below. On a 16 GB Mac, use
32768instead of131072. - In the Chat tab, ask a short question to test it.
Run thislms load qwen/qwen3.5-9b --context-length 131072
You should see a reply in the Chat tab, often after a short thinking section.
Loading fails, or your Mac slows to a crawl?
The context is too big for your memory. Unload the model in the app, close heavy apps, then load it again with
--context-length 32768.Qwen3.5 thinks before it answers by default. The model's Enable Thinking setting turns that off for quick replies.
- Run
Step 4: Set the model up for coding
3 minQwen suggests lower randomness for precise coding than LM Studio's defaults for this model.
- Open the My Models tab and click the gear icon next to Qwen3.5 9B.
- Set Temperature to
0.6and Presence Penalty to0. - Leave Top P at
0.95and Top K at20, then save.
You should see the new values in the model's default settings, used every time it loads.
Replies start to repeat the same lines?
Raise Presence Penalty a little. Qwen says values between 0 and 2 reduce endless repeats.
These are Qwen's numbers for coding with thinking on, from its model card. An app that sends its own temperature overrides them.
Step 5: Start the local server
3 minThe server gives the model an OpenAI-compatible address that coding tools can call.
- Open the Developer tab and turn on Start server. Or run
lms server startin a terminal. - Run the command below to check that the server answers.
Run thiscurl http://localhost:1234/v1/models
You should see a JSON list that includes
qwen/qwen3.5-9b.curlsays the connection was refused?The server isn't running yet. Check the Start server switch, or run
lms server start, then try again.The server uses port 1234 and needs no API key by default. It stays on this Mac unless you choose to serve on your local network.
- Open the Developer tab and turn on Start server. Or run
Step 6: Connect OpenCode or Pi
6 minWith a local model behind them, both agents help you code for free, and your code never leaves your Mac.
- OpenCode: install it from opencode.ai/docs, then run
opencodein your project folder. - Type
/modelsand pick Qwen3.5 9B under LM Studio. OpenCode finds LM Studio athttp://127.0.0.1:1234/v1on its own. - Pi: add the config below to
~/.pi/agent/models.json, runpi, then type/modeland pick the model.
Pi: your models.json{ "providers": { "lmstudio": { "baseUrl": "http://localhost:1234/v1", "api": "openai-completions", "apiKey": "lm-studio", "models": [ { "id": "qwen/qwen3.5-9b", "reasoning": true } ] } } }You should see the agent answering in your project with Qwen3.5 9B as its model.
Pi doesn't list the model in
/model?Pi only lists models it has a key for. Keep the placeholder
apiKeyline, since LM Studio doesn't check keys unless you turn on authentication.Pi's models guide lists every field. Never put a real cloud API key in this file if you share it.
- OpenCode: install it from opencode.ai/docs, then run
You get
Qwen3.5 9B running on your Mac through MLX, with a local server that OpenCode or Pi can use for coding help
Try next
Did this guide work for you?
Thanks. It helps us fix the steps.
Sources
0 of 6Next: Install LM Studio


