whatisgithub

What is ds4-m5?

swival/ds4-m5 — explained in plain English

Analysis updated 2026-05-18

16CAudience · developerComplexity · 4/5LicenseSetup · hard

In one sentence

DwarfStar 4 is a narrow, high-performance local inference engine written in C that runs only the DeepSeek V4 Flash model on Metal or CUDA hardware.

Mindmap

mindmap
  root((DwarfStar 4))
    What it does
      DeepSeek V4 Flash only
      Metal and CUDA
      Disk-backed KV cache
      HTTP server API
    Tech stack
      C
      CUDA
      Metal
      GGUF
    Use cases
      Local LLM inference
      Long context serving
      Coding agent backend
    Audience
      ML engineers
      Local inference enthusiasts

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run the DeepSeek V4 Flash model locally on a Mac Studio or high-RAM Linux machine with GPU acceleration.

USE CASE 2

Serve DeepSeek V4 Flash over an HTTP API for local coding agent integrations.

USE CASE 3

Persist very long context windows to disk using the model's compressed KV cache.

What is it built with?

CCUDAMetalGGUF

How does it compare?

swival/ds4-m5delphos-labs/disclosuresmicheldenizob/hotdsd_gorepatch
Stars161616
LanguageCCC
Setup difficultyhardhardmoderate
Complexity4/55/52/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a Mac Studio or GPU machine with 96GB+ RAM and downloading multi-gigabyte quantized model weights.

MIT licensed, retaining GGML author copyright notices for reused kernel and quantization code.

So what is it?

DwarfStar 4 is a small, purpose built inference engine for running the DeepSeek V4 Flash AI model locally on your own machine, written in C. Unlike general purpose AI runners that aim to support many models, this project takes a deliberately narrow approach: it runs one model, DeepSeek V4 Flash, and aims to run it well on high end personal machines. The engine targets Metal on macOS and CUDA on Linux for hardware accelerated processing. One of its defining features is treating the KV cache, the memory store that holds context as the model generates text, as a disk resident structure rather than purely a RAM object. DeepSeek V4 Flash has a highly compressed KV cache, and combined with fast SSD storage in modern Macs, this allows the engine to handle very long context, up to 1 million tokens, and even persist that context across sessions. This makes long context inference feasible on machines with 96 or 128 GB of RAM using 2-bit quantization. The project ships with its own specially crafted model weight files in GGUF format, a download script to fetch them from Hugging Face, and an HTTP server API so the model can serve requests like a local API endpoint. The quantization strategy keeps quality reasonably high by applying aggressive 2-bit compression only to the routed mixture of experts layers, leaving other components at higher precision. The code is alpha quality, the authors note it was developed with strong AI assistance and has only existed for a short time. It is not a general GGUF loader and only works with the specific weight files published for this project, so it will not load arbitrary DeepSeek or GGUF files. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Walk me through downloading a DeepSeek V4 Flash GGUF and building ds4 with make on macOS.
Prompt 2
Explain how ds4's disk-backed KV cache lets it handle a 1 million token context window.
Prompt 3
What hardware do I need to run the q2-imatrix versus q4-imatrix quantized DeepSeek V4 Flash model?
Prompt 4
How do I start the ds4-server HTTP API and point a local coding agent at it?

Frequently asked questions

What is ds4-m5?

DwarfStar 4 is a narrow, high-performance local inference engine written in C that runs only the DeepSeek V4 Flash model on Metal or CUDA hardware.

What language is ds4-m5 written in?

Mainly C. The stack also includes C, CUDA, Metal.

What license does ds4-m5 use?

MIT licensed, retaining GGML author copyright notices for reused kernel and quantization code.

How hard is ds4-m5 to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is ds4-m5 for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.