@mitsuhiko: Nice! @antirez merged my tool parameter streaming changes into ds4. Means you can now just install the pi extension and…
Summary
Developer mitsuhiko released an open-source Pi extension that integrates with ds4 to streamline running DeepSeek V4 Flash locally on macOS. The tool automates model downloads, quantization selection based on RAM, and server lifecycle management for a seamless local LLM experience.
View Cached Full Text
Cached at: 05/09/26, 03:42 AM
Nice! @antirez merged my tool parameter streaming changes into ds4. Means you can now just install the pi extension and you get great behavior from ds4 out of the box. Moved the extension into a separate repo now. You “just” need a 128GB Mac now. https://t.co/DuOLrddPSi
mitsuhiko/pi-ds4
Source: https://github.com/mitsuhiko/pi-ds4
pi-ds4
Pi provider extension for running antirez/ds4 as a local DeepSeek V4 Flash model. The goal here is to see how good the UX and behavior can be around local models.
The extension registers the ds4/deepseek-v4-flash model, starts ds4-server
on demand, downloads/builds the runtime if needed, keeps a per-pi-process lease,
and stops the server via a bundled watchdog when no clients are left.
Requirements and Behavior
You will need a mac with at least 128GB of RAM. The way this is set up right now is that it will install the 2-bit quantized model if you have 128GB of RAM and it will pick the 4-bit quantized model if you have 256MB or more.
If you are signed into huggingface then your token is used for faster downloads. The server is compiled/started and models are downloaded automatically on first use.
Install
pi install https://github.com/mitsuhiko/pi-ds4
For local development from this checkout, pass the path to an existing ds4 server checkout:
./install-pi-extension-local.sh /path/to/antirez-ds4-checkout
If ~/.pi/ds4/support already exists and points elsewhere, use --force to
move it aside and install a symlink to the checkout you passed. Any existing
gguf/*.gguf model files (and resumable .gguf.part downloads) are preserved
into the new checkout first, using APFS clone-on-write copies on macOS when
available.
Then restart pi or run /reload.
Runtime layout
Runtime state is kept under ~/.pi/ds4:
support/— shallow checkout ofhttps://github.com/antirez/ds4(mainby default)kv/— on-disk KV cacheclients/— active pi process leaseslog— build/download/server/watchdog log
The watchdog is bundled in this package (ds4-watchdog.sh), not expected to
exist in the ds4 runtime checkout.
Configuration
Environment overrides:
DS4_SUPPORT_REPO: runtime repo URL (defaulthttps://github.com/antirez/ds4)DS4_SUPPORT_BRANCH: runtime branch (defaultmain)DS4_RUNTIME_DIR: use an existing ds4 checkout instead of~/.pi/ds4/supportDS4_MODEL_QUANT: forceq2orq4(otherwise picked from system memory)DS4_READY_TIMEOUT_MS: server startup timeoutDS4_SERVER_BINARY: customds4-serverbinary path
Use /ds4 inside pi to show the live ds4 log.
Similar Articles
@ttasanen: Just fired up DS4 by @antirez on my Mac Studio M3 Ultra 256GB and man, it’s seriously impressive. A clean, purpose-buil…
DS4 is a specialized inference engine by antirez designed to run DeepSeek V4 Flash locally on high-end Mac hardware, featuring optimized KV cache handling and 1M context support.
A few words on DS4
Antirez announces DwarfStar 4 (DS4), a local AI tool that runs DeepSeek v4 Flash with asymmetric 2/8 bit quantization on high-end consumer hardware, achieving near-frontier performance. He discusses the project's rapid popularity, future plans for model updates and distributed inference, and the significance of local AI for serious tasks.
DS4
Salvatore Sanfilippo released DS4, a project enabling DeepSeek V3 (referred to as V4 in text) Flash to run with a 1M context window on Mac Metal hardware, with potential for DGX and AMD support.
@ivanfioravanti: For anyone wandering what does it mean to run ds4-agent locally on an M5 Max using DeepSeek V4 Flash q2-imatrix gguf mo…
A demo of running ds4-agent locally on an M5 Max with DeepSeek V4 Flash q2-imatrix gguf model, showing self-updating capabilities and integration with HF_HOME for gguf models.
DeepSeek 4 Flash local inference engine for Metal
ds4 is a native local inference engine for DeepSeek V4 Flash optimized for Apple Silicon, featuring disk-based KV cache persistence and Metal acceleration.