Guide · Agent skill
How to use the Vast.ai GPU Rental agent skill (vast-gpu)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The vast-gpu skill lets an AI agent rent on-demand GPUs from the vast.ai marketplace for you, so you can run a training job without owning the hardware. You describe the task, the agent works out what kind of GPU it needs, shows you priced options, and handles renting, setup and destruction after you choose. This guide explains what the skill does, how to install it, how to trigger it, and what to check before you spend money.
Quick start
- 1Install the vastai CLI. Run pip install vastai using Python 3.10 or newer. Use a virtual environment if your system Python is older.
- 2Set your API key. Run vastai set api-key with your vast.ai API key so the agent can authenticate.
- 3Upload your SSH public key. Add your key at https://cloud.vast.ai/manage-keys/ before creating any instance, since keys are fixed at creation time.
- 4Install the skill. Unzip the downloaded ZIP into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills.
- 5Describe your task. Ask in plain language, naming the model, dataset and expected duration, and include a trigger phrase such as rent gpu or vast.ai.
- 6Choose an offer. Review the three options with estimated total cost and reply with the number or offer ID you want.
- 7Destroy when finished. Ask the agent to destroy the instance once your run is done so billing stops.
What the vast-gpu skill makes the agent do
An agent skill is a set of instructions and scripts that an AI agent loads when a request matches it. This skill covers the full life of a rented GPU: rent, setup, run, and destroy.
You do not pick GPU models yourself. The agent reads context such as an experiment plan, experiment scripts or your description to estimate memory needs, training time and disk size, then searches vast.ai offers across several GPU tiers.
- Analyses the training task to estimate VRAM, number of GPUs, hours and disk
- Searches offers and shows about three options with estimated total cost
- Creates the instance after you choose, waits until it is running and gets SSH details
- Keeps a local vast-instances.json file of active instances so other experiment skills can connect to them
How do you install the vast-gpu skill?
You can install the skill in one of two ways. Download the ZIP from this page and either unzip it into ~/.claude/skills/ for all your projects, or unzip it into a project's .claude/skills/ folder for that project only.
In the Claude apps you can instead upload the skill under Settings → Capabilities → Skills.
The skill also needs the vastai CLI and an API key before it can do anything. Install the CLI and set your key with the commands below.
- Requires Python 3.10 or newer
- Upload your SSH public key at https://cloud.vast.ai/manage-keys/ before creating any instance
- If your system Python is older than 3.10, create a virtual environment with Python 3.10 or newer (for example with conda, pyenv or uv) and install vastai there
pip install vastai
vastai set api-key YOUR_API_KEYHow do you trigger the skill with natural requests?
The skill loads when your request matches its description. Phrases that trigger it include "rent gpu", "vast.ai", "rent a server", "cloud gpu", or a plain statement that you need on-demand GPU without owning hardware.
Describe the task rather than the hardware. Include the model, dataset size and roughly how long the run should take, because the agent uses these to estimate requirements.
- "Rent a GPU to fine-tune a 7B model on my 10k sample dataset, about 2 hours."
- "I need cloud gpu for my training run, I don't own hardware."
- "Check my vast.ai instances and destroy any that are finished."
What happens during a rental?
When you approve an offer, the agent creates the instance with SSH access, a default PyTorch Docker image and a disk size it calculated. It then polls the instance status until it reaches running, which the source says typically takes 30 to 60 seconds and can take up to about five minutes. If it is still loading after five minutes, the agent warns you.
Once running, the agent fetches the SSH connection URL and records the instance in the state file. The source notes that SSH keys are baked in at creation time, so a key added after renting means destroying and re-creating the instance.
- Default Docker image: pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel, unless your AGENTS.md sets an image: field
- Default setup installs git, screen and rsync on the instance
- The instance ID is the new_contract value in the create output
vastai ssh-url <INSTANCE_ID>What does the skill need before you start?
You need a vast.ai account with an API key, an SSH public key uploaded to vast.ai before you rent, and the vastai CLI installed on the machine where the agent runs. You also need funds in your account, because rentals are billed to it.
The skill is aimed at people already comfortable with the command line, since setup involves Python, API keys and SSH keys.
- Python 3.10 or newer
- vastai CLI (pip install vastai)
- vast.ai API key stored with vastai set api-key
- SSH public key uploaded to vast.ai before instance creation
- Docker image pytorch/pytorch by default; rented machines are hosted on vast.ai hosts
Safety notes: scripts, network and cost
This skill runs scripts and uses the network. It executes vastai and shell commands, and it is allowed to use Bash, Read, Write, Edit, Grep and Glob. Review the SKILL.md file before installing if you need to know exactly what it will run.
Rented machines belong to third-party hosts. Anything you place on them leaves your own environment, so do not use it for sensitive or regulated data. Instances keep billing until destroyed, so check the instance list after each run.
- Billing goes to your vast.ai account; forgotten instances keep charging until destroyed
- Do not rely on the skill for sensitive or regulated data
- Keep your API key private and do not paste it into shared chats
Tips for keeping costs down
Ask for the cost table before anything is rented. The skill presents estimated total cost (hourly price times estimated hours), not just the hourly rate, and flags cheap offers with reliability below 0.97.
For short tasks under an hour, the skill suggests interruptible pricing for a lower cost. Keep the vast-instances.json file accurate so the agent can find and destroy instances later.
- Compare estimated total cost, not $/hr alone
- Treat offers with reliability under 0.97 as budget picks that may be interrupted
- Destroy instances as soon as a run finishes
What people use it for
- Fine-tuning a language model you do not have hardware for
- Running several small ablation experiments with cost estimates before each rental
- Training a vision model such as ResNet-50 on a rented card for a few hours
- Letting other experiment skills connect to running instances through vast-instances.json
Frequently asked questions
How do I install the vast-gpu skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for all projects or into a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings → Capabilities → Skills.
What do I need to use vast-gpu?
You need Python 3.10 or newer, the vastai CLI installed with pip, a vast.ai API key set with vastai set api-key, and an SSH public key uploaded to vast.ai before you create an instance. Your vast.ai account must also have funds, since rentals are billed.
Is the vast-gpu skill free?
The skill is listed under the MIT licence. Renting GPUs on vast.ai is billed to your own vast.ai account at the offer's hourly price, so the skill itself is free but the compute is not.
Why does my rented instance not connect over SSH?
SSH keys are baked in at creation time. If you added your key after renting, destroy the instance and create a new one. Also confirm the key is uploaded at https://cloud.vast.ai/manage-keys/ before renting.
How do I stop being charged for a GPU rental?
Ask the agent to destroy the instance, which the skill supports. Instances keep billing until they are destroyed, so check your instance list after each run.
Are there alternatives to vast-gpu for renting GPUs?
The source does not compare this skill with other options, so this guide cannot make a verdict on alternatives. If you prefer to manage vast.ai directly, you can use the vastai CLI commands shown in the skill yourself.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use vast-gpu if you need a GPU for a training run, are comfortable with the command line, and already have or will set up a vast.ai account with API and SSH keys. Pick something else if you do not want to pay real money for compute, if your data is sensitive or regulated, or if you are new to the terminal.
Download the skill