antirez/ds4

DeepSeek 4 Flash and PRO local inference engine for Metal, CUDA and ROCm

What is DwarfStar (antirez/ds4)?

DwarfStar (the ds4 repository) is a native inference engine that lets you run a handful of cutting‑edge large language models (LLMs) on consumer‑grade hardware – high‑end laptops, desktop Macs, or multi‑GPU workstations. It is deliberately narrow: the code is tuned for a specific set of models (DeepSeek V4 Flash/PRO, GLM 5.2‑5.3, Qwen 3.8 Flash Next) and for the hardware back‑ends that can actually accelerate them (Apple Metal, NVIDIA CUDA, AMD ROCm). The engine works with the GGUF model format (produced by the project itself) and provides a command‑line interface, a “coding‑agent” REPL, and an HTTP server for multi‑session serving.


Key Features (from the README)

Feature Details
Supported models DeepSeek V4 Flash (incl. experimental vision), DeepSeek V4.1 Flash, DeepSeek V4 PRO, GLM 5.2/5.3 (and Flash variants), Qwen 3.8 Flash Next.
Hardware targets • Metal – primary target, runs on Apple Silicon Macs with 64‑96 GB RAM (SSD‑streaming for larger models).
• CUDA – optimized for NVIDIA Ada‑Lovelace cards, multi‑GPU (e.g., DGX Spark, L40S).
• ROCm – for AMD‑based “Strix Halo” workstations (Framework Desktop).
Performance tricks • SSD streaming to run models larger than RAM.
• Multi‑GPU tensor‑parallelism and RDMA‑based cross‑machine parallelism.
• Speculative decoding (MTP) for GLM and Qwen models.
• Directional steering vectors for controllable generation.
Interfaces • ./ds4 – basic CLI with multi‑turn chat.
• ./ds4‑agent – native REPL that shows pre‑fill progress and supports tool calls.
• ./ds4‑server – HTTP server (default http://127.0.0.1:8000) for API access and batching.
Session persistence KV‑cache snapshots saved under ~/.ds4/kvcache; commands to list, save, switch, delete, or strip sessions.
Tooling Scripts to download GGUF files (download_model.sh), evaluation suite (ds4‑eval), and various docs for building, streaming, distributed inference, etc.
AI‑assisted development The author notes the code was heavily written with AI coding agents; users are encouraged to use similar agents to customise the engine.
License & lineage Built on the ideas and kernels of llama.cpp/GGML (MIT‑licensed). Some source files are adapted from those projects.

Who Might Use It?

  • Researchers or hobbyists who want to experiment with the latest open‑weight LLMs locally without renting cloud GPUs.
  • Developers needing a low‑latency, on‑device inference server for applications (e.g., coding assistants, vision‑augmented chat) on Macs or workstations.
  • Power users with multiple GPUs or two‑Mac setups who want to stitch RAM together via tensor‑parallelism or RDMA.
  • Anyone who prefers a self‑contained binary rather than a heavyweight framework like PyTorch.

How to Get Started (quick‑start)

  1. Clone & build – pick the appropriate make target for your hardware (e.g., make for Metal, make cuda-generic for CUDA multi‑GPU).
  2. Download a model – e.g., ./download_model.sh ds4f‑q2 for DeepSeek V4 Flash Q2 (≈ 41 GiB). Files land in gguf/.
  3. Run –
    ./ds4 -p "Explain Redis streams in one paragraph."
    # or start the server
    ./ds4‑server --ctx 32768
    
  4. Explore – use REPL commands (/save, /list, /think, /steer) to manage sessions and control generation.

Limitations & Status

  • Beta quality – fast‑moving codebase; regressions are possible.
  • Model‑specific – not a general GGUF runner; only the listed models are supported.
  • Vision support – experimental; image‑based prompts work only for models that ship a separate encoder.
  • Large‑context KV cache – requires fast SSDs; very large models may need multi‑machine setups.

Where to Learn More

The repository ships extensive markdown docs:

  • Build guides (docs/METAL.md, CUDA_MULTI_GPU.md, …)
  • Model & memory requirements (docs/MODELS.md)
  • Distributed inference (docs/DISTRIBUTED.md)
  • Speculative decoding (docs/SPECULATIVE_DECODING.md)
  • Serving API (docs/SERVER.md)
  • Performance benchmarks (docs/PERFORMANCE.md)

In short: antirez/ds4 (DwarfStar) is a purpose‑built, high‑performance inference engine for a curated set of modern LLMs, enabling local or on‑premise deployment on Macs, CUDA workstations, and AMD ROCm systems.

Related

  • Dispatch
  • Project
  • Dispatch
  • Project
  • Project