Free Shipping on all orders · Priority Mail Shipping with fee of $8.00
🐳
Divine Tribe Software · Open Source

ds4-three-way

Same prompt, three AI engines, one MacBook — and the local one beat the cloud.

HTMLMIT licensedOpen source
💻 HTML
Primary Language
📅 August 2026
Last Updated
See it in action

Watch the demo

What it is

The day local AI caught up to the data center.

On May 9, 2026, the engineer who wrote Redis (Salvatore "Antirez" Sanfilippo) shipped a few thousand lines of C code that quietly changed what's possible on a personal laptop. The project is called ds4 — a hand-tuned native inference engine for one specific 284-billion-parameter model called DeepSeek V4 Flash.

I gave the same prompt — "build an animated northern lights scene" — to three different AI engines on the same MacBook Pro: DeepSeek V4 Flash running locally through ds4, cloud Claude through the Max plan, and Gemma 4 31B running locally through MLX. Local DeepSeek beat cloud Claude on wall-clock time. Each engine produced a completely different aurora. None of the local outputs ever left the laptop.

Why it's different

What makes ds4-three-way special

Local beat cloud

DeepSeek V4 Flash via ds4 finished in 103 seconds. Cloud Claude needed 192. Same prompt, same hardware, no internet round-trip.

🧠

1 million-token context

ds4 ships with disk-backed KV cache, so a 25k-token Claude Code system prompt prefills exactly once, ever. After that it's free.

🍎

Pure Metal native

No PyTorch, no TensorFlow, no llama.cpp wrapper. Hand-written C plus Apple Metal kernels for one specific 284B MoE model.

🎨

Three completely different auroras

Same prompt, three completely different artistic interpretations. The model is the lens — DeepSeek went pine-forest, Claude went mountains, Gemma went minimalist.

🔒

Off-cloud by construction

Local inference. Verified with lsof. The same workflow that drives the AirGap legal/medical reviews.

📦

Drop-in for Claude Code

claude-ds4 wrapper at ~/.local/bin replaces the cloud claude binary. Same UX. No API key. No rate limit. No bill.

Who it's for

Is this for you?

  • Developers who want frontier-class AI without a monthly cloud bill
  • Lawyers, doctors, and compliance-bound shops who can't put client data on someone else's GPU
  • Anyone running long-context agentic loops where the meter was killing the budget
  • Local AI builders who want to see what a hand-tuned native engine looks like
How to get it

Getting started in minutes

1

Build the engine

git clone github.com/antirez/ds4 then make. Apple Silicon with Metal. Takes about 30 seconds.

2

Pull the q2 weights

./download_model.sh q2 grabs the 81 GB GGUF. About 35 minutes on a fast pipe.

3

Boot the local server

ds4-server-up brings up the Anthropic-compatible endpoint on port 8000.

4

Run Claude Code on it

claude-ds4 — drop-in replacement for the regular claude command. Done.

Ready to try ds4-three-way?

It's free, open source, and runs on the hardware you already own. Head to GitHub to get started, or drop a star to help us keep building in public.

For firms · Confidential workflows

Need this for a law firm, healthcare org, or anywhere documents can't leave the machine?

ds4-three-way runs the same on your firm's MacBook as it does on mine. AirGap AI is the commercial pilot — a 14-day engagement that ships ds4-three-way (and the rest of the local-AI stack) into a real legal/medical workflow with verified network audits. Privileged docs in, answers out, never a byte to a cloud.

Explore the AirGap pilot → Get in touch
Stay in the tribe

More from Divine Tribe

Full technical docs

The complete README

Open the GitHub README — every detail, every benchmark, every code block

🐳 ds4-three-way — Local AI vs Cloud, Same Prompt, One MacBook

The day Antirez shipped ds4, I gave the same prompt to three different AI engines on the same 128 GB MacBook Pro.
Local DeepSeek V4 Flash beat cloud Claude on wall-clock time.

Watch the three-way comparison on YouTube
▶ Watch on YouTube — three engines, three completely different auroras

Built by Matt Macosko · companion to claude-code-local


The benchmark

One identical prompt sent to three different inference stacks on the same MacBook:

"Build a complete single-file HTML page with an animated northern lights scene using vanilla JavaScript and inline CSS — wide canvas, deep starfield with subtle twinkling, mountain silhouette with jagged peaks, pine tree silhouettes along the ridges, brilliant flowing aurora bands shifting between green, teal, magenta, and violet, animating smoothly forever; the mountains and trees should pick up a subtle colored glow from the aurora overhead."

Engine Time Output Hosted on
🐳 DeepSeek V4 Flash (ds4 local) 103 s 3,259 tokens Apple Silicon GPU
☁️ Cloud Claude (Max plan) 192 s ~3,500 tokens Anthropic data center
🟢 Gemma 4 31B (MLX local) 131 s 1,992 tokens Apple Silicon GPU

Each one produced a completely different aurora. None of the local outputs left the laptop.


What's in this repo

ds4-comparison-video/
├── README.md                                this file
├── run_benchmark.sh                         hits all 3 backends with the same prompt
├── narration.txt                            the voiceover script
├── outputs/
│   ├── ds4.html              → DeepSeek's interpretation
│   ├── cloud-claude.html     → Cloud Claude's interpretation
│   └── gemma.html            → Gemma's interpretation
├── comparison.html                          three-up iframe page used in the video
├── scene-{ds4,cloud-claude,gemma}.html      single-engine showcase pages
├── title.html / outro.html                  title and outro cards
├── recordings/                              captured PNGs + MP4 segments
└── ds4-comparison-final.mp4                 the finished 52-second video

Reproduce it

# 1. Boot the local servers (each idempotent)
~/.local/bin/ds4-server-up        # DeepSeek V4 Flash on :8000
~/.local/bin/mlx-server-up        # Gemma 4 31B on :4000

# 2. Run the benchmark — saves outputs/{ds4,gemma,cloud-claude}.html
bash run_benchmark.sh

# 3. Open the live three-up comparison in your browser
open comparison.html

For Cloud Claude, the script shells out to claude --print so it uses your Max-plan subscription instead of API credits.


Why each engine produced what it produced

  • ds4 / DeepSeek V4 Flash went pine-forest with a flowing teal/lavender ribbon aurora. Most cohesive of the three. The mountains read as a dense tree silhouette, not a peak-line — coherent interpretation of "mountain ridges with pine trees along them."
  • Cloud Claude / Sonnet went the most cinematic — vivid magenta + teal aurora bands draped across jagged mountain silhouettes, with subtle luminescent dusting along the peaks.
  • Gemma 4 31B went minimalist — a clean line-drawing mountain silhouette under a single sweeping streak of green and violet. Stylized, almost graphic.

Three completely different aesthetic interpretations of one prompt, on the same hardware. The model is the lens.


Reading list (companion writing)


License

MIT. Output HTML files are AI-generated and reflect each respective model's license.

May 9, 2026.