# antirez/ds4

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/antirez-ds4).**

15,143 stars · 1,326 forks · C · MIT

## Links

- GitHub: https://github.com/antirez/ds4
- awesome-repositories: https://awesome-repositories.com/repository/antirez-ds4.md

## Description

ds4 is a local inference engine for DeepSeek models that includes a distributed runtime for splitting transformer layers across networked computers. It functions as a reasoning controller with a local weight streamer and an API server that streams chat completions via industry standard endpoints.

The system employs a memory management model that loads model experts from disk on demand to execute models that exceed available system RAM. It provides controls for reasoning effort and model behavior steering, allowing the modification of response characteristics through activation directions.

The project covers a broad capability surface including hardware acceleration for Metal, CUDA, and ROCm, and disk persistence for prompt states and agent sessions. It also includes tools for inference throughput benchmarking, model capability evaluation, and power consumption limiting to manage hardware heat.

## Tags

### Artificial Intelligence & ML

- [Local AI Inference](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-deployment-and-serving/local-and-on-device-inference/local-ai-inference.md) — Runs DeepSeek models on local Metal, CUDA, or ROCm hardware for private generative AI tasks.
- [Activation Steering Vectors](https://awesome-repositories.com/f/artificial-intelligence-ml/activation-steering-vectors.md) — Modifies model output characteristics by applying direction vectors to internal activations during inference.
- [Distributed Model Execution](https://awesome-repositories.com/f/artificial-intelligence-ml/distributed-model-execution.md) — Splits transformer layers across networked computers to execute models that exceed the memory of a single device. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))
- [Local Inference Runtimes](https://awesome-repositories.com/f/artificial-intelligence-ml/local-inference-runtimes.md) — Executes deep learning models on local Metal, CUDA, or ROCm hardware for offline inference. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))
- [Local Inference Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-optimization-and-inference/serving-and-runtime/large-language-model-optimization/local-inference-engines/local-inference-engines.md) — Provides an optimized local execution environment for DeepSeek models with multi-GPU acceleration.
- [Model Steering Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/model-steering-tools.md) — Controls verbosity, safety, and reasoning depth using activation directions and thinking mode toggles.
- [Runtime Weight Loading](https://awesome-repositories.com/f/artificial-intelligence-ml/model-weight-management/dynamic-weight-updates/training-weight-adjustments/runtime-weight-loading.md) — Loads specific model experts from disk into memory on demand to run models larger than available RAM. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))
- [Reasoning Mode Controllers](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-mode-controllers.md) — Adjusts internal thinking depth and modifies output characteristics through activation steering.
- [Agent Session Management](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-session-management.md) — Saves and resumes interactive coding or chat sessions by caching prompt states and agent data.
- [Prefix Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-caching/prefix-caching.md) — Stores processed prompt prefixes on disk to avoid recalculating the initial input tokens upon session resumption. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))

### Data & Databases

- [Unified GPU Backend Abstractions](https://awesome-repositories.com/f/data-databases/storage-scaling/gpu-acceleration-backends/unified-gpu-backend-abstractions.md) — Unifies hardware calls for Metal, CUDA, and ROCm to execute operations across different GPU architectures.
- [Disk Caching Systems](https://awesome-repositories.com/f/data-databases/disk-caching-systems.md) — Stores processed prompt prefixes on disk to allow session resumption without recalculating input tokens.

### Development Tools & Productivity

- [Model Weight Offloading](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/optional-dependency-managers/on-demand-library-loading/model-weight-offloading.md) — Manages memory by loading model experts from disk on demand to exceed available system RAM.

### Networking & Communication

- [Distributed Runtimes](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/distributed-execution-runtimes/distributed-runtimes.md) — Orchestrates transformer layer execution across multiple networked computers to handle massive models.
- [Model Sharding](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/peer-to-peer-networking/model-sharding.md) — Splits transformer layers across multiple networked machines to run models exceeding single-device memory.

### Operating Systems & Systems Programming

- [Expert Weight Streaming](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation/memory-demand-analyzers/demand-paging/expert-weight-streaming.md) — Loads specific model experts from disk on demand to execute models that exceed available system RAM.

### Hardware & IoT

- [Compute Throttling](https://awesome-repositories.com/f/hardware-iot/dynamic-power-scaling/temperature-governed-power-limiters/compute-throttling.md) — Inserts calibrated pauses between compute units to target specific power consumption levels and reduce hardware heat. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))

### Security & Cryptography

- [Agentic Session Persistence](https://awesome-repositories.com/f/security-cryptography/identity-access-management/session-management/stateful-session-persistence/agentic-session-persistence.md) — Saves interactive session data to disk to allow resuming tasks without repeating the initial prompt prefill. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))

### Web Development

- [OpenAI-Compatible Servers](https://awesome-repositories.com/f/web-development/openai-compatible-servers.md) — Implements the OpenAI API specification to stream completions via industry standard endpoints.
- [OpenAI-Compatible API Servers](https://awesome-repositories.com/f/web-development/restful-api-development/server-side-rest-api-frameworks/openai-compatible-api-servers.md) — Provides a local server with standard endpoints to stream chat completions to external applications.
- [Headless Server Hosting](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-infrastructure-servers/web-server-hosting/headless-server-hosting.md) — Provides a headless API server to stream chat completions and messages via server-sent events. ([source](https://cdn.jsdelivr.net/gh/antirez/ds4@main/README.md))

### Part of an Awesome List

- [AI Agents](https://awesome-repositories.com/f/awesome-lists/ai/ai-agents.md) — Local inference engine for running models on MacBook.
