README.md 16.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
[![Discord](https://dcbadge.limes.pink/api/server/D92uqZRjCZ?style=flat)](https://discord.gg/D92uqZRjCZ)
23
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ai-dynamo/dynamo)
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
## Framework Support Matrix

33
34
35
36
37
38
39
40
41
42
| 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.
43

44
45
## Latest News

46
47
48
49
50
- [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/)
51
- [11/13] [Dynamo Office Hours Playlist](https://www.youtube.com/playlist?list=PL5B692fm6--tgryKu94h2Zb7jTFM3Go4X)
52
- [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/)
53

Anish's avatar
Anish committed
54
## The Era of Multi-GPU, Multi-Node
55

Anish's avatar
Anish committed
56
57
58
<p align="center">
  <img src="./docs/images/frontpage-gpu-vertical.png" alt="Multi Node Multi-GPU topology" width="600" />
</p>
59

Anish's avatar
Anish committed
60
Large language models are quickly outgrowing the memory and compute budget of any single GPU. Tensor-parallelism solves the capacity problem by spreading each layer across many GPUs—and sometimes many servers—but it creates a new one: how do you coordinate those shards, route requests, and share KV cache fast enough to feel like one accelerator? This orchestration gap is exactly what NVIDIA Dynamo is built to close.
61

Anish's avatar
Anish committed
62
Dynamo is designed to be inference engine agnostic (supports TRT-LLM, vLLM, SGLang or others) and captures LLM-specific capabilities such as:
63

Neelay Shah's avatar
Neelay Shah committed
64
65
66
67
68
- **Disaggregated prefill & decode inference** – Maximizes GPU throughput and facilitates trade off between throughput and latency.
- **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 system throughput
69

Anish's avatar
Anish committed
70
71
72
73
74
75
76
<p align="center">
  <img src="./docs/images/frontpage-architecture.png" alt="Dynamo architecture" width="600" />
</p>

Built in Rust for performance and in Python for extensibility, Dynamo is fully open-source and driven by a transparent, OSS (Open Source Software) first development approach.

# Installation
77

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

Anish's avatar
Anish committed
81
82
83
## 1. Initial setup

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

Anish's avatar
Anish committed
85
86
87
```
curl -LsSf https://astral.sh/uv/install.sh | sh
```
88

89
90
91
92
93
94
95
96
### Install Python development headers

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

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

Anish's avatar
Anish committed
97
## 2. Select an engine
98

99
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.
100

101
```
102
103
104
uv venv venv
source venv/bin/activate
uv pip install pip
105

106
# Choose one
Anish's avatar
Anish committed
107
uv pip install "ai-dynamo[sglang]"  #replace with [vllm], [trtllm], etc.
108
```
109

Anish's avatar
Anish committed
110
## 3. Run Dynamo
111

112
113
114
115
116
117
118
119
120
121
### Sanity check (optional)

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

```bash
./deploy/sanity_check.py
```

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

122
123
124
### Running an LLM API server

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

Neelay Shah's avatar
Neelay Shah committed
126
127
128
- **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.
129
130

```
131
# Start an OpenAI compatible HTTP server with prompt templating, tokenization, and routing.
Graham King's avatar
Graham King committed
132
# Pass the TLS certificate and key paths to use HTTPS instead of HTTP.
133
134
# Pass --store-kv to use the filesystem instead of etcd. The workers and frontend must share a disk.
python -m dynamo.frontend --http-port 8000 [--tls-cert-path cert.pem] [--tls-key-path key.pem] [--store-kv file]
135

Anish's avatar
Anish committed
136
# Start the SGLang engine, connecting to NATS and etcd to receive requests. You can run several of these,
137
# both for the same model and for multiple models. The frontend node will discover them.
138
139
# Pass --store-kv to use the filesystem instead of etcd. The workers and frontend must share a disk.
python -m dynamo.sglang --model deepseek-ai/DeepSeek-R1-Distill-Llama-8B [--store-kv file]
140
141
```

Neelay Shah's avatar
Neelay Shah committed
142
#### Send a Request
143

144
```bash
145
curl localhost:8000/v1/chat/completions   -H "Content-Type: application/json"   -d '{
Neelay Shah's avatar
Neelay Shah committed
146
147
148
149
150
151
152
153
154
155
    "model": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
    "messages": [
    {
        "role": "user",
        "content": "Hello, how are you?"
    }
    ],
    "stream":false,
    "max_tokens": 300
  }' | jq
156
```
157

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

Anish's avatar
Anish committed
160
161
### Deploying Dynamo

162
- Follow the [Quickstart Guide](docs/kubernetes/README.md) to deploy on Kubernetes.
163
- Check out [Backends](examples/backends) to deploy various workflow configurations (e.g. SGLang with router, vLLM with disaggregated serving, etc.)
Anish's avatar
Anish committed
164
- Run some [Examples](examples) to learn about building components in Dynamo and exploring various integrations.
165

166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
### Service Discovery and Messaging

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

| Deployment | etcd | NATS | Notes |
|------------|------|------|-------|
| **Kubernetes** | ❌ Not required | ❌ Not required | K8s-native discovery; TCP request plane |
| **Local development** | ❌ Not required | ❌ Not required | Pass `--store-kv file`; TCP request plane |
| **KV-aware routing** | — | ✅ Required | Add NATS for KV event messaging |

For local development, pass `--store-kv file` to both the frontend and workers. For distributed non-Kubernetes deployments or 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`

183
184
185
186
### Benchmarking Dynamo

Dynamo provides comprehensive benchmarking tools to evaluate and optimize your deployments:

187
- **[Benchmarking Guide](docs/benchmarks/benchmarking.md)** – Compare deployment topologies (aggregated vs. disaggregated vs. vanilla vLLM) using AIPerf
188
- **[SLA-Driven Dynamo Deployments](docs/planner/sla_planner_quickstart.md)** – Optimize your deployment to meet SLA requirements
189

190
191
192
193
194
195
196
197
198
199
200
## Frontend OpenAPI specification

The OpenAI-compatible HTTP frontend exposes an OpenAPI 3 specification at `/openapi.json`.
To generate and persist the same specification without running the server (for example for CI, documentation, or NIM integration), run:

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

This writes the current frontend spec to `docs/frontends/openapi.json` at the repository root.

Anish's avatar
Anish committed
201
# Engines
202

203
Dynamo is designed to be inference engine agnostic. To use any engine with Dynamo, start a Dynamo frontend (`python -m dynamo.frontend`). For local development, pass `--store-kv file` to avoid etcd dependency. NATS is optional and only required for KV-aware routing.
204

Anish's avatar
Anish committed
205
## vLLM
206
207
208
209
210
211

```
uv pip install ai-dynamo[vllm]
```

Run the backend/worker like this:
212

213
214
215
216
```
python -m dynamo.vllm --help
```

Anish's avatar
Anish committed
217
vLLM attempts to allocate enough KV cache for the full context length at startup. If that does not fit in your available memory pass `--context-length <value>`.
218
219
220

To specify which GPUs to use set environment variable `CUDA_VISIBLE_DEVICES`.

Anish's avatar
Anish committed
221
## SGLang
222
223

```
224
225
226
# Install libnuma
apt install -y libnuma-dev

227
228
229
230
uv pip install ai-dynamo[sglang]
```

Run the backend/worker like this:
231

232
```
233
python -m dynamo.sglang --help
234
235
```

236
You can pass any sglang flags directly to this worker, see https://docs.sglang.ai/advanced_features/server_arguments.html . See there to use multiple GPUs.
237

Anish's avatar
Anish committed
238
## TensorRT-LLM
239

Anish's avatar
Anish committed
240
It is recommended to use [NGC PyTorch Container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch) for running the TensorRT-LLM engine.
241
242
243

> [!Note]
> Ensure that you select a PyTorch container image version that matches the version of TensorRT-LLM you are using.
244
> For example, if you are using `tensorrt-llm==1.2.0rc5`, use the PyTorch container image version `25.10`.
245
246
247
248
249
> To find the correct PyTorch container version for your desired `tensorrt-llm` release, visit the [TensorRT-LLM Dockerfile.multi](https://github.com/NVIDIA/TensorRT-LLM/blob/main/docker/Dockerfile.multi) on GitHub. Switch to the branch that matches your `tensorrt-llm` version, and look for the `BASE_TAG` line to identify the recommended PyTorch container tag.

> [!Important]
> Launch container with the following additional settings `--shm-size=1g --ulimit memlock=-1`

Anish's avatar
Anish committed
250
### Install prerequisites
251

252
```
253
254
# Optional step: Only required for non-container installations. The PyTorch 25.10 container already includes PyTorch 2.9.0 with CUDA 13.0.
uv pip install torch==2.9.0 torchvision --index-url https://download.pytorch.org/whl/cu130
255
256

sudo apt-get -y install libopenmpi-dev
257
258
259

# Optional step: Only required for disaggregated serving
sudo apt-get -y install libzmq3-dev
260
261
262
263
264
```

> [!Tip]
> You can learn more about these prequisites and known issues with TensorRT-LLM pip based installation [here](https://nvidia.github.io/TensorRT-LLM/installation/linux.html).

Anish's avatar
Anish committed
265
### After installing the pre-requisites above, install Dynamo
266

267
```
268
pip install --pre --extra-index-url https://pypi.nvidia.com ai-dynamo[trtllm]
269
270
```

271
272
273
> [!Note]
> We use `pip` instead of `uv` here because `tensorrt-llm` has a URL-based git dependency (`etcd3`) that `uv` does not currently support.

274
Run the backend/worker like this:
275

276
277
278
279
280
```
python -m dynamo.trtllm --help
```

To specify which GPUs to use set environment variable `CUDA_VISIBLE_DEVICES`.
281

Anish's avatar
Anish committed
282
# Developing Locally
283

Anish's avatar
Anish committed
284
## 1. Install libraries
285
286

**Ubuntu:**
287

288
289
290
```
sudo apt install -y build-essential libhwloc-dev libudev-dev pkg-config libclang-dev protobuf-compiler python3-dev cmake
```
291

292
**macOS:**
293

294
- [Homebrew](https://brew.sh/)
295

296
297
298
299
```
# if brew is not installed on your system, install it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
300

301
- [Xcode](https://developer.apple.com/xcode/)
302

303
304
```
brew install cmake protobuf
305

306
307
308
309
## Check that Metal is accessible
xcrun -sdk macosx metal
```

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

Anish's avatar
Anish committed
312
## 2. Install Rust
313

314
315
316
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
317
```
318

Anish's avatar
Anish committed
319
## 3. Create a Python virtual env:
320

321
322
323
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
324

325
326
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
327
```
328
329

- Create a virtual environment
330

331
```bash
332
333
334
uv venv dynamo
source dynamo/bin/activate
```
335

Anish's avatar
Anish committed
336
## 4. Install build tools
337

338
339
340
```
uv pip install pip maturin
```
341

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

Anish's avatar
Anish committed
344
## 5. Build the Rust bindings
345

346
```
347
cd lib/bindings/python
348
349
350
maturin develop --uv
```

Anish's avatar
Anish committed
351
## 6. Install the wheel
352
353
354

```
cd $PROJECT_ROOT
355
uv pip install -e .
356
357
358
359
```

You should now be able to run `python -m dynamo.frontend`.

360
For local development, pass `--store-kv file` to avoid external dependencies (see Service Discovery and Messaging section).
361
362
363
364

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.
365

366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# Contributing

We welcome contributions! Whether it's bug reports, documentation improvements, or code contributions—every bit helps.

- **[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?

# Community

Dynamo thrives on community contributions.

![External Contributors](https://img.shields.io/badge/community_contributors-70%2B-brightgreen)
![Community PRs](https://img.shields.io/badge/PRs_merged-130%2B-blue)

See our [contributor graph](https://github.com/ai-dynamo/dynamo/graphs/contributors) for the full picture.

383
384
385
386
387
388
389
390
391
<!-- 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