README.md 15.4 KB
Newer Older
Neelay Shah's avatar
Neelay Shah committed
1
<!--
2
SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Neelay Shah's avatar
Neelay Shah committed
3
SPDX-License-Identifier: Apache-2.0
4
5
6
7
8
9
10
11
12
13
14
15

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Neelay Shah's avatar
Neelay Shah committed
16
-->
17

18
![Dynamo banner](./docs/images/frontpage-banner.png)
Neelay Shah's avatar
Neelay Shah committed
19

20
21
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![GitHub Release](https://img.shields.io/github/v/release/ai-dynamo/dynamo)](https://github.com/ai-dynamo/dynamo/releases/latest)
22
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ai-dynamo/dynamo)
23
[![Discord](https://dcbadge.limes.pink/api/server/D92uqZRjCZ?style=flat)](https://discord.gg/D92uqZRjCZ) ![Community Contributors](https://img.shields.io/badge/community_contributors-70%2B-brightgreen) ![Community PRs](https://img.shields.io/badge/PRs_merged-130%2B-blue)
Meenakshi Sharma's avatar
Meenakshi Sharma committed
24

25
| **[Roadmap](https://github.com/ai-dynamo/dynamo/issues/5506)** | **[Support Matrix](https://github.com/ai-dynamo/dynamo/blob/main/docs/reference/support-matrix.md)** | **[Docs](https://docs.nvidia.com/dynamo/latest/index.html)** | **[Recipes](https://github.com/ai-dynamo/dynamo/tree/main/recipes)** | **[Examples](https://github.com/ai-dynamo/dynamo/tree/main/examples)** | **[Prebuilt Containers](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/ai-dynamo/collections/ai-dynamo)** | **[Design Proposals](https://github.com/ai-dynamo/enhancements)** | **[Blogs](https://developer.nvidia.com/blog/tag/nvidia-dynamo)**
26

Anish's avatar
Anish committed
27
# NVIDIA Dynamo
28

Anish's avatar
Anish committed
29
High-throughput, low-latency inference framework designed for serving generative AI and reasoning models in multi-node distributed environments.
30

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## Why Dynamo

<p align="center">
  <img src="./docs/images/frontpage-gpu-vertical.png" alt="Multi Node Multi-GPU topology" width="600" />
</p>

Large language models exceed single-GPU capacity. Tensor parallelism spreads layers across GPUs but creates coordination challenges. Dynamo closes this orchestration gap.

Dynamo is inference engine agnostic (supports TRT-LLM, vLLM, SGLang) and provides:

- **Disaggregated Prefill & Decode** – Maximizes GPU throughput with latency/throughput trade-offs
- **Dynamic GPU Scheduling** – Optimizes performance based on fluctuating demand
- **LLM-Aware Request Routing** – Eliminates unnecessary KV cache re-computation
- **Accelerated Data Transfer** – Reduces inference response time using NIXL
- **KV Cache Offloading** – Leverages multiple memory hierarchies for higher throughput

<p align="center">
  <img src="./docs/images/frontpage-architecture.png" alt="Dynamo architecture" width="600" />
</p>

Built in Rust for performance and Python for extensibility, Dynamo is fully open-source with an OSS-first development approach.

53
54
## Framework Support Matrix

55
56
57
58
59
60
61
62
63
64
| Feature                                                              | [vLLM](docs/backends/vllm/README.md) | [SGLang](docs/backends/sglang/README.md) | [TensorRT-LLM](docs/backends/trtllm/README.md) |
| -------------------------------------------------------------------- | :--: | :----: | :----------: |
| [**Disaggregated Serving**](docs/design_docs/disagg_serving.md)      | ✅   | ✅     | ✅           |
| [**KV-Aware Routing**](docs/router/kv_cache_routing.md)              | ✅   | ✅     | ✅           |
| [**SLA-Based Planner**](docs/planner/sla_planner.md)                 | ✅   | ✅     | ✅           |
| [**KVBM**](docs/kvbm/kvbm_architecture.md)                           | ✅   | 🚧     | ✅           |
| [**Multimodal**](docs/multimodal/index.md)                           | ✅   | ✅     | ✅           |
| [**Tool Calling**](docs/agents/tool-calling.md)                      | ✅   | ✅     | ✅           |

> **[Full Feature Matrix →](feature-matrix.md)** — Detailed compatibility including LoRA, Request Migration, Speculative Decoding, and feature interactions.
65

66
67
## Latest News

68
69
70
71
72
- [12/05] [Moonshot AI's Kimi K2 achieves 10x inference speedup with Dynamo on GB200](https://quantumzeitgeist.com/kimi-k2-nvidia-ai-ai-breakthrough/)
- [12/02] [Mistral AI runs Mistral Large 3 with 10x faster inference using Dynamo](https://www.marktechpost.com/2025/12/02/nvidia-and-mistral-ai-bring-10x-faster-inference-for-the-mistral-3-family-on-gb200-nvl72-gpu-systems/)
- [12/01] [InfoQ: NVIDIA Dynamo simplifies Kubernetes deployment for LLM inference](https://www.infoq.com/news/2025/12/nvidia-dynamo-kubernetes/)
- [11/20] [Dell integrates PowerScale with Dynamo's NIXL for 19x faster TTFT](https://www.dell.com/en-us/dt/corporate/newsroom/announcements/detailpage.press-releases~usa~2025~11~dell-technologies-and-nvidia-advance-enterprise-ai-innovation.htm)
- [11/20] [WEKA partners with NVIDIA on KV cache storage for Dynamo](https://siliconangle.com/2025/11/20/nvidia-weka-kv-cache-solution-ai-inferencing-sc25/)
73
- [11/13] [Dynamo Office Hours Playlist](https://www.youtube.com/playlist?list=PL5B692fm6--tgryKu94h2Zb7jTFM3Go4X)
74
- [10/16] [How Baseten achieved 2x faster inference with NVIDIA Dynamo](https://www.baseten.co/blog/how-baseten-achieved-2x-faster-inference-with-nvidia-dynamo/)
75

76
## Get Started
77

78
79
80
81
| Path | Use Case | Time | Requirements |
|------|----------|------|--------------|
| [**Local Quick Start**](#local-quick-start) | Test on a single machine | ~5 min | 1 GPU, Ubuntu 24.04 |
| [**Kubernetes Deployment**](#kubernetes-deployment) | Production multi-node clusters | ~30 min | K8s cluster with GPUs |
82

83
## Contributing
84

85
Want to help shape the future of distributed LLM inference? We welcome contributors at all levels—from doc fixes to new features.
Anish's avatar
Anish committed
86

87
88
89
- **[Contributing Guide](CONTRIBUTING.md)** – How to get started
- **[Report a Bug](https://github.com/ai-dynamo/dynamo/issues/new?template=bug_report.yml)** – Found an issue?
- **[Feature Request](https://github.com/ai-dynamo/dynamo/issues/new?template=feature_request.yml)** – Have an idea?
Anish's avatar
Anish committed
90

91
# Local Quick Start
92

Neelay Shah's avatar
Neelay Shah committed
93
The following examples require a few system level packages.
94
Recommended to use Ubuntu 24.04 with a x86_64 CPU. See [docs/reference/support-matrix.md](docs/reference/support-matrix.md)
95

96
## 1. Initial Setup
Anish's avatar
Anish committed
97
98

The Dynamo team recommends the `uv` Python package manager, although any way works. Install uv:
99

Anish's avatar
Anish committed
100
101
102
```
curl -LsSf https://astral.sh/uv/install.sh | sh
```
103

104
### Install Python Development Headers
105
106
107
108
109
110
111

Backend engines require Python development headers for JIT compilation. Install them with:

```bash
sudo apt install python3-dev
```

112
## 2. Select an Engine
113

114
We publish Python wheels specialized for each of our supported engines: vllm, sglang, and trtllm. The examples that follow use SGLang; continue reading for other engines.
115

116
```
117
118
119
uv venv venv
source venv/bin/activate
uv pip install pip
120

121
# Choose one
Anish's avatar
Anish committed
122
uv pip install "ai-dynamo[sglang]"  #replace with [vllm], [trtllm], etc.
123
```
124

Anish's avatar
Anish committed
125
## 3. Run Dynamo
126

127
### Sanity Check (Optional)
128
129
130
131

Before trying out Dynamo, you can verify your system configuration and dependencies:

```bash
132
python3 deploy/sanity_check.py
133
134
135
136
```

This is a quick check for system resources, development tools, LLM frameworks, and Dynamo components.

137
### Running an LLM API Server
138
139

Dynamo provides a simple way to spin up a local set of inference components including:
140

Neelay Shah's avatar
Neelay Shah committed
141
142
143
- **OpenAI Compatible Frontend** – High performance OpenAI compatible http api server written in Rust.
- **Basic and Kv Aware Router** – Route and load balance traffic to a set of workers.
- **Workers** – Set of pre-configured LLM serving engines.
144

145
```bash
146
# Start an OpenAI compatible HTTP server with prompt templating, tokenization, and routing.
147
148
149
150
151
152
# For local dev: --store-kv file avoids etcd (workers and frontend must share a disk)
python3 -m dynamo.frontend --http-port 8000 --store-kv file

# Start the SGLang engine. You can run several of these for the same or different models.
# The frontend will discover them automatically.
python3 -m dynamo.sglang --model-path deepseek-ai/DeepSeek-R1-Distill-Llama-8B --store-kv file
153
154
```

155
> **Note:** vLLM workers publish KV cache events by default, which requires NATS. For dependency-free local development with vLLM, add `--kv-events-config '{"enable_kv_cache_events": false}'`. This keeps local prefix caching enabled while disabling event publishing. See [Service Discovery and Messaging](#service-discovery-and-messaging) for details.
156

Neelay Shah's avatar
Neelay Shah committed
157
#### Send a Request
158

159
```bash
160
curl localhost:8000/v1/chat/completions   -H "Content-Type: application/json"   -d '{
Neelay Shah's avatar
Neelay Shah committed
161
162
163
164
165
166
167
168
169
170
    "model": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
    "messages": [
    {
        "role": "user",
        "content": "Hello, how are you?"
    }
    ],
    "stream":false,
    "max_tokens": 300
  }' | jq
171
```
172

173
174
Rerun with `curl -N` and change `stream` in the request to `true` to get the responses as soon as the engine issues them.

175
### What's Next?
176

177
178
179
180
- **Scale up**: Deploy on Kubernetes with [Recipes](recipes/)
- **Add features**: Enable [KV-aware routing](docs/router/kv_cache_routing.md), [disaggregated serving](docs/design_docs/disagg_serving.md)
- **Benchmark**: Use [AIPerf](docs/benchmarks/benchmarking.md) to measure performance
- **Try other engines**: [vLLM](docs/backends/vllm/), [SGLang](docs/backends/sglang/), [TensorRT-LLM](docs/backends/trtllm/)
181

182
# Kubernetes Deployment
183

184
For production deployments on Kubernetes clusters with multiple GPUs.
185

186
## Prerequisites
187

188
189
190
- Kubernetes cluster with GPU nodes
- [Dynamo Platform installed](docs/kubernetes/README.md)
- HuggingFace token for model downloads
191

192
## Production Recipes
193

194
Pre-built deployment configurations for common models and topologies:
195

196
197
198
199
200
| Model | Framework | Mode | GPUs | Recipe |
|-------|-----------|------|------|--------|
| Llama-3.1-70B | vLLM | Aggregated | 4x H100 | [View](recipes/vllm/llama-3.1-70b/) |
| DeepSeek-R1 | SGLang | Disaggregated | 8x H200 | [View](recipes/sglang/deepseek-r1/) |
| Qwen3-32B | TensorRT-LLM | Disaggregated | 8x GPU | [View](recipes/trtllm/qwen3-32b/) |
201

202
See [recipes/README.md](recipes/README.md) for the full list and deployment instructions.
203

204
## Cloud Deployment Guides
205

206
207
- [Amazon EKS](examples/deployments/EKS/)
- [Google GKE](examples/deployments/GKE/)
208

209
# Concepts
210

211
## Engines
212

213
Dynamo is inference engine agnostic. Install the wheel for your chosen engine and run with `python3 -m dynamo.<engine> --help`.
214

215
216
217
218
219
| Engine | Install | Docs | Best For |
|--------|---------|------|----------|
| vLLM | `uv pip install ai-dynamo[vllm]` | [Guide](docs/backends/vllm/) | Broadest feature coverage |
| SGLang | `uv pip install ai-dynamo[sglang]` | [Guide](docs/backends/sglang/) | High-throughput serving |
| TensorRT-LLM | `pip install --pre --extra-index-url https://pypi.nvidia.com ai-dynamo[trtllm]` | [Guide](docs/backends/trtllm/) | Maximum performance |
220

221
> **Note:** TensorRT-LLM requires `pip` (not `uv`) due to URL-based dependencies. See the [TRT-LLM guide](docs/backends/trtllm/) for container setup and prerequisites.
222

223
Use `CUDA_VISIBLE_DEVICES` to specify which GPUs to use. Engine-specific options (context length, multi-GPU, etc.) are documented in each backend guide.
224

225
## Service Discovery and Messaging
226

227
Dynamo uses TCP for inter-component communication. External services are optional for most deployments:
228

229
230
231
| Deployment | etcd | NATS | Notes |
|------------|------|------|-------|
| **Kubernetes** | ❌ Not required | ❌ Not required | K8s-native discovery; TCP request plane |
232
233
| **Local Development** | ❌ Not required | ❌ Not required | Pass `--store-kv file`; vLLM also needs `--kv-events-config '{"enable_kv_cache_events": false}'` |
| **KV-Aware Routing** | — | ✅ Required | Prefix caching enabled by default requires NATS |
234

235
For local development without external dependencies, pass `--store-kv file` (avoids etcd) to both the frontend and workers. vLLM users should also pass `--kv-events-config '{"enable_kv_cache_events": false}'` to disable KV event publishing (avoids NATS) while keeping local prefix caching enabled; SGLang and TRT-LLM don't require this flag.
236

237
For distributed non-Kubernetes deployments or KV-aware routing:
238

239
240
- [etcd](https://etcd.io/) can be run directly as `./etcd`.
- [nats](https://nats.io/) needs JetStream enabled: `nats-server -js`.
241

242
To quickly setup both: `docker compose -f deploy/docker-compose.yml up -d`
243

244
# Advanced Topics
245

246
## Benchmarking
247

248
Dynamo provides comprehensive benchmarking tools:
249

250
251
- **[Benchmarking Guide](docs/benchmarks/benchmarking.md)** – Compare deployment topologies using AIPerf
- **[SLA-Driven Deployments](docs/planner/sla_planner_quickstart.md)** – Optimize deployments to meet SLA requirements
252

253
## Frontend OpenAPI Specification
254

255
The OpenAI-compatible frontend exposes an OpenAPI 3 spec at `/openapi.json`. To generate without running the server:
256

257
258
```bash
cargo run -p dynamo-llm --bin generate-frontend-openapi
259
```
260

261
This writes to `docs/frontends/openapi.json`.
262

263
# Building from Source
264

265
For contributors who want to build Dynamo from source rather than installing from PyPI.
266

267
## 1. Install Libraries
268
269

**Ubuntu:**
270

271
272
273
```
sudo apt install -y build-essential libhwloc-dev libudev-dev pkg-config libclang-dev protobuf-compiler python3-dev cmake
```
274

275
**macOS:**
276

277
- [Homebrew](https://brew.sh/)
278

279
280
281
282
```
# if brew is not installed on your system, install it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
283

284
- [Xcode](https://developer.apple.com/xcode/)
285

286
287
```
brew install cmake protobuf
288

289
290
291
292
## Check that Metal is accessible
xcrun -sdk macosx metal
```

293
If Metal is accessible, you should see an error like `metal: error: no input files`, which confirms it is installed correctly.
294

Anish's avatar
Anish committed
295
## 2. Install Rust
296

297
298
299
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
300
```
301

302
## 3. Create a Python Virtual Environment
303

304
305
306
Follow the instructions in [uv installation](https://docs.astral.sh/uv/#installation) guide to install uv if you don't have `uv` installed. Once uv is installed, create a virtual environment and activate it.

- Install uv
307

308
309
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
310
```
311
312

- Create a virtual environment
313

314
```bash
315
316
317
uv venv dynamo
source dynamo/bin/activate
```
318

319
## 4. Install Build Tools
320

321
322
323
```
uv pip install pip maturin
```
324

325
[Maturin](https://github.com/PyO3/maturin) is the Rust<->Python bindings build tool.
326

327
## 5. Build the Rust Bindings
328

329
```
330
cd lib/bindings/python
331
332
333
maturin develop --uv
```

334
## 6. Install the Wheel
335
336
337

```
cd $PROJECT_ROOT
338
uv pip install -e .
339
340
```

341
You should now be able to run `python3 -m dynamo.frontend`.
342

343
For local development, pass `--store-kv file` to avoid external dependencies (see Service Discovery and Messaging section).
344
345
346
347

Set the environment variable `DYN_LOG` to adjust the logging level; for example, `export DYN_LOG=debug`. It has the same syntax as `RUST_LOG`.

If you use vscode or cursor, we have a .devcontainer folder built on [Microsofts Extension](https://code.visualstudio.com/docs/devcontainers/containers). For instructions see the [ReadMe](.devcontainer/README.md) for more details.
348
349
350
351
352
353
354
355
356
357

<!-- Reference links for Feature Compatibility Matrix -->
[disagg]: docs/design_docs/disagg_serving.md
[kv-routing]: docs/router/kv_cache_routing.md
[planner]: docs/planner/sla_planner.md
[kvbm]: docs/kvbm/kvbm_architecture.md
[mm]: examples/multimodal/
[migration]: docs/fault_tolerance/request_migration.md
[lora]: examples/backends/vllm/deploy/lora/README.md
[tools]: docs/agents/tool-calling.md