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.1.tar.gz (15.7 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.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppio_gpus-0.0.1.tar.gz
  • Upload date:
  • Size: 15.7 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.1.tar.gz
Algorithm Hash digest
SHA256 def82f248364f86e869c5f1f970c566050f6a8793204b41055662bfcc29fd894
MD5 a8df3d423f3bc18808038605ec34a094
BLAKE2b-256 0ef9b92e4194dc3c667b88f014efd0b4c59b4f593ba7d1b02e2e56aca75cb51b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppio_gpus-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6be0330e1cac227fd05add18d9a55da083f7ed618caffc210d8ecd0d91805d70
MD5 8bd56c1e5ddaea53b5b009252f03de8a
BLAKE2b-256 eec60a24d7a9476ab3a7ce0dc3e47572f8c84cb25c9c7bcbc80e844702c418d3

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