| name | vastai-multi-env-setup |
| description | Configure Vast.ai GPU cloud across dev, staging, and production environments.
Use when isolating GPU pools per team, managing API key separation by env,
or implementing spending controls per deployment tier.
Trigger with phrases like "vastai environments", "vastai staging",
"vastai dev prod", "vastai multi-env".
|
| allowed-tools | Read, Write, Edit, Bash(vastai:*), Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","vast-ai","deployment"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Vast.ai Multi-Environment Setup
Overview
Configure separate Vast.ai environments for development, staging, and production by using different API keys, GPU profiles, and spending limits. Vast.ai does not have built-in environment isolation, so you implement it through configuration.
Prerequisites
- Vast.ai accounts or API keys per environment
- Secrets manager for key storage
- Understanding of GPU profile requirements per tier
Instructions
Step 1: Environment Configuration
import os
from dataclasses import dataclass
@dataclass
class VastEnvConfig:
name: str
api_key: str
max_dph: float
max_instances: int
max_daily_spend: float
gpu_whitelist: list
reliability_min: float
auto_destroy_hours: int
ENVIRONMENTS = {
"development": VastEnvConfig(
name="development",
api_key=os.environ.get("VASTAI_DEV_KEY", ""),
max_dph=0.25,
max_instances=2,
max_daily_spend=5.00,
gpu_whitelist=["RTX_3090", "RTX_4090"],
reliability_min=0.90,
auto_destroy_hours=2,
),
"staging": VastEnvConfig(
name="staging",
api_key=os.environ.get(, ),
max_dph=,
max_instances=,
max_daily_spend=,
gpu_whitelist=[, ],
reliability_min=,
auto_destroy_hours=,
),
: VastEnvConfig(
name=,
api_key=os.environ.get(, ),
max_dph=,
max_instances=,
max_daily_spend=,
gpu_whitelist=[, ],
reliability_min=,
auto_destroy_hours=,
),
}
():
env = env os.environ.get(, )
ENVIRONMENTS[env]