# dstack

> Open-source control plane for GPU provisioning across clouds, Kubernetes, and on-prem

- Category: Models & Inference / GPU & Compute Clouds
- Language: Python
- Licence: MPL-2.0
- Repository: https://github.com/dstackai/dstack
- Website: https://dstack.ai
- Canonical page: https://ai-tldr.dev/tools/dstack/

## In short

dstack is an open-source control plane for provisioning and orchestrating GPU compute. It works with any GPU cloud, Kubernetes cluster, or on-prem servers, and supports NVIDIA, AMD, Google TPU, and Tenstorrent accelerators out of the box. It sits in the GPU & Compute Clouds category of the Models & Inference tools and is open-source, written in Python and licensed MPL-2.0.

## Overview

dstack is an open-source control plane for provisioning and orchestrating GPU compute. It works with any GPU cloud, Kubernetes cluster, or on-prem servers, and supports NVIDIA, AMD, Google TPU, and Tenstorrent accelerators out of the box.

It is aimed at ML and AI teams who need to run development environments, training jobs, and inference services on GPUs without managing the underlying infrastructure by hand. You describe what you want in YAML, and dstack handles provisioning, job queuing, networking, and recovery from failures.

As a compute-orchestration tool, dstack sits between your code and the hardware. It is compatible with open-source tools and frameworks, so you can keep your existing stack while letting dstack place workloads across clouds and clusters from a single interface.

## What it does

- Runs across any GPU cloud, Kubernetes cluster, or on-prem servers from one control plane
- Supports NVIDIA, AMD, Google TPU, and Tenstorrent accelerators out of the box
- Configuration types for fleets, dev environments, tasks, services, and volumes, all defined as YAML in your repo
- Automatically handles provisioning, job queuing, auto-scaling, networking, port-forwarding, and run failures
- Apply configurations via the CLI, a programmatic API, or AI agent skills
- Server runs on Linux, macOS, and Windows (via WSL 2); on-prem use needs no backend config, just SSH fleets

## Getting started

Before using dstack through the CLI or API, set up a dstack server. The server runs on Linux, macOS, and Windows (via WSL 2) and requires Git and OpenSSH.

1. Install and start the server

   Install dstack with all extras and start the server. On first run it prints an admin token and the local server address.

```bash
uv tool install "dstack[all]" -U
dstack server
```

2. Install the CLI (if not already installed)

   If the CLI was not installed alongside the server, install it on its own. It also requires Git and OpenSSH.

```bash
uv tool install dstack -U
```

3. Point the CLI at your server

   Configure the CLI with the server address, your user token, and a project name.

```bash
dstack project add \
    --name main \
    --url http://127.0.0.1:3000 \
    --token bbae0f28-d3dd-4820-bf61-8f4bb40815da
```

4. Define and apply a configuration

   Define fleets, dev environments, tasks, services, or volumes as YAML in your repo, then apply them with the dstack apply command.

```bash
dstack apply
```

## When to use it

- Spin up interactive dev environments on cloud GPUs and connect from a desktop IDE
- Schedule training jobs, including distributed jobs, across GPU clouds or Kubernetes
- Deploy models and web apps as services with auto-scaling and authorization
- Orchestrate on-prem GPU clusters as SSH fleets without configuring a cloud backend
