Choose the correct Vast.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles.

MITAuto-check passedBackend & APIs

Install Vastai SDK Patterns

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill vastai-sdk-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace vastai-sdk-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/vastai-sdk-patterns .claude/skills/vastai-sdk-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
vastai-sdk-patterns
GitHub stars
2.8k
Token cost
~1k tokens
SKILL.md length
435 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Choose the correct Vast.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles.

  • Works in 6 steps: Select one client boundary → Normalize responses once → Separate plan from mutation → …
  • Integrating the high-level SDK
  • SKILL.md covers Overview, Prerequisites, Instructions and Authentication, plus 5 more sections
  • Needs VAST_API_KEY

What it does

Vastai SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Choose the correct Vast.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles. Use when integrating the high-level SDK, SyncClient, AsyncClient, or Serverless client. Trigger with: "use the Vast.ai SDK", "wrap a Vast.ai instance lifecycle", "choose SyncClient or AsyncClient".

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/official-docs.md`). Compatibility notes: Requires Python 3.9+, the current Vast.ai package, a scoped API key, and tests that can replace network calls.

It sits in Backend & APIs, covering Serverless. It works with Python and Vercel AI SDK. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Integrating the high-level SDK
  • Serverless client
  • With: use the Vast.ai SDK
  • Wrap a Vast.ai instance lifecycle

Example prompts

  • “use the Vast.ai SDK”
  • “wrap a Vast.ai instance lifecycle”
  • “choose SyncClient or AsyncClient”
  • “/vastai-sdk-patterns”

Requirements

  • Python 3
  • A credential in VAST_API_KEY
  • Compatibility (from SKILL.md): Requires Python 3.9+, the current Vast.ai package, a scoped API key, and tests that can replace network calls.
  • Pre-approved tools (allowed-tools): Read, Grep, Write, Edit

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Select one client boundary
  2. Normalize responses once
  3. Separate plan from mutation
  4. Own the lifecycle
  5. Test failure boundaries
  6. Expose a redacted receipt

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.vast.ai
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • VAST_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Python 3.9+, the current Vast.ai package, a scoped API key, and tests that can replace network calls.

    From compatibility in the SKILL.md frontmatter.

Context cost

Vastai SDK Patterns loads about 1k tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 435 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 435 words, ~1,046 tokens.

Download SKILL.mdSave it as .claude/skills/vastai-sdk-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
vastai-sdk-patterns
description
Choose the correct Vast.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles. Use when integrating the high-level SDK, SyncClient, AsyncClient, or Serverless client. Trigger with: "use the Vast.ai SDK", "wrap a Vast.ai instance lifecycle", "choose SyncClient or AsyncClient".
allowed-tools
Read, Grep, Write, Edit
compatibility
Requires Python 3.9+, the current Vast.ai package, a scoped API key, and tests that can replace network calls.
version
2.0.0
argument-hint
[client-mode-resource-and-lifecycle-owner]
model
inherit
effort
high
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, vastai, python, sdk, lifecycle

Owned Vast.ai Python SDK Lifecycles

Overview

Use the highest-level client that preserves the required control. Keep resource identity and cleanup ownership explicit, normalize provider response variants at one boundary, and never hide a billable instance behind an unbounded retry.

Prerequisites

  • Chosen high-level, synchronous, asynchronous, or Serverless client surface
  • Typed internal model for offers, instances, terminal states, and provider errors
  • Idempotency, timeout, test-double, and cleanup design

Instructions

Step 1: Select one client boundary

Use VastAI for broad CLI-equivalent operations, SyncClient for typed synchronous instance control, AsyncClient inside an async context, or Serverless for endpoint inference.

Step 2: Normalize responses once

Map provider dictionaries and error shapes into a small internal result type. Preserve offer ID, contract ID, status, price, and raw error code for diagnosis.

Step 3: Separate plan from mutation

Search and score offers without creating resources. Require an approved plan object before calling create, update, destroy, or credit operations.

Step 4: Own the lifecycle

Persist the returned instance ID immediately, apply a monotonic deadline, classify terminal failure states, and place destroy or handoff in an explicit finalizer.

Step 5: Test failure boundaries

Cover 401, 403, 429, malformed responses, create-without-ID, readiness timeout, and cleanup failure using local fakes.

Step 6: Expose a redacted receipt

Return normalized decisions and state transitions; never return the API key or full environment.

Authentication

Construct clients from VAST_API_KEY or the approved local configuration. Do not pass keys as literals, serialize client objects, or let provider credentials cross into workload payloads.

Show full SKILL.md (190 more words)Show less

Tool Discipline

Use Read and Grep to inspect manifests, configuration, provider output, and existing tests before proposing a mutation. Use Write or Edit only for the approved plan, implementation, test, or redacted receipt; do not create, update, destroy, or fund Vast.ai resources without explicit operator approval.

Output

  • Client-selection decision and typed adapter contract
  • Bounded lifecycle implementation with local failure tests
  • Redacted mutation and cleanup receipt

Return client type, package version, plan identity, provider resource IDs, terminal outcome, and cleanup owner.

Examples

An async job runner uses AsyncClient as a context manager, records instance.id before waiting, cancels on its deadline, and destroys the instance in a tested finalizer.

Error Handling

FailureResponse
Create succeeds without a usable IDStop follow-on work, reconcile instances from the account, and avoid a blind second create.
Response shape changesFail at the adapter boundary and retain the redacted raw response for review.
429 occursUse bounded client retry and reduce polling; do not multiply retries at every layer.
Finalizer cannot destroyPersist the resource ID and page the billing owner.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/vastai-sdk-patterns of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/official-docs.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Vastai SDK Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Vastai SDK Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vastai SDK Patterns this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1kAutomated safety check: PassMIT
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
Vastai SDKvast-ai/vast-cli223—~2kAutomated safety check: PassMIT
Adobe App Builder Action Scaffolderadobe/skills197—~3.1kAutomated safety check: PassApache-2.0
Cookbook Computedatabricks-solutions/databricks-apps-cookbook183—~790Automated safety check: PassCustom licence
Modaldavila7/claude-code-templates33k7 repos~2.6kAutomated safety check: PassMIT

Similar skills

  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Vastai SDK

    vast-ai/vast-cli

    Vast.ai Python SDK — high-level API for GPU instances, volumes, serverless endpoints, and billing.

    223 GitHub stars~2k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Scaffolds, implements, deploys and debugs Adobe Runtime actions in App Builder projects, with templates for webhooks, events, database CRUD, sequences and Asset Compute workers.

    197 GitHub stars~3.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Cookbook Compute

    databricks-solutions/databricks-apps-cookbook

    Connect Databricks Apps to shared clusters or serverless compute using Databricks Connect.

    183 GitHub stars~790 tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Modal

    davila7/claude-code-templates

    Run Python code in the cloud with serverless containers, GPUs, and autoscaling.

    33k GitHub starsUsed in 7 repos~2.6k tokens
    Backend & APIsAuto-check passed
  • Modal

    K-Dense-AI/scientific-agent-skills

    Modal is a serverless cloud platform for running Python on demand, including on-demand GPUs.

    48k GitHub starsUsed in 1 repo~4.5k tokens
    Backend & APIsAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Vastai SDK Patterns

What does Vastai SDK Patterns do?

Choose the correct Vast.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles. Vastai SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace.ai Python client and implement typed, bounded, ownership-safe GPU lifecycles.

When should I use Vastai SDK Patterns?

Vastai SDK Patterns fits situations like: integrating the high-level SDK; serverless client; with: use the Vast.ai SDK; wrap a Vast.ai instance lifecycle.

How do I install Vastai SDK Patterns in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vastai-sdk-patterns -a claude-code`. Or copy the skill folder (skills/.curated/vastai-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/vastai-sdk-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Vastai SDK Patterns in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vastai-sdk-patterns -a codex`. Or copy the skill folder (skills/.curated/vastai-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/vastai-sdk-patterns in your project. Codex loads it when a task matches its description.

Can I use Vastai SDK Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vastai-sdk-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vastai-sdk-patterns, .gemini/skills/vastai-sdk-patterns, .github/skills/vastai-sdk-patterns and .opencode/skills/vastai-sdk-patterns in your project.

What does Vastai SDK Patterns need to run?

Going by SKILL.md and its folder, Vastai SDK Patterns needs credentials named VAST_API_KEY. Our summary lists: Python 3; A credential in VAST_API_KEY. Its frontmatter pre-approves these tools: Read, Grep, Write, Edit. Compatibility (from SKILL.md): Requires Python 3.9+, the current Vast.ai package, a scoped API key, and tests that can replace network calls..

Does Vastai SDK Patterns access the network?

SKILL.md names 2 domains. As links in the text: docs.vast.ai and github.com. This is read from the text; nothing was executed.

Is Vastai SDK Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Vastai SDK Patterns use?

Vastai SDK Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Vastai SDK Patterns use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 338 tokens, read only when the agent opens those files.

What are the alternatives to Vastai SDK Patterns?

Skills that share tags, products or a category with Vastai SDK Patterns: AWS Serverless Eda (zxkane/aws-skills, 367 stars), Vastai SDK (vast-ai/vast-cli, 223 stars), Adobe App Builder Action Scaffolder (adobe/skills, 197 stars) and Cookbook Compute (databricks-solutions/databricks-apps-cookbook, 183 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vastai SDK Patterns?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.