vastai-sdk

仓库创建 2019年1月29日最近提交 2 天前SkillHot 收录 21 天前
▸ 精选理由

适合需要程序化控制 Vast.ai 资源与计费的开发者与自动化脚本。

▸ 风险提示

需要绑定 Vast.ai API Key,误操作可能产生计费。

这个 Skill 做什么

用于在 Vast.ai 上以 Python 编程方式管理 GPU 实例、卷、无服务器端点和计费。

提供对 Vast.ai 上 GPU 实例、卷、无服务器端点和计费的 Python 编程接口,可以用代码创建、管理和查询这些资源。适合需要自动化租用 GPU、管理训练环境或搭建 serverless 推理的团队。优点是高层封装、易用的 SDK,且可通过可选项支持 serverless 和异步场景。

▸ 展开 SKILL.md 英文原文

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

开发编程GPU 管理云资源Python SDK通用
207
Stars
89
Forks
2
仓库内 Skill
+3
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai_sdk/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai_sdk/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Vast.ai Python SDK (`vastai` / `vastai_sdk`)

The `vastai` package provides a Python SDK for managing GPU instances, volumes, serverless endpoints, and billing on Vast.ai. The `vastai_sdk` package is a backward-compatibility shim that re-exports `vastai`.

## Installation

```bash
pip install vastai
```

For serverless and async support:
```bash
pip install "vastai[serverless]"
```

## Authentication

The SDK reads the API key from `~/.vast_api_key` by default. You can also pass it explicitly:

```python
from vastai import VastAI
vast = VastAI()                        # reads ~/.vast_api_key
vast = VastAI(api_key="YOUR_API_KEY")  # explicit key
```

Get your API key from https://console.va
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有