--- id: vastai version: "1.5.4" license: MIT license_treatment: permissive maintenance: active --- # vastai — CLI and SDK for Vast.ai GPU Cloud Service License: permissive · Maintenance: active · Downloads: 2.2M/mo ## 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 above — verify before relying. Provides a CLI and Python SDK for managing GPU compute resources on Vast.ai, including instance lifecycle operations, resource searching, and serverless endpoint inference. 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 pip install vastai uv add vastai poetry add vastai ## Installing vastai 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. 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') Requires VAST_API_KEY environment variable or explicit api_key parameter; obtain from https://cloud.vast.ai/manage-keys/ 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_current - Install friction: low - Maintenance: active - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags gpu cloud management cli, vast.ai python sdk, gpu instance provisioning, serverless gpu inference, cloud compute resource api, gpu marketplace client, distributed gpu scheduling, gpu-cloud, infrastructure-as-code, async-http [View on SkillFed](https://skillfed.io/packages/vastai) · [View on PyPI](https://pypi.org/project/vastai/)