name: vast-ai-cli description: Vast.ai CLI workflows for searching GPU offers, creating and managing instances, handling volumes and data transfer, and troubleshooting authentication or command errors. Use when Codex needs to run or compose vastai/vast.py commands, interpret results, or automate Vast.ai marketplace tasks.
Vast.ai CLI
Overview
Use this skill to translate user requests into correct Vast.ai CLI commands, explain outputs, and handle common workflows (search, provision, manage, transfer, and cleanup).
Quick Start Workflow
- Confirm CLI + auth
- Prefer
vastaiif installed; otherwise usepython vast.pyor./vast.pyfrom the repo. - Ensure an API key is set (
vastai set api-key ...orVAST_API_KEY).
- Search offers
- Build a filter string and optional ordering/limit.
- Use
--rawwhen machine-readable output is needed.
- Create or launch an instance
- Use
create instance OFFER_ID ...for a fresh instance. - Use
launch instance OFFER_ID --template_hash ...when starting from a template.
- Operate instances
show,start,stop,reboot,destroyas needed.- Ask before destructive operations (destroy, delete volumes).
- Transfer data
- Use
vastai copyfor file transfer; usevastai ssh-urlto obtain SSH access.
- Clean up
- Stop or destroy instances and remove unused volumes.
Task Guidance
Search and pricing
- Compose filters using
field operator value(see references for fields/operators). - Prefer clear constraints: GPU model, RAM, reliability, cost per hour.
- Use
-oto order results (ascending+, descending-).
Instance creation
- Always include image + storage requirements.
- For notebooks or services, include
--jupyteror port mappings. - When asking for spot/bid pricing, use
--bid_price.
Data transfer
- For large transfers, prefer
vastai copyover ad-hoc scp since it uses instance metadata.
Troubleshooting
- Auth errors: confirm API key and config path.
- Rate limits: retry or add backoff; avoid rapid tab-completion queries.
- Missing command: check
vastai --helporpython vast.py --help.
References
- Read
references/vast-cli.mdfor command examples, search fields, and global options.