VA

vastai-upgrade-migration

Guides the safe upgrade of the Vast.ai CLI and SDK while identifying breaking changes and ensuring API compatibility.

Install

mkdir -p .claude/skills/vastai-upgrade-migration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4218" && unzip -o skill.zip -d .claude/skills/vastai-upgrade-migration && rm skill.zip

Installs to .claude/skills/vastai-upgrade-migration

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Upgrade Vast.ai CLI, migrate API versions, and handle breaking changes.
71 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Upgrade Vast.ai CLI and Python SDK
  • Detect breaking changes in CLI commands
  • Migrate between API endpoints
  • Update Docker images for CUDA compatibility
  • Verify authentication and instance status post-upgrade

How it works

The process involves upgrading the CLI via pip, comparing CLI help output to identify removed commands, and testing API connectivity against different base URLs.

Inputs & outputs

You give it
CLI version and API endpoint configuration
You get back
Upgraded SDK environment and verification report

When to use vastai-upgrade-migration

  • Upgrade Vast.ai CLI version
  • Detect API breaking changes
  • Migrate to newer GPU configurations
  • Validate SDK auth settings

About this skill

Vast.ai Upgrade & Migration

Current State

!vastai --version 2>/dev/null || echo 'vastai CLI not installed' !pip show vastai 2>/dev/null | grep -E "^(Name|Version)" || echo 'N/A'

Overview

Upgrade the Vast.ai CLI and Python SDK, handle API changes, and migrate between GPU configurations. The CLI is distributed via PyPI as vastai and tracks the REST API at cloud.vast.ai/api/v0.

Prerequisites

  • Current vastai CLI installed
  • Active instances inventory documented
  • Backup of any custom scripts using the API

Instructions

Step 1: Check Current Version and Upgrade

# Check installed version
vastai --version
pip show vastai | grep Version

# Upgrade to latest
pip install --upgrade vastai

# Verify upgrade
vastai --version
vastai show user  # Verify auth still works

Step 2: Detect Breaking Changes

# Compare CLI help output before and after upgrade
import subprocess

def get_cli_commands():
    result = subprocess.run(["vastai", "--help"], capture_output=True, text=True)
    commands = set()
    for line in result.stdout.split('\n'):
        stripped = line.strip()
        if stripped and not stripped.startswith('-') and not stripped.startswith('usage'):
            cmd = stripped.split()[0] if stripped.split() else ""
            if cmd.isalpha():
                commands.add(cmd)
    return commands

# Run before and after upgrade to detect removed commands

Step 3: API Version Migration

# The REST API is at v0 — if Vast.ai introduces v1, update base URL
OLD_BASE = "https://cloud.vast.ai/api/v0"
NEW_BASE = "https://console.vast.ai/api/v0"  # Alternative endpoint

# Test both endpoints
import requests
for base in [OLD_BASE, NEW_BASE]:
    try:
        resp = requests.get(f"{base}/users/current",
                           headers={"Authorization": f"Bearer {api_key}"})
        print(f"{base}: {resp.status_code}")
    except Exception as e:
        print(f"{base}: {e}")

Step 4: Docker Image Updates

# Update GPU workload images to latest CUDA
# Old: pytorch/pytorch:1.13-cuda11.7-runtime
# New: pytorch/pytorch:2.2.0-cuda12.1-cudnn8-runtime

# Test new image locally before deploying
docker pull pytorch/pytorch:2.2.0-cuda12.1-cudnn8-runtime
docker run --rm pytorch/pytorch:2.2.0-cuda12.1-cudnn8-runtime python -c "import torch; print(torch.__version__)"

# Verify CUDA compatibility with target GPU hosts
vastai search offers 'cuda_max_good>=12.1 num_gpus=1' --limit 5

Step 5: Post-Upgrade Verification

#!/bin/bash
set -euo pipefail
echo "Post-upgrade verification..."

vastai show user && echo "  Auth: OK"
vastai search offers 'num_gpus=1 rentable=true' --limit 1 --raw | python3 -c "import sys,json; offers=json.load(sys.stdin); print(f'  Search: OK ({len(offers)} offers)')"
vastai show instances && echo "  Instances: OK"

echo "Upgrade verified."

Output

  • CLI upgraded to latest version
  • Breaking changes identified
  • API endpoint compatibility verified
  • Docker images updated to latest CUDA
  • Post-upgrade verification passed

Error Handling

ErrorCauseSolution
CLI command removed after upgradeBreaking change in new versionPin to previous version: pip install vastai==0.2.8
Auth fails after upgradeAPI key format changedRe-run vastai set api-key YOUR_KEY
CUDA mismatch after image updateHost CUDA older than image requiresFilter offers by cuda_max_good>=VERSION

Resources

Next Steps

For CI/CD integration, see vastai-ci-integration.

Examples

Safe upgrade: Pin the current version in requirements.txt, upgrade in a test environment, run the verification script, then update production.

CUDA migration: Move from CUDA 11.7 to 12.1 by updating Docker images and filtering offers with cuda_max_good>=12.1.

When not to use it

  • When the current environment is stable and no updates are required
  • When working in a locked-version production environment

Prerequisites

Current vastai CLI installedActive instances inventory documentedBackup of custom scripts

Limitations

  • Requires manual verification of custom scripts
  • API endpoint migration depends on Vast.ai availability

How it compares

This workflow provides a systematic verification process to ensure script compatibility after an upgrade, rather than simply updating the package.

Compared to similar skills

vastai-upgrade-migration side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vastai-upgrade-migration (this skill)127dReviewIntermediate
fastapi-templates5202moNo flagsIntermediate
llama-cpp218moReviewIntermediate
textual1439moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

Search skills

Search the agent skills registry