README.md 15.7 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/assets/img/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)
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/pages/reference/support-matrix.md)** | **[Docs](https://docs.nvidia.com/dynamo/)** | **[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
## Why Dynamo

<p align="center">
34
  <img src="./docs/assets/img/frontpage-gpu-vertical.png" alt="Multi Node Multi-GPU topology" width="600" />
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</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

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

49
## Backend Feature Support
50

51
| | [SGLang](docs/pages/backends/sglang/README.md) | [TensorRT-LLM](docs/pages/backends/trtllm/README.md) | [vLLM](docs/pages/backends/vllm/README.md) |
52
53
|---|:----:|:----------:|:--:|
| **Best For** | High-throughput serving | Maximum performance | Broadest feature coverage |
54
55
56
57
58
59
| [**Disaggregated Serving**](docs/pages/design-docs/disagg-serving.md) | ✅ | ✅ | ✅ |
| [**KV-Aware Routing**](docs/pages/components/router/README.md) | ✅ | ✅ | ✅ |
| [**SLA-Based Planner**](docs/pages/components/planner/planner-guide.md) | ✅ | ✅ | ✅ |
| [**KVBM**](docs/pages/components/kvbm/README.md) | 🚧 | ✅ | ✅ |
| [**Multimodal**](docs/pages/features/multimodal/README.md) | ✅ | ✅ | ✅ |
| [**Tool Calling**](docs/pages/agents/tool-calling.md) | ✅ | ✅ | ✅ |
60

61
> **[Full Feature Matrix →](docs/pages/reference/feature-matrix.md)** — Detailed compatibility including LoRA, Request Migration, Speculative Decoding, and feature interactions.
62

63
64
65
## Dynamo Architecture

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

69
> **[Architecture Deep Dive →](docs/pages/design-docs/architecture.md)**
70

71
72
## Latest News

73
74
75
- [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/)
76

77
## Get Started
78

79
80
81
82
| 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 |
83
| [**Building from Source**](#building-from-source) | Contributors and development | ~15 min | Ubuntu, Rust, Python |
84

85
Want to help shape the future of distributed LLM inference? See the **[Contributing Guide](CONTRIBUTING.md)**.
Anish's avatar
Anish committed
86

87
# Local Quick Start
88

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

92
## Install Dynamo
Anish's avatar
Anish committed
93

94
### Option A: Containers (Recommended)
95

96
Containers have all dependencies pre-installed. No setup required.
97

98
99
100
```bash
# SGLang
docker run --gpus all --network host --rm -it nvcr.io/nvidia/ai-dynamo/sglang-runtime:0.8.1
101

102
103
# TensorRT-LLM
docker run --gpus all --network host --rm -it nvcr.io/nvidia/ai-dynamo/tensorrtllm-runtime:0.8.1
104

105
106
# vLLM
docker run --gpus all --network host --rm -it nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.8.1
107
108
```

109
> **Tip:** To run frontend and worker in the same container, either run processes in background with `&` (see below), or open a second terminal and use `docker exec -it <container_id> bash`.
110

111
See [Release Artifacts](docs/pages/reference/release-artifacts.md#container-images) for available versions.
112

113
114
115
116
117
118
119
120
121
### Option B: Install from PyPI

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

```bash
# Install uv (recommended Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment
122
123
124
uv venv venv
source venv/bin/activate
uv pip install pip
125
```
126

127
128
129
130
131
132
133
Install system dependencies and the Dynamo wheel for your chosen backend:

**SGLang**

```bash
sudo apt install python3-dev
uv pip install "ai-dynamo[sglang]"
134
```
135

136
> **Note:** For CUDA 13 (B300/GB300), the container is recommended. See [SGLang install docs](https://docs.sglang.io/get_started/install.html) for details.
137

138
**TensorRT-LLM**
139

140
141
142
143
144
145
```bash
sudo apt install python3-dev
pip install torch==2.9.0 torchvision --index-url https://download.pytorch.org/whl/cu130
pip install --pre --extra-index-url https://pypi.nvidia.com "ai-dynamo[trtllm]"
```

146
> **Note:** TensorRT-LLM requires `pip` due to a transitive Git URL dependency that `uv` doesn't resolve. We recommend using the [TensorRT-LLM container](docs/pages/reference/release-artifacts.md#container-images) for broader compatibility.
147
148

**vLLM**
149
150

```bash
151
152
sudo apt install python3-dev libxcb1
uv pip install "ai-dynamo[vllm]"
153
154
```

155
## Run Dynamo
156

157
> **Tip (Optional):** Before running Dynamo, verify your system configuration with `python3 deploy/sanity_check.py`
158
159

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

Neelay Shah's avatar
Neelay Shah committed
161
162
163
- **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.
164

165
166
Start the frontend:

167
> **Tip:** To run in a single terminal (useful in containers), append `> logfile.log 2>&1 &` to run processes in background. Example: `python3 -m dynamo.frontend --discovery-backend file > dynamo.frontend.log 2>&1 &`
168

169
```bash
170
# Start an OpenAI compatible HTTP server with prompt templating, tokenization, and routing.
171
172
# For local dev: --discovery-backend file avoids etcd (workers and frontend must share a disk)
python3 -m dynamo.frontend --http-port 8000 --discovery-backend file
173
174
175
```

In another terminal (or same terminal if using background mode), start a worker for your chosen backend:
176

177
178
```bash
# SGLang
179
python3 -m dynamo.sglang --model-path Qwen/Qwen3-0.6B --discovery-backend file
180
181

# TensorRT-LLM
182
python3 -m dynamo.trtllm --model-path Qwen/Qwen3-0.6B --discovery-backend file
183
184

# vLLM (note: uses --model, not --model-path)
185
python3 -m dynamo.vllm --model Qwen/Qwen3-0.6B --discovery-backend file \
186
  --kv-events-config '{"enable_kv_cache_events": false}'
187
188
```

189
190
191
192
193
194
195
196
> **Note:** For dependency-free local development, disable KV event publishing (avoids NATS):
> - **vLLM:** Add `--kv-events-config '{"enable_kv_cache_events": false}'`
> - **SGLang:** No flag needed (KV events disabled by default)
> - **TensorRT-LLM:** No flag needed (KV events disabled by default)
>
> **TensorRT-LLM only:** The warning `Cannot connect to ModelExpress server/transport error. Using direct download.` is expected and can be safely ignored.
>
> See [Service Discovery and Messaging](#service-discovery-and-messaging) for details.
197

Neelay Shah's avatar
Neelay Shah committed
198
#### Send a Request
199

200
```bash
201
curl localhost:8000/v1/chat/completions   -H "Content-Type: application/json"   -d '{
Neelay Shah's avatar
Neelay Shah committed
202
203
204
205
206
207
208
209
210
211
    "model": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
    "messages": [
    {
        "role": "user",
        "content": "Hello, how are you?"
    }
    ],
    "stream":false,
    "max_tokens": 300
  }' | jq
212
```
213

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

216
# Kubernetes Deployment
217

218
For production deployments on Kubernetes clusters with multiple GPUs.
219

220
## Prerequisites
221

222
- Kubernetes cluster with GPU nodes
223
- [Dynamo Platform installed](docs/pages/kubernetes/README.md)
224
- HuggingFace token for model downloads
225

226
## Production Recipes
227

228
Pre-built deployment configurations for common models and topologies:
229

230
231
| Model | Framework | Mode | GPUs | Recipe |
|-------|-----------|------|------|--------|
Nate Mailhot's avatar
Nate Mailhot committed
232
233
234
| Llama-3-70B | vLLM | Aggregated | 4x H100 | [View](recipes/llama-3-70b/vllm/) |
| DeepSeek-R1 | SGLang | Disaggregated | 8x H200 | [View](recipes/deepseek-r1/sglang/) |
| Qwen3-32B-FP8 | TensorRT-LLM | Aggregated | 8x GPU | [View](recipes/qwen3-32b-fp8/trtllm/) |
235

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

238
## Cloud Deployment Guides
239

240
241
- [Amazon EKS](examples/deployments/EKS/)
- [Google GKE](examples/deployments/GKE/)
242

243
# Building from Source
244

245
For contributors who want to build Dynamo from source rather than installing from PyPI.
246

247
## 1. Install Libraries
248
249

**Ubuntu:**
250

251
252
253
```
sudo apt install -y build-essential libhwloc-dev libudev-dev pkg-config libclang-dev protobuf-compiler python3-dev cmake
```
254

255
**macOS:**
256

257
- [Homebrew](https://brew.sh/)
258

259
260
261
262
```
# if brew is not installed on your system, install it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
263

264
- [Xcode](https://developer.apple.com/xcode/)
265

266
267
```
brew install cmake protobuf
268

269
270
271
272
## Check that Metal is accessible
xcrun -sdk macosx metal
```

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

Anish's avatar
Anish committed
275
## 2. Install Rust
276

277
278
279
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
280
```
281

282
## 3. Create a Python Virtual Environment
283

284
285
286
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
287

288
289
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
290
```
291
292

- Create a virtual environment
293

294
```bash
295
296
297
uv venv dynamo
source dynamo/bin/activate
```
298

299
## 4. Install Build Tools
300

301
302
303
```
uv pip install pip maturin
```
304

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

307
## 5. Build the Rust Bindings
308

309
```
310
cd lib/bindings/python
311
312
313
maturin develop --uv
```

314
315
316
317
318
319
320
321
322
323
## 6. Install GPU Memory Service

The GPU Memory Service is a Python package with a C++ extension. It requires only Python development headers and a C++ compiler (g++).

```bash
cd $PROJECT_ROOT
uv pip install -e lib/gpu_memory_service
```

## 7. Install the Wheel
324
325
326

```
cd $PROJECT_ROOT
327
uv pip install -e .
328
329
```

330
331
332
333
334
335
336
## 8. Run the Frontend

```bash
python3 -m dynamo.frontend
```

## 9. Configure for Local Development
337

338
- Pass `--discovery-backend file` to avoid external dependencies (see [Service Discovery and Messaging](#service-discovery-and-messaging))
339
- Set `DYN_LOG` to adjust the logging level (e.g., `export DYN_LOG=debug`). Uses the same syntax as `RUST_LOG`
340

341
> **Note:** VSCode and Cursor users can use the `.devcontainer` folder for a pre-configured dev environment. See the [devcontainer README](.devcontainer/README.md) for details.
342

343
344
345
346
347
348
# Advanced Topics

## Benchmarking

Dynamo provides comprehensive benchmarking tools:

349
350
- **[Benchmarking Guide](docs/pages/benchmarks/benchmarking.md)** – Compare deployment topologies using AIPerf
- **[SLA-Driven Deployments](docs/pages/components/planner/planner-guide.md)** – Optimize deployments to meet SLA requirements
351
352
353
354
355
356
357
358
359

## Frontend OpenAPI Specification

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

```bash
cargo run -p dynamo-llm --bin generate-frontend-openapi
```

360
This writes to `docs/pages/reference/api/openapi.json`.
361
362
363

## Service Discovery and Messaging

364
Dynamo uses TCP for inter-component communication. On Kubernetes, native resources ([CRDs + EndpointSlices](docs/pages/kubernetes/service-discovery.md)) handle service discovery. External services are optional for most deployments:
365
366
367

| Deployment | etcd | NATS | Notes |
|------------|------|------|-------|
368
| **Local Development** | ❌ Not required | ❌ Not required | Pass `--discovery-backend file`; vLLM also needs `--kv-events-config '{"enable_kv_cache_events": false}'` |
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
| **Kubernetes** | ❌ Not required | ❌ Not required | K8s-native discovery; TCP request plane |

> **Note:** KV-Aware Routing requires NATS for prefix caching coordination.

For Slurm or other distributed deployments (and KV-aware routing):

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

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

See [SGLang on Slurm](examples/backends/sglang/slurm_jobs/README.md) and [TRT-LLM on Slurm](examples/basics/multinode/trtllm/README.md) for deployment examples.

## More News

- [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/)
- [11/13] [Dynamo Office Hours Playlist](https://www.youtube.com/playlist?list=PL5B692fm6--tgryKu94h2Zb7jTFM3Go4X)
- [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/)
388
389

<!-- Reference links for Feature Compatibility Matrix -->
390
391
392
393
[disagg]: docs/pages/design-docs/disagg-serving.md
[kv-routing]: docs/pages/components/router/README.md
[planner]: docs/pages/components/planner/planner-guide.md
[kvbm]: docs/pages/components/kvbm/README.md
394
[mm]: examples/multimodal/
395
[migration]: docs/pages/fault-tolerance/request-migration.md
396
[lora]: examples/backends/vllm/deploy/lora/README.md
397
[tools]: docs/pages/agents/tool-calling.md