whatisgithub

What is ds4?

seraphimserapis/ds4 — explained in plain English

Analysis updated 2026-05-18

1Audience · developerComplexity · 4/5LicenseSetup · hard

In one sentence

A small native inference engine that runs only the DeepSeek V4 Flash AI model, tuned for Apple Metal and CUDA on local high-memory machines.

Mindmap

mindmap
  root((DwarfStar 4))
    What it does
      Single model inference
      Disk backed KV cache
      2-bit quantization
    Tech stack
      Metal
      CUDA
      GGUF
    Use cases
      Run DeepSeek V4 Flash locally
      Long context inference
      Coding agent backends
    Audience
      Developers
      ML tinkerers
    Status
      Alpha quality
      MIT licensed

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 or Linux machine with 128GB or more of RAM.

USE CASE 2

Use a one million token context window for long documents without a hosted API.

USE CASE 3

Serve DeepSeek V4 Flash over an HTTP API for local tools or coding agents to call.

USE CASE 4

Persist a large key-value cache to disk instead of running out of RAM during long sessions.

What is it built with?

MetalCUDAGGUFC

How does it compare?

seraphimserapis/ds40xkinno/neuralvault0xmayurrr/ai-contractauditor
Stars111
LanguageTypeScriptTypeScript
Setup difficultyhardhardeasy
Complexity4/54/52/5
Audiencedeveloperdeveloperdeveloper

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 with 128GB or more of RAM, or a Linux machine with a compatible CUDA GPU, plus downloading multi-gigabyte model files.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

DwarfStar 4, or ds4, is a small native inference engine built specifically to run the DeepSeek V4 Flash AI model on local machines. Unlike general purpose tools that can load many different model formats, this project is intentionally narrow: it only works with the specific GGUF model files the authors publish for DeepSeek V4 Flash, using a graph executor tuned specifically for that model on Apple Metal for macOS or CUDA for Linux. A basic CPU path exists only for correctness checks, not for real use, and the authors warn that current macOS versions have a bug that can crash the CPU path. The README explains why the authors think DeepSeek V4 Flash deserves its own engine rather than being treated as one of many supported models. Compared to smaller dense models, they say it runs faster because it activates fewer parameters at once, its reasoning steps stay proportional to how hard a problem actually is, it supports a one million token context window, and its key-value cache compresses well enough to persist to disk instead of staying entirely in memory. They also note it performs well when quantized down to 2 bits, which lets it run on a MacBook with 128GB of RAM. To use it, a person downloads one of the provided quantized model files with a script, choosing a smaller version for 128GB machines or a larger one for machines with 256GB or more, then builds the project with make. This produces two programs: a command line tool and a server with an HTTP API, both of which only work with the specific model files this project ships. The README is explicit that the project was built with heavy use of an AI coding assistant, with humans directing the ideas and doing the testing and debugging, and it credits the llama.cpp and GGML projects for the kernels, formats, and engineering knowledge its own code builds on. The authors describe the current code and model files as alpha quality, expecting it to take months to become more stable, and the project is licensed under MIT.

Copy-paste prompts

Prompt 1
Help me download the right DeepSeek V4 Flash GGUF quant for my machine's RAM using ds4's download script.
Prompt 2
Explain how ds4's disk backed KV cache lets it handle long context inference on a MacBook.
Prompt 3
Show me how to build and run the ds4-server binary to expose an HTTP API.
Prompt 4
Walk me through the difference between the q2 and q4 quantized models ds4 supports.

Frequently asked questions

What is ds4?

A small native inference engine that runs only the DeepSeek V4 Flash AI model, tuned for Apple Metal and CUDA on local high-memory machines.

What license does ds4 use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is ds4 to set up?

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

Who is ds4 for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.