ppio-gpus
Python SDK for PPIO serverless GPU endpoints.
Installation
pip install ppio-gpus
Quick Start (Client)
import ppio_gpus
ppio_gpus.api_key = "your-api-key"
endpoint = ppio_gpus.Endpoint("your-endpoint-id")
job = endpoint.run({"prompt": "hello world"})
print(job.status())
output = job.output(timeout=60)
print(output)
Quick Start (Worker)
import ppio_gpus
def handler(job):
job_input = job["input"]
# ... process ...
return {"result": "done"}
ppio_gpus.start({"handler": handler})
Client API
Endpoint(endpoint_id)-- create an endpoint clientEndpoint.run(input)-- async submit a task, returns aJobimmediatelyEndpoint.health()-- check endpoint healthEndpoint.purge_queue()-- cancel all pending tasksJob.status()-- get current task statusJob.output(timeout=0)-- get task output, optionally poll until completeJob.cancel()-- cancel a running task
Worker API
ppio_gpus.start(config)-- start the worker loop (blocks until SIGTERM)ppio_gpus.progress_update(job, data)-- send in-progress status updateppio_gpus.upload_image(job_id, path)-- upload image to S3, returns presigned URLppio_gpus.upload_file(name, path)-- upload file to S3ppio_gpus.upload_bytes(name, data)-- upload bytes to S3
Configuration
Set credentials via environment variables:
export PPIO_API_KEY="your-api-key"
export PPIO_ENDPOINT_BASE_URL="https://async-public.serverless.ppinfra.com/v1" # default
Or set them directly:
ppio_gpus.api_key = "your-api-key"
ppio_gpus.endpoint_url_base = "https://your-custom-url/v1"
Metadata
Release files for ppio-gpus 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ppio_gpus-0.0.2.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ppio_gpus-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.5 kB
Release files / ppio_gpus-0.0.2.tar.gz
| Download URL | ppio_gpus-0.0.2.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6ff684bf81cdbc3661d7e592dccd2457d7150b0524aa6fb919f3fe57f7d2b47
|
|
BLAKE2b-256 checksum How to use checksums |
2b6e706a24222ff7f0a04fb0cb4a3c8aeac121e45e5252bc16bcdeed8244029f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ppio_gpus-0.0.2-py3-none-any.whl
| Download URL | ppio_gpus-0.0.2-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e7eb3ed1766ae099110c666fc82610d327e0cd253bf28c4c596e90744cbd5cb
|
|
BLAKE2b-256 checksum How to use checksums |
f8bec7a5bd52947b290c4171658ac03ccc9890134ccf76d7a55f95cd0decb83d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|