cd /news/developer-tools/run-claude-code-locally-for-free-mlx… · home topics developer-tools article
[ARTICLE · art-47467] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Run Claude Code locally for free: mlx-serve on Apple Silicon

A developer released mlx-serve, a native Zig server for MLX-format language models on Apple Silicon, enabling local, free, and private use of AI coding assistants like Claude Code. The server exposes OpenAI, Anthropic, and Ollama-compatible APIs from a single binary, achieving 35% faster decode than LM Studio on Gemma 4 E4B 4-bit. It requires no Python, conda, or Docker, and can be installed via Homebrew.

read1 min views1 publishedJul 3, 2026

Claude Code is the best AI coding assistant available right now. But it calls the Anthropic API by default, which adds up fast on long sessions.

What if you could run it entirely locally - free, private, and on hardware you already own?

mlx-serve makes this possible on any Apple Silicon Mac.

mlx-serve is a native Zig server for MLX-format language models on Apple Silicon. It exposes OpenAI-compatible, Anthropic-compatible, and Ollama-compatible HTTP APIs - all on a single port, from a single binary.

brew install mlx-serve

That's it. No Python. No conda. No Docker.

Claude Code looks for ANTHROPIC_BASE_URL

and ANTHROPIC_API_KEY

in your environment. mlx-serve implements the full Anthropic Messages API, so you just point Claude Code at it:

export ANTHROPIC_BASE_URL=http://localhost:8080
export ANTHROPIC_API_KEY=local
export ANTHROPIC_DEFAULT_MODEL=mlx-serve
mlx-serve --model ~/.mlx-serve/models/mlx-community/gemma-4-e4b-it-4bit --serve

Then launch Claude Code as normal. Streaming, tool calls, thinking blocks - all work.

Full setup guide: https://mlxserve.com/claude-code-local/

On Apple Silicon, mlx-serve achieves 35%+ faster decode than LM Studio on Gemma 4 E4B 4-bit. The server is written in Zig with no Python runtime overhead.

/api/chat

, /api/generate

, /api/embed

endpoints - works with Raycast, Open WebUI, Obsidian

── more in #developer-tools 4 stories · sorted by recency
── more on @mlx-serve 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/run-claude-code-loca…] indexed:0 read:1min 2026-07-03 ·