𝗟𝗼𝗰𝗮𝗹 𝗖𝗼𝗱𝗶𝗻𝗴 𝗔𝗴𝗲𝗻𝘁 𝗼𝗻 𝗠𝗮𝗰𝗢𝗦
You can run a local coding agent on any Apple Silicon Mac. This setup keeps your code private and runs on your own hardware.
Here is how to set it up:
- Install Dependencies You need Python installed. Run these commands to install the MLX libraries:
pip install mlx mlx-lm mlx-vlm
Or use uv:
uv tool install mlx-lm && uv tool install mlx-vlm
- Pick a Model Use the mlx-community on Hugging Face to find models like Gemma, Llama, or Qwen. Model names follow a pattern: {name}-{size}-{instruction tuned}-{precision}.
If you struggle to choose, use this tool I built for MacOS: https://github.com/ruarfff/help-pick-local-model
- Start the Local Server Run the server using your chosen model. I use port 7777 to avoid conflicts.
mlx_lm.server --model mlx-community/gemma-4-26B-A4B-it-OptiQ-4bit --port 7777
For models that handle images and text, use mlx_vlm instead:
mlx_vlm.server --model mlx-community/gemma-4-12B-it-OptiQ-4bit --port 7777
- Connect Your Tools Point your coding agent to your local server.
For GitHub Copilot CLI: Create a shell function in your .zshrc or .bashrc to set the provider to OpenAI and the base URL to http://127.0.0.1:7777/v1.
For OpenCode: Update your ~/.config/opencode/opencode.json file to include your local MLX provider and model details.
For Pi: Update your ~/.pi/agent/models.json file with the local provider configuration.
Running models locally gives you control over your development environment.
Source: https://dev.to/ruarfff/local-coding-agent-on-macos-2gga
Optional learning community: https://t.me/GyaanSetuAi