AI/TLDR

DwarfStar

A deliberately narrow C inference engine for DeepSeek V4 and GLM 5.x on Metal, CUDA and ROCm, with SSD streaming for machines that are short on RAM

Local RuntimesOpen source
Updated
6 May 2026
Language
C
License
MIT
$git clone https://github.com/antirez/ds4.git

What's new

6 May 2026

Salvatore Sanfilippo published the engine, a C/Metal inference path for DeepSeek V4 Flash on Apple Silicon, later extended to DeepSeek V4 PRO, GLM 5.x, CUDA and ROCm.

Overview

DwarfStar — the repository is antirez/ds4 — is a small native inference engine aimed at running a handful of excellent open-weight models on hardware people actually own. It targets DeepSeek V4 Flash (including the experimental vision model), DeepSeek V4 PRO, GLM 5.2, GLM 5.3 and GLM 5.3 Flash. It is deliberately not a general GGUF runner: you use the GGUF files the project itself produces, which are part of the project.

The primary target is Metal on Macs with 96 GB or more; smaller machines can fall back to SSD streaming, which is also how you run a full (non-Flash) GLM 5.x on a 128 GB system. NVIDIA CUDA is supported with the DGX Spark as the main goal, and multi-GPU setups that other backends do not cover — the project reports about 126 tokens/s aggregate generation across 16 sessions on an eight-L40S Flash setup. ROCm covers Strix Halo machines such as the Framework Desktop. Two 128 GB Macs joined over RDMA can run 4-bit DeepSeek Flash or GLM 5.3 Flash with tensor parallelism, and pipeline parallelism can glue several systems together to pool their RAM.

The repo ships more than a library: an interactive CLI (`ds4`), an HTTP server (`ds4-server`) and a native coding agent (`ds4-agent`) that runs inference in-process and uses each model's own tool format. Model loading, prompt rendering, tool calls, KV state, the server and the agent are built and tested together. The author is explicit that the project is beta and fast-moving, that it is developed with heavy assistance from AI coding agents, and that it exists thanks to llama.cpp and GGML — whose quant layouts, CPU quant logic and some kernels are retained here under the MIT license.

What it does

  • Native C engine specialised for DeepSeek V4 Flash/PRO and GLM 5.2 / 5.3 / 5.3 Flash, using GGUF files the project builds itself
  • Metal on Apple Silicon as the primary backend, plus CUDA (including Ada Lovelace and L40S multi-GPU) and ROCm on Strix Halo
  • SSD streaming so models larger than available RAM still run at a usable speed
  • Tensor parallelism over RDMA between two machines, and pipeline parallelism to pool RAM across several systems
  • Three front ends built and tested together: the ds4 interactive CLI, ds4-server on port 8000, and the in-process ds4-agent coding agent
  • Session management for the agent — /save, /list, /switch, /del and /strip against KV snapshots in ~/.ds4/kvcache
  • Bundled tooling and data for GGUF conversion, imatrix, quality and speed measurement

Getting started

Clone the repo and pick the build for your hardware; each platform guide in docs/ covers prerequisites and memory sizing. Model support is intentionally opportunistic — a model can be dropped when a better replacement arrives.

Clone the repository

bashbash
git clone https://github.com/antirez/ds4.git
cd ds4

Build for your platform

Plain `make` builds the Metal backend on Apple Silicon; the CUDA and ROCm targets have their own make goals and their own guides under docs/.

bashbash
make               # Metal on Apple Silicon
make cuda-spark    # DGX Spark
make strix-halo    # Strix Halo / Framework Desktop
make cuda-generic  # one or more CUDA cards, including Ada/L40S

Download a model

For a first run on a 96 or 128 GB machine the README suggests DeepSeek V4 Flash Q2. Files land in gguf/; re-run the command to resume an interrupted download, and leave headroom for context and runtime buffers.

bashbash
./download_model.sh ds4f-q2

Run the CLI, the agent or the server

The default model is ds4flash.gguf, a link the main-model downloads update; pass -m FILE to choose explicitly. The server listens on http://127.0.0.1:8000.

bashbash
./ds4
./ds4 -p "Explain Redis streams in one paragraph."
./ds4-agent
./ds4-server --ctx 32768

Point an external coding agent at it

For Pi, OpenCode, Codex CLI or Claude Code use ds4-server rather than ds4-agent, and follow docs/CLIENTS.md.

bashbash
./ds4-server --ctx 32768
# then configure your client against http://127.0.0.1:8000

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Run DeepSeek V4 Flash or GLM 5.3 Flash locally on a 96–128 GB Mac, or stream from SSD on a smaller one
  • Serve a multi-user local LLM endpoint from several CUDA cards, including generations other backends have dropped
  • Pool two machines over RDMA or several over pipeline parallelism to fit a model no single box holds
  • Use a coding agent that runs inference in-process, keeping token history and model state together

How DwarfStar compares

DwarfStar alongside other open-source local runtimes tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Ollama★ 180kA developer-friendly tool that downloads and runs local LLMs from the terminal with a built-in OpenAI-compatible API.
llama.cpp★ 128kA C/C++ inference engine that runs LLMs in the GGUF format on CPUs, Apple Silicon, and GPUs with low memory use.
GPT4All★ 77.4kGPT4All is a free desktop app and Python client that runs large language models locally on your own computer, with no API calls or GPU required.
LocalAI★ 49kA self-hosted server that exposes an OpenAI-compatible API for running text, vision, voice, and image models on local hardware.
Jan★ 44.4kAn open-source desktop app that runs LLMs fully offline as a ChatGPT-style assistant on your own computer.
AirLLM★ 33.9kA Python inference library that keeps only one transformer layer on the GPU at a time, so a 70B model runs on a single 4GB card and a 671B MoE model on about 12GB, without quantization.
Colibrì★ 27.1kA pure-C inference engine that keeps a Mixture-of-Experts model's dense trunk resident in RAM and streams its routed experts from disk, so 744B-2.8T models run on consumer hardware.
DwarfStarA deliberately narrow C inference engine for DeepSeek V4 and GLM 5.x on Metal, CUDA and ROCm, with SSD streaming for machines that are short on RAM