Automate the entire process of creating and setting up a new RunPod instance - from API calls to environment configuration in one command.
- 🚀 Creates RunPod instance via API with your specs
- 🔑 Automatically configures SSH keys and updates
~/.ssh/config - 🐍 Creates Python virtual environment and installs dependencies
- 🔌 Installs VS Code extensions (Python, etc.)
- 📍 Auto-detects datacenter from your network volume
- 👤 Configures git user identity (name and email)
- ⏱️ Saves ~10-15 minutes of manual setup per pod
pip install -r requirements.txtCreate a .env file:
RUNPOD_API_KEY=your_api_key_herepython list_gpus.pyCopy the exact GPU ID (e.g., NVIDIA A100 80GB PCIe, not just A100).
Edit example_config.yaml:
disk_space_gb: 200
gpu_type: NVIDIA A100 80GB PCIe # Use exact GPU type ID from list_gpus.py
num_gpus: 1
network_volume_id: xvq549q1g2
pod_name: My-Project
requirements_file: /workspace/my-project/requirements.txt
template_id: runpod-torch-v280
user_email: [email protected]
user_name: Your Name
venv_path: /tmp/venv
vscode_extensions:
- ms-python.pythonpython spin_up_runpod.py example_config.yamlThe script will:
- Create the pod
- Configure SSH
- Prompt you to open Cursor/VS Code (do this while it continues)
- Set up Python environment and git config (while you're connecting)
- Install extensions automatically
- Report completion
Time: ~3-5 minutes total. You open Cursor while pip is installing, then everything's ready!
| Field | Description | Example |
|---|---|---|
disk_space_gb |
Disk space (reference only) | 200 |
gpu_type |
Exact GPU type ID | NVIDIA A100 80GB PCIe |
num_gpus |
Number of GPUs | 1 |
network_volume_id |
Your network volume ID | xvq549q1g2 |
pod_name |
Pod name (spaces → dashes in SSH) | My-Project |
requirements_file |
Path to requirements.txt on remote | /workspace/project/requirements.txt |
template_id |
RunPod template ID | runpod-torch-v280 |
user_email |
Git user email (optional) | [email protected] |
user_name |
Git user name (optional) | Your Name |
venv_path |
Where to create venv | /tmp/venv |
vscode_extensions |
List of extension IDs (optional) | ["ms-python.python"] |
Notes:
- Datacenter is automatically detected from your network volume
- Pod names with spaces get sanitized for SSH (e.g., "My Pod" → "My-Pod")
- Omit
vscode_extensionsor use[]to skip extension installation user_emailanduser_nameare optional but recommended for git commits
python list_gpus.pyShows all available GPU types with exact IDs needed for config.
python list_datacenters.pyShows your network volumes and their datacenter locations.
# List all your pods
python manage_pods.py list
# Get details about a pod
python manage_pods.py details <pod_id>
# Stop a pod (keeps it for later)
python manage_pods.py stop <pod_id>
# Terminate (delete) a pod
python manage_pods.py terminate <pod_id>- Use exact GPU type ID: Run
python list_gpus.py- ❌ Wrong:
A100 - ✅ Right:
NVIDIA A100 80GB PCIe
- ❌ Wrong:
- Try a different GPU type
- Check RunPod web UI for current availability
- Wait and retry (availability changes frequently)
- Wait 30-60 more seconds (pods take time to boot)
- Check pod status:
python manage_pods.py list - Verify SSH key is in your RunPod account settings
- Ensure
requirements_filepath is correct - Path should point to network volume:
/workspace/<project>/requirements.txt
- Make sure you opened Cursor/VS Code when prompted
- Extensions need code-server (installed on first connection)
- Install manually via Extensions panel if needed
Create different YAML files:
python spin_up_runpod.py project1.yaml
python spin_up_runpod.py project2.yamlvscode_extensions:
- ms-python.python
- ms-python.vscode-pylance
- ms-toolsai.jupyter
- github.copilotEdit setup_remote_environment() in the script to add:
- System package installation
- Repository cloning
- Environment variables
- Initialization scripts
- Pod Creation: Queries SSH keys, detects datacenter, creates pod via API
- SSH Configuration: Updates
~/.ssh/configwith connection details - Environment Setup: Creates venv, installs pip packages, configures git identity (you connect during this)
- Extension Installation: Automatically installs VS Code extensions once code-server is ready
- Ready to Code: Everything configured, just start coding!
FINDINGS.md- Important notes about RunPod API quirks- RunPod API docs: https://graphql-spec.runpod.io/