podstack
Python SDK for the Podstack platform API.
pip install podstack
The client talks to https://podstack.ai/api/v1. Set PODSTACK_API_KEY to a
ps_live_ key (a legacy psk_ key is also accepted), or run podstack auth login
so the CLI credentials file is present. api.podstack.ai does not resolve.
from podstack import Podstack
with Podstack() as client:
for gpu in client.gpus.list():
print(gpu.gpu_type, gpu.vram_gb)
for rate in client.rates.list():
print(rate.gpu_type, rate.region, rate.price_per_hour)
price_per_hour and every other spec are copied from the API. The SDK does
not ship a price table or a GPU catalogue.
Billable calls
Create, terminate, submit, cancel, chat, embeddings, image generation, and
function deploy or invoke require confirm=True. dry_run=True returns the
request and does not send it. dry_run is checked first.
preview = client.instances.create(gpu_type=gpu.gpu_type, dry_run=True)
operation = client.instances.create(gpu_type=gpu.gpu_type, confirm=True)
There is no stop or start that keeps an instance disk. Terminate the instance
to stop the per-second charge. Commands and file copies use the SSH command
the API returns and the local ssh / scp binaries.
Functions
Creating a function is this package. The CLI only lists functions.
import podstack
@podstack.function(gpu="h100_sxm", requirements=["torch"])
def device_name():
import torch
return torch.cuda.get_device_name(0)
print(device_name.deploy(dry_run=True))
print(device_name.invoke(confirm=True))
The function has to live in a file. Arguments must be JSON-serializable.
Calling it like a normal function raises ConfirmationRequired unless the
decorator was created with confirm=True.
Agents
podstack.tools() returns OpenAI, Anthropic, and MCP schemas. Names match
the Podstack CLI. python -m podstack.mcp serves those tools on stdio.
stop_instance and start_instance are listed because the CLI lists them,
and they report that the platform does not keep a stopped machine.
See examples/ and AGENTS.md.
Version 1.8.0
PyPI already published podstack 1.7.0, which was the previous notebook SDK.
1.8.0 removes that surface. There are no deprecated shims for routes the
platform does not serve. The removed modules are listed in docs/audit.md.
Async code uses AsyncPodstack. The method names match the sync client.
import asyncio
from podstack import AsyncPodstack
async def main():
async with AsyncPodstack() as client:
print(await client.gpus.list())
asyncio.run(main())
Development
python -m pip install -e ".[dev]"
python -m ruff check src tests examples
python -m mypy
python -m pytest
python -m build
twine check dist/*
This directory is the root of the standalone package. The release workflow is
.github/workflows/release.yml. It runs on a v* tag and on manual dispatch.
It does not publish from a pull request. Tag publish uses PyPI Trusted
Publishing (environment pypi, id-token: write) and falls back to the
PYPI_API_TOKEN secret when that secret is set. Manual dispatch also uploads
the built distributions to TestPyPI.
Metadata
Release files for podstack 1.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| podstack-1.8.0.tar.gz | 51.0 kB | Without provenance | Details for podstack-1.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| podstack-1.8.0-py3-none-any.whl | Python 3 | none | any | Details for podstack-1.8.0-py3-none-any.whl |
Total release size: 92.9 kB
Release files / podstack-1.8.0.tar.gz
| Download URL | podstack-1.8.0.tar.gz |
|---|---|
| Size | 51.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05536ad2cae1ff799faa4e005c68033c50af6e5e11e2e82c262e82c478de2d3e
|
|
BLAKE2b-256 checksum How to use checksums |
997d094f7b3956000b3f097536f46f969c3ca5de2c3c987cdb6fd443840f1278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / podstack-1.8.0-py3-none-any.whl
| Download URL | podstack-1.8.0-py3-none-any.whl |
|---|---|
| Size | 41.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdf6a526b7d46e4dc896d90c586bb8388e482af804f82d09f3124dc498839001
|
|
BLAKE2b-256 checksum How to use checksums |
87e00f7baef25b31e7d1b756e1ba4b549255464555403e437e4ab4da5de49ad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for podstack 1.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.