pydo.inference package
Subpackages
Module contents
Inference-focused entry point: from pydo.inference import Client.
This namespace gives serverless-inference and agent-inference callers a
purpose-built Client that mirrors the conventions used by other
LLM SDKs (Client(token=...) / Client(api_key=...)) while staying
fully integrated with pydo — the same authentication, transport
pipeline, retry, logging and response wrappers are reused under the hood.
The list of top-level namespaces exposed on this client
(chat, models, embeddings, images, responses,
batches, audio, speech, files, agent …) is derived
from the OpenAPI spec at code-generation time, so any inference endpoint
added to the spec in the future surfaces here automatically — no manual
edits to this module are required.
Example:
import os
from pydo.inference import Client
client = Client(token=os.environ["DIGITALOCEAN_TOKEN"])
resp = client.chat.completions.create(
model="llama3.3-70b-instruct",
messages=[{"role": "user", "content": "Hello!"}],
)
- class pydo.inference.Client(token: Optional[str] = None, *, api_key: Optional[str] = None, timeout: int = 120, inference_endpoint: str = 'https://inference.do-ai.run', agent_endpoint: str = '', **kwargs)
Bases:
ClientInference-focused DigitalOcean Python client.
A drop-in entry point under
pydo.inferencefor callers whose workload is serverless inference (chat completions, embeddings, image / audio generation, batch inference, agent inference, …).Inherits the full
pydo.Clientmachinery — authentication, transport pipeline, multi-base-URL routing and SSE streaming — so every inference surface that works onpydo.Clientalso works here. The top-level attribute surface, however, is narrowed to the inference and agent-inference namespaces so editor autocomplete (anddir(client)) stay focused on inference primitives.