vastai
CLI and SDK for Vast.ai GPU Cloud Service
Decision gist · record as of 2026-08-14
Yes, if you use Vast.ai for GPU compute. The package is actively maintained, has no known vulnerabilities, and provides both CLI and SDK interfaces. Install friction is low and the license is permissive. The main prerequisite is a Vast.ai account and API key. Not relevant if you don't use the Vast.ai platform.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires VAST_API_KEY environment variable or explicit api_key parameter; obtain from https://cloud.vast.ai/manage-keys/
- Low friction installation with a pure-Python wheel.
- Active maintenance with a release 2 days old and last commit on 2026-08-14.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you can use, modify, and redistribute vastai freely in commercial and private projects with minimal restrictions.
last release 2026-08-12 (2 days) · last repo commit 2026-08-14 · 211 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,173,468 downloads/mo, #3,233 on PyPI
Alternatives
Verify before relying
pip install vastai
from vastai import VastAI
vast = VastAI() # uses VAST_API_KEY env var
vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4')- Whether the serverless client supports synchronous (non-async) usage patterns or requires asyncio integration
- Specific rate limits or quota constraints when searching or managing instances via the SDK
What it is and what it does
Vastai is the official Python interface to Vast.ai's GPU cloud platform. It offers both a command-line tool and a programmatic SDK for discovering, provisioning, and managing GPU compute instances on a peer-to-peer marketplace. The CLI can be installed standalone without Python, while the SDK integrates into Python applications for automated workflows.
The package handles three main workflows: searching available GPU offers by specification, managing instance lifecycle (create, start, stop, destroy), and making inference requests to serverless endpoints. It wraps HTTP communication with aiohttp and requests, handles authentication via API key, and provides tab completion for CLI commands. The serverless client supports async request patterns for high-throughput inference scenarios.
Use it for
- Search and filter GPU offers by hardware specs (model, count, memory) before provisioning a training instance
- Automate instance lifecycle in CI/CD pipelines—create, configure, run jobs, then tear down to minimize cost
- Build applications that query serverless GPU endpoints for real-time model inference without managing infrastructure
- Monitor and manage multiple GPU instances programmatically from a single control script
- Integrate Vast.ai resource discovery into AI agent workflows for autonomous compute allocation
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Vast.ai for GPU compute.
The package is actively maintained, has no known vulnerabilities, and provides both CLI and SDK interfaces. Install friction is low and the license is permissive. The main prerequisite is a Vast.ai account and API key. Not relevant if you don't use the Vast.ai platform.
Install
vastai on PyPI
Before you install
Low friction installation with a pure-Python wheel. Active maintenance with a release 2 days old and last commit on 2026-08-14. Requires Python 3.10 or later. Runtime dependency chain is substantial (18 packages including aiohttp, cryptography, and pillow) but all are standard ecosystem libraries.
Requires VAST_API_KEY environment variable or explicit api_key parameter; obtain from https://cloud.vast.ai/manage-keys/
License in practice
MIT license (permissive) — you can use, modify, and redistribute vastai freely in commercial and private projects with minimal restrictions.
Quickstart
pip install vastai
from vastai import VastAI
vast = VastAI() # uses VAST_API_KEY env var
vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4')
Verify before relying
- Whether the serverless client supports synchronous (non-async) usage patterns or requires asyncio integration
- Specific rate limits or quota constraints when searching or managing instances via the SDK
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 18 packagesaiodnsaiohttpanyioargcompleteborbcryptographycurlifypillowpsutilpycarespycryptodomepyparsingpython-dateutilrequestsrichtyping-extensionsurllib3xdg |
| Maintenance | Actively maintained 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,173,468 / month, #3,233 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: vastai-1.5.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “gpu cloud management cli”
- vastaiProvides a CLI and Python SDK for managing GPU compute resources on…
- primeCLI and Python SDK for managing GPU compute, sandboxes, training…
- dstackdstack is a unified control plane for provisioning and orchestrating…
Give your agent the search over MCP, or paste the wish link into any chat.
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework that enables you to define and call remote procedures across network boundaries using protocol buffers for serialization.
Install it if you need RPC communication in a distributed system or are integrating with existing gRPC services.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
Cloudpickle extends Python's standard pickle module to serialize lambda functions, interactively-defined functions and classes, and other constructs that the default pickle cannot handle, making it suitable for cluster computing and remote code execution.
Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution.
Provides a unified, open()-compatible Python API for streaming large files from remote storage (S3, GCS, Azure, HDFS, SFTP, HTTP) and local filesystems, with transparent compression support.
Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
Ray is a distributed computing framework that scales Python applications from a single machine to multi-node clusters, providing abstractions for parallel tasks, stateful actors, and shared objects.
See also leptonai · runpod · vastai-sdk · skypilot-nightly · openai-codex-cli-bin · azure-cli · google-agents-cli · fastapi-cloud-cli · azure-ai-inference · stashai