vast-ai/vast-cli / vastai
vastai
FlaggedVast.ai CLI to manage GPU instances, volumes, serverless endpoints, and billing.
api/deployments.py
View on GitHub"""Deployment CRUD operations."""
from vastai.api.client import VastClient
def show_deployments(client: VastClient) -> list:
r = client.get("/deployments")
r.raise_for_status()
return r.json()["deployments"]
def show_deployment(client: VastClient, id: int) -> dict:
r = client.get(f"/deployment/{id}/")
r.raise_for_status()
return r.json()["deployment"]
def show_deployment_versions(client: VastClient, id: int) -> list:
r = client.get(f"/deployment/{id}/versions/")
r.raise_for_status()
rj = r.json()
if rj.get("success"):
return rj["versions"]
else:
raise RuntimeError(rj.get("msg", "Unknown error"))
def delete_deployment(client: VastClient, id: int) -> dict:
r = client.delete(f"/deployment/{id}/")
r.raise_for_status()
return r.json()
def stop_deployment(client: VastClient, id: int) -> dict:
r = client.post(f"/deployment/{id}/stop/")
r.raise_for_status()
return r.json()
def start_deployment(client: VastClient, id: int) -> dict:
r = client.post(f"/deployment/{id}/start/")
r.raise_for_status()
return r.json()
def delete_deployment_by_name(client: VastClient, name: str, tag: str = None) -> dict:
json_blob = {"name": name}
if tag is not None:
json_blob["tag"] = tag
r = client.delete("/deployments/", json_data=json_blob)
r.raise_for_status()
return r.json()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |