What developer tools does Vast.ai offer for deploying GPUs?
Updated
Vast.ai exposes three programmatic interfaces for deploying GPUs — a CLI, a Python SDK, and a REST API — plus pre-configured templates for popular open-source models. All three tools target the same underlying GPU inventory, so you can search, filter, and launch from whichever surface fits your workflow. The site states that every GPU on the platform is provisioned through code, and that the same API developers use is the interface AI agents use to procure compute at scale.
The three deployment tools
| Tool | Interface | Best for | Install / call |
|---|---|---|---|
| CLI | Terminal | Search, filter, and deploy without writing Python | curl -fsSL https://vast.ai/install.sh | bash |
| Python SDK | Python | Programmatic provisioning in a few lines of code | pip install vastai |
| REST API | HTTP | Agents and automation that call infrastructure directly | curl -H "Authorization: Bearer $VAST_API_KEY" https://cloud.vast.ai/api/v1/bundles/ |
CLI
The CLI is aimed at terminal-first workflows. According to the site, it lets you search, filter, and deploy from your terminal with no Python required. It installs via a single shell command, after which you can query the GPU inventory and launch instances without leaving the shell.
Python SDK
The SDK wraps the same provisioning capability in Python. The site describes it as "programmatic compute provisioning in five lines of code," installed with pip install vastai. This is the natural choice if your training or inference scripts already live in Python and you want instance lifecycle management inside the same process.
REST API
The REST API is the lowest-level interface and the one the site explicitly frames as the interface agents call to provision infrastructure. It authenticates with a bearer token ($VAST_API_KEY) and, in the documented example, hits the bundles endpoint to retrieve available GPU offers. Use it when you need language-agnostic automation, an agent loop, or integration into a system that isn't Python or shell based.
Pre-configured model templates
Beyond raw instance provisioning, Vast.ai offers templates for popular open-source models that you can launch without building the environment yourself. The site's model library lists entries such as Qwen Image 2.1, described as a compact 7B unified text-to-image and image editing model. These templates are the fastest path if your goal is to run a known model rather than configure a blank GPU instance.
What you need before deploying
- An account with credit. The site states you can start with as little as $5, and that there are no contracts or sales calls.
- An API key. Retrieved from the console; required for the REST API and used by the SDK and CLI for authenticated operations.
- A target GPU profile. You filter by model, VRAM, price, and availability, either through the console or the API.
The site claims the path from sign-up to running a workload takes under five minutes, and that instances launch in seconds and can be scaled up or down programmatically.
Choosing between them
- If you want to poke at the inventory interactively, start with the CLI.
- If you're scripting a pipeline in Python, use the SDK.
- If you're building an agent or a non-Python service, call the REST API.
- If you just want a specific open-source model running, start from a template instead of a bare instance.
These aren't mutually exclusive — the same account and API key work across all three, so you can prototype in the CLI and move the same operations into the SDK or API later.