{"id":28440,"library":"vastai","title":"Vast.ai CLI & SDK","description":"Official CLI and Python SDK for Vast.ai GPU cloud service, enabling users to rent GPU instances, manage storage, and interact with the platform programmatically. Current version 1.0.12, release cadence is irregular (multiple releases in 2025).","status":"active","version":"1.0.12","language":"python","source_language":"en","source_url":"https://github.com/vast-ai/vast-cli","tags":["gpu","cloud","cli","sdk","vast-ai"],"install":[{"cmd":"pip install vastai","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"The package is imported as 'vast', there is no VastClient class in the top-level module.","wrong":"from vast import VastClient","symbol":"vast","correct":"import vast"},{"note":"VastClient is the main API client class, available under 'vast' package.","wrong":"import vastai","symbol":"VastClient","correct":"from vast import VastClient"}],"quickstart":{"code":"import vast\nfrom vast import VastClient\n\n# Initialize client with API key\nclient = VastClient(api_key=os.environ.get('VAST_API_KEY', ''))\n\n# Search for available instances\ninstances = client.search_offers('nvidia-rtx-4090')\nfor inst in instances[:3]:\n    print(inst['id'], inst['price']['dph'])\n\n# Create instance\ninstance = client.create_instance(offer_id=instances[0]['id'], duration_hours=1)\nprint(f\"Created instance {instance['id']}\")","lang":"python","description":"Search for RTX 4090 instances and launch one for 1 hour."},"warnings":[{"fix":"Create a configuration file or set environment variable as per documentation.","message":"Auto-update is now off by default as of v0.3.1. To enable it, set `should_check_for_update = True`.","severity":"breaking","affected_versions":">=0.3.1"},{"fix":"Use new data movement options as described in the docs.","message":"The `copy` command behavior changed in v0.4.0. Refer to https://docs.vast.ai/data-movement for new syntax.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Upgrade Python to 3.10 or later.","message":"Python 3.10 is minimum version as of v1.0.12 (requires>=3.10).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Pass `api_key` argument to VastClient or set `VAST_API_KEY` and use `os.environ.get`.","message":"API keys must be passed explicitly in code; reading from `VAST_API_KEY` environment variable is not automatic.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install vastai with `pip install vastai` and then use `from vast import VastClient`.","cause":"Incorrect import path; VastClient is available from 'vast' package but only after installing vastai.","error":"from vast import VastClient\nImportError: cannot import name 'VastClient' from 'vast'"},{"fix":"Ensure you have installed vastai (`pip install vastai`) and use `from vast import VastClient`.","cause":"Common mistake of importing 'vast' instead of 'vastai' package or missing install.","error":"AttributeError: module 'vast' has no attribute 'VastClient'"},{"fix":"Run `pip install vastai` and ensure Python scripts directory is in PATH.","cause":"The CLI is not installed or not in PATH.","error":"vast: command not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}