Skip to main content

OpenGPU SDK for distributed AI task deployment

Project description

🧠 OpenGPU SDK

Welcome to the edge of distributed AI.

The ogpu.service SDK lets you write task handlers that will run on remote provider machines — not your laptop.
You define what your task expects and does, and we handle the wiring, serving, and background magic.

✨ Write your task. 🛰️ Deploy it. ⚡️ Let the network run it.


🚀 What is this?

This SDK is used by client developers to write Python tasks (as functions) that will be deployed and executed on OpenGPU network providers.

Your code will:

  • Accept inputs (Pydantic model)
  • Process them inside a registered task handler
  • Expose a /run/{task}/{task_address} endpoint via FastAPI
  • Be served by remote compute

🧪 Example: Your First Task

import ogpu.service
from pydantic import BaseModel

class MultiplyInput(BaseModel):
    a: int
    b: int

class MultiplyOutput(BaseModel):
    result: int

@ogpu.service.expose()
def multiply(data: MultiplyInput) -> MultiplyOutput:
    ogpu.service.logger.info(f"🧮 Starting multiplication: {data.a} * {data.b}")
    result = data.a * data.b
    ogpu.service.logger.info(f"✅ Result computed: {result}")
    return MultiplyOutput(result=result)

ogpu.service.start()

That's it. This exposes an endpoint at:

POST /run/multiply/{task_address}

With body:

{
  "a": 5,
  "b": 7
}

📡 How It Works

  • @expose(): Marks your function as a task handler.
  • start(): Starts a FastAPI server that awaits tasks.
  • Your task runs in a background thread.
  • The result is logged, not returned over HTTP.

📚 Documentation

Complete documentation is available at: https://opengpu-network.github.io/sdk-ogpu-py/


🧙 Guidelines

  • Your task handler must accept one pydantic.BaseModel input
  • It must return another pydantic.BaseModel
  • Task (function) names must be unique
  • Output will be logged to the console — keep it clean 💅

🤝 Made for the OpenGPU Network

Unleash your code. Let the grid handle the rest.

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

ogpu-0.2.0.15.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

ogpu-0.2.0.15-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file ogpu-0.2.0.15.tar.gz.

File metadata

  • Download URL: ogpu-0.2.0.15.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ogpu-0.2.0.15.tar.gz
Algorithm Hash digest
SHA256 a5c13a976cd3a8d023dc7fc6d4a4477dac9d2381cd9bb4307d5de1a9cd16b721
MD5 a44681578d91df7a271fff69ce5eccb4
BLAKE2b-256 594526d03cd735c06f926520150f2c7a1f1f787a71aa9604d8e452fc00131032

See more details on using hashes here.

File details

Details for the file ogpu-0.2.0.15-py3-none-any.whl.

File metadata

  • Download URL: ogpu-0.2.0.15-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ogpu-0.2.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 6993c427b00a3117be21ceef49d6efc7fe1d808a57074d6a0711ff848639d8a2
MD5 706b1ba565925e8fe53af75887a1de4a
BLAKE2b-256 9ef673967853b51ed27b372d63a356c02ca7db7f7983ed35bd977a1a4aa58b7d

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