Skip to main content

PPIO GPUs SDK - Python SDK for PPIO serverless GPU endpoints

Project description

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 client
  • Endpoint.run(input) -- async submit a task, returns a Job immediately
  • Endpoint.health() -- check endpoint health
  • Endpoint.purge_queue() -- cancel all pending tasks
  • Job.status() -- get current task status
  • Job.output(timeout=0) -- get task output, optionally poll until complete
  • Job.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 update
  • ppio_gpus.upload_image(job_id, path) -- upload image to S3, returns presigned URL
  • ppio_gpus.upload_file(name, path) -- upload file to S3
  • ppio_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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppio_gpus-0.0.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppio_gpus-0.0.2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file ppio_gpus-0.0.2.tar.gz.

File metadata

  • Download URL: ppio_gpus-0.0.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for ppio_gpus-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f6ff684bf81cdbc3661d7e592dccd2457d7150b0524aa6fb919f3fe57f7d2b47
MD5 11c975e3ce495ece8001fb3bc9c6054a
BLAKE2b-256 2b6e706a24222ff7f0a04fb0cb4a3c8aeac121e45e5252bc16bcdeed8244029f

See more details on using hashes here.

File details

Details for the file ppio_gpus-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ppio_gpus-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for ppio_gpus-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e7eb3ed1766ae099110c666fc82610d327e0cd253bf28c4c596e90744cbd5cb
MD5 2449b24debf0676a8c80a34595e9d730
BLAKE2b-256 f8bec7a5bd52947b290c4171658ac03ccc9890134ccf76d7a55f95cd0decb83d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page