antirez/ds4

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 10 minutes ago
Added to GitGenius on August 2nd, 2026
Created on May 6th, 2026
Open Issues & Pull Requests: 429 (-1)
GitHub issues: Enabled
Number of forks: 1,866
Total Stargazers: 20,888 (+4)
Total Subscribers: 164 (+0)

Issue Activity (beta)

Open issues: 167
New in 7 days: 50
Closed in 7 days: 12
Avg open age: 34 days
Stale 30+ days: 73
Stale 90+ days: 0

Recent activity

Opened in 7 days: 48
Closed in 7 days: 11
Comments in 7 days: 76
Events in 7 days: 127

Top labels

  • cuda (6)
  • bug (4)
  • ideas-to-explore (3)
  • priority (3)
  • speed (3)
  • correctness (2)
  • kv-cache (2)
  • metal (2)

Repository Insights (GitGenius)

Median issue/PR response: 5.6 hours
Mean response time: 45.5 hours
90th percentile: 4.5 days
Tracked items: 243

Most active contributors

Detailed Description

DwarfStar is a specialized native inference engine written in C, designed specifically for running DeepSeek V4 Flash and PRO models locally, with additional support for GLM 5.2. Unlike general-purpose GGUF runners, it is deliberately narrow in scope, with model loading, prompt rendering, tool calls, KV state management, HTTP server functionality, and coding agent capabilities all built and tested together as an integrated system. The project is optimized first for Metal on Apple Silicon Macs with 96 GB or more of RAM, though it also supports NVIDIA CUDA including multi-GPU configurations and AMD ROCm on Strix Halo systems like the Framework Desktop. For machines with insufficient RAM, SSD streaming enables reasonable performance on smaller systems.

The repository is maintained by antirez and represents a significant engineering effort built with assistance from advanced language models including GPT 5.5, 5.6, and Claude Fable, though humans led the ideas, testing, and debugging. The project explicitly acknowledges its debt to llama.cpp and GGML, retaining certain source-level components under the MIT license including GGUF quantization layouts, CPU quantization logic, and specific kernels. While ds4.c does not link against GGML, the project exists because of the path opened by llama.cpp's kernels, quantization formats, and engineering knowledge.

DwarfStar enables several practical use cases. Consumer hardware users can run capable models on MacBooks, DGX Spark systems, or Strix Halo devices, with SSD streaming providing decent speeds even on memory-constrained machines. Server deployments can leverage CUDA multi-GPU support with micro-batching to convert older NVIDIA cards no longer supported by vLLM into multi-user LLM servers, with testing showing 120 tokens per second aggregate generation and 2000 tokens per second prefill on 8xL40S configurations. Advanced setups support tensor parallelism across two MacBook M5 Max or M3 Ultra systems via RDMA, and pipeline parallelism can combine multiple systems to aggregate their RAM for larger models.

The project's design reflects specific motivations: capable open-weight models now fit on high-end personal machines, DeepSeek V4 Flash and PRO along with GLM 5.2 tolerate aggressive routed-expert quantization, compressed KV caches and fast local SSDs make long contexts practical, and a specialized inference system for a few models offers advantages over general approaches. Model support is intentionally opportunistic, following the best open weights for useful local machine sizes, particularly 128 GB laptops and 512 GB workstations, with models removed when better replacements arrive.

The repository includes comprehensive tooling and documentation. The gguf-tools directory contains offline GGUF generation, imatrix collection, quantization tooling, and quality checks. Separate README files document GGUF tools, imatrix collection for routed-MoE models, calibration prompt corpus generation, quality testing against official continuations, directional steering data, speed benchmarking, and test vectors for regression checks. The project uses asymmetrical quantization strategies, quantizing only routed MoE experts while leaving shared experts, projections, and routing components untouched to guarantee quality.

DwarfStar includes experimental speculative decoding support through DSpark, an auxiliary draft model that reads hidden states from the main model and proposes up to five future tokens. The main Flash model verifies proposals and commits only accepted prefixes, potentially accelerating generation on predictable continuations like code, though low-yield prompts may see no speedup. The software is currently in beta quality with rapid changes, though QA runs precede each release. Comprehensive testing infrastructure includes remote Metal, CUDA, and ROCm machines, with contributor guidelines documented in CONTRIBUTING.md and the complete release test matrix in QA_BEFORE_RELEASES.md.

ds4
by
antirezantirez/ds4

Repository Details

Fetching additional details & charts...