singularity-grid is the official Python client for SGL Grid. Submit inference to TEE-verified nodes, check capacity, read pricing, and verify attestation — from one package.
| PyPI | singularity-grid |
| Source | github.com/Singularity-Layer/sgl-network-sdk |
| License | MIT |
Install
Quick start
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key | None | Bearer token for authenticated endpoints |
base_url | orchestrator URL | Override the orchestrator URL |
timeout | 60.0 | Request timeout in seconds |
Submit a job + verify attestation
OpenAI-compatible usage
API reference
| Method | Auth | Description |
|---|---|---|
capacity() | No | Grid-wide capacity summary |
models() | No | Available models with pricing + TEE info |
pricing() | No | Pricing table for all models |
submit_job(model, input_payload, ...) | Yes | Submit a compute job |
get_job(job_id) | Yes | Job status + result |
get_attestation(job_id) | Yes | TEE attestation proof |
create_openai_client(api_key=...) | — | Helper returning a configured OpenAI client |
Exceptions
| Exception | When |
|---|---|
SGLError | Base class for all SDK errors |
SGLAPIError | Non-2xx response |
SGLAuthError | 401 / 403 (bad or missing key) |
SGLNotFoundError | 404 |
SGLConnectionError | Orchestrator unreachable / timeout |
