<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Dalcu</title>
    <description>The latest articles on DEV Community by David Dalcu (@ddalcu).</description>
    <link>https://dev.to/ddalcu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4014224%2Fc1698076-145a-41d1-b86e-50dd9a0111d3.jpeg</url>
      <title>DEV Community: David Dalcu</title>
      <link>https://dev.to/ddalcu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ddalcu"/>
    <language>en</language>
    <item>
      <title>Run Claude Code locally for free: mlx-serve on Apple Silicon</title>
      <dc:creator>David Dalcu</dc:creator>
      <pubDate>Fri, 03 Jul 2026 23:26:39 +0000</pubDate>
      <link>https://dev.to/ddalcu/run-claude-code-locally-for-free-mlx-serve-on-apple-silicon-1m8l</link>
      <guid>https://dev.to/ddalcu/run-claude-code-locally-for-free-mlx-serve-on-apple-silicon-1m8l</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;What if you could run it entirely locally - free, private, and on hardware you already own?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mlx-serve&lt;/strong&gt; makes this possible on any Apple Silicon Mac.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is mlx-serve?
&lt;/h2&gt;

&lt;p&gt;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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;mlx-serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. No Python. No conda. No Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Claude Code locally
&lt;/h2&gt;

&lt;p&gt;Claude Code looks for &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; and &lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt; in your environment. mlx-serve implements the full Anthropic Messages API, so you just point Claude Code at it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:8080
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;local
export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_DEFAULT_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;mlx-serve
mlx-serve &lt;span class="nt"&gt;--model&lt;/span&gt; ~/.mlx-serve/models/mlx-community/gemma-4-e4b-it-4bit &lt;span class="nt"&gt;--serve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then launch Claude Code as normal. Streaming, tool calls, thinking blocks - all work.&lt;/p&gt;

&lt;p&gt;Full setup guide: &lt;a href="https://mlxserve.com/claude-code-local/" rel="noopener noreferrer"&gt;https://mlxserve.com/claude-code-local/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ollama drop-in&lt;/strong&gt;: same &lt;code&gt;/api/chat&lt;/code&gt;, &lt;code&gt;/api/generate&lt;/code&gt;, &lt;code&gt;/api/embed&lt;/code&gt; endpoints - works with Raycast, Open WebUI, Obsidian&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Sandbox&lt;/strong&gt;: isolated Linux VM via Virtualization.framework, live port forwarding to localhost&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image/video/audio gen&lt;/strong&gt;: FLUX, LTX-Video, Qwen3-TTS in the same server process&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS menu-bar app&lt;/strong&gt;: free, includes agent mode, quick launcher (Control+Space), voice cloning&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://mlxserve.com" rel="noopener noreferrer"&gt;https://mlxserve.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Claude Code setup: &lt;a href="https://mlxserve.com/claude-code-local/" rel="noopener noreferrer"&gt;https://mlxserve.com/claude-code-local/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LM Studio comparison: &lt;a href="https://mlxserve.com/lm-studio-alternative/" rel="noopener noreferrer"&gt;https://mlxserve.com/lm-studio-alternative/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ollama alternative: &lt;a href="https://mlxserve.com/ollama-alternative/" rel="noopener noreferrer"&gt;https://mlxserve.com/ollama-alternative/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/ddalcu/mlx-serve" rel="noopener noreferrer"&gt;https://github.com/ddalcu/mlx-serve&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>macos</category>
    </item>
  </channel>
</rss>
