| name | vastai-cost-tuning |
| description | Optimize Vast.ai GPU cloud costs through smart instance selection and lifecycle management.
Use when analyzing GPU spending, reducing training costs,
or implementing budget controls for Vast.ai workloads.
Trigger with phrases like "vastai cost", "vastai billing",
"reduce vastai costs", "vastai pricing", "vastai budget".
|
| allowed-tools | Read, Write, Edit, Bash(vastai:*), Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","vast-ai","api","cost-optimization"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Vast.ai Cost Tuning
Overview
Minimize Vast.ai GPU cloud costs by choosing the right GPU for your workload, leveraging interruptible (spot) instances, eliminating idle compute, and implementing auto-destroy safeguards. Vast.ai pricing is dynamic and varies significantly: RTX 4090 ($0.15-0.30/hr), A100 80GB ($1.00-2.00/hr), H100 SXM ($2.50-4.00/hr).
Prerequisites
- Vast.ai account with billing history
- Understanding of your workload's GPU requirements
vastai CLI installed
Instructions
Step 1: GPU Selection by Cost-Efficiency
GPU_SPECS = {
"RTX_4090": {"fp16_tflops": 82.6, "vram": 24},
"A100": {"fp16_tflops": 77.97, "vram": 80},
"H100_SXM": {"fp16_tflops": 267, "vram": 80},
"RTX_3090": {"fp16_tflops": 35.6, "vram": 24},
"A6000": {"fp16_tflops": 38.7, "vram": 48},
}
def cost_per_tflop(gpu_name, dph):
specs = GPU_SPECS.get(gpu_name, {"fp16_tflops": 1})
return dph / specs["fp16_tflops"]
Step 2: Spot vs On-Demand Analysis