whatisgithub

What is ds4?

alantsev/ds4 — explained in plain English

Analysis updated 2026-05-18

1CAudience · developerComplexity · 5/5LicenseSetup · hard

In one sentence

A narrow, C based local inference engine built only to run the DeepSeek V4 Flash model fast on Mac Metal or NVIDIA CUDA hardware.

Mindmap

mindmap
  root((ds4))
    What it does
      Runs DeepSeek V4 Flash
      Local inference
      Tool calling
    Tech stack
      C
      Metal
      CUDA
    Use cases
      Coding agents
      Long context chat
      GGUF quantization
    Audience
      Developers
      ML tinkerers

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 AI model locally on a Mac with Metal or a machine with NVIDIA CUDA

USE CASE 2

Build a coding agent that calls tools through ds4's server API

USE CASE 3

Quantize and generate custom GGUF files tuned for this specific model

USE CASE 4

Persist long conversation context to disk instead of keeping it all in RAM

What is it built with?

CMetalCUDAGGUFROCm

How does it compare?

alantsev/ds4adroxz1122/injected-host-enumerationiamdaven/miraos
Stars111
LanguageCCC
Setup difficultyhardmoderatehard
Complexity5/53/55/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+

Needs a Mac with 96GB+ RAM for Metal or an NVIDIA GPU with CUDA, plus specific DeepSeek V4 Flash GGUF files.

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

So what is it?

DwarfStar 4, also called ds4, is a small C based inference engine built specifically to run the DeepSeek V4 Flash AI model on your own computer. Unlike general purpose tools that can load many different model formats, this project intentionally supports only one model, in exchange for very tight and fast integration: it handles loading, prompt formatting, tool calling, and both memory based and on disk storage of the model's working state, plus a server API meant to work with coding agents or the included command line interface. The project targets Apple computers with Metal graphics, particularly MacBooks with 96GB of RAM or more, as its main platform, with NVIDIA CUDA support as a second target and community maintained AMD ROCm support kept on a separate branch. A CPU only mode exists for testing correctness, but it is not meant for regular use. The authors chose DeepSeek V4 Flash because it runs faster than other models of similar strength, produces shorter reasoning sections that scale with how hard the question actually is, supports a context window of one million tokens, and compresses its working memory well enough that long conversations can be saved to disk instead of staying only in RAM. The project also provides tools for creating and quantizing the special model files it needs, along with speed and quality testing utilities. Documentation covers testing for contributors, generating quantized model files, collecting calibration data, and running benchmarks. The engine only works with model files built specifically for it, not arbitrary DeepSeek or generic model files. The project is built with heavy use of AI coding assistance, is still labeled alpha quality software, and gives credit to the llama.cpp project for the groundwork it builds on. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Help me build and run ds4 on my Mac to serve the DeepSeek V4 Flash model locally
Prompt 2
Explain how ds4's on-disk KV cache lets me run longer context windows on limited RAM
Prompt 3
Show me how to connect a coding agent to the ds4 server API for tool calling
Prompt 4
Walk me through quantizing a DeepSeek V4 Flash GGUF file using the gguf-tools in ds4

Frequently asked questions

What is ds4?

A narrow, C based local inference engine built only to run the DeepSeek V4 Flash model fast on Mac Metal or NVIDIA CUDA hardware.

What language is ds4 written in?

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

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.