Solti Python SDK
Python SDK for the Solti Platform — schedule and run asynchronous workloads without managing infrastructure.
Package: solti-sdk · Import: solti · License: MIT
Installation
Using uv:
uv add solti-sdk
Using pip:
pip install solti-sdk
The package is published on PyPI.
Prefer pip/uv's default index — no extra index URLs or credentials are
needed.
Quickstart
from solti import SoltiClient
from solti.exceptions import WorkloadFailedError, TimeoutError
# api_key falls back to the SOLTI_API_KEY environment variable.
# Project selection uses the X-Solti-Project-Id header (project_id arg or SOLTI_PROJECT_ID env).
client = SoltiClient(api_key="eyJhbGciOi...", api_url="https://api.solti.run/1", project_id="proj-...")
# 1. Define and submit the workload
job = client.jobs.create(
name="pytorch-train-epoch-50", # or name_prefix="train-epoch-"
image="pytorch/pytorch:2.2.1-cuda12.1-cudnn8-runtime",
command=["python3"],
args=["train.py", "--epochs", "50"],
env={"TORCH_OMP_NUM_THREADS": "8"},
volumes={ # map keyed by volume name
"datasets": {
"bucket": "ml-training-artifacts",
"mountPath": "/mnt/s3",
"connection": "my-aws-s3", # optional
"prefix": "checkpoints", # optional
}
},
resources={"cpu": 8, "memory": "32Gi", "gpu": "24Gi"}, # gpu shorthand for {"vram": "24Gi"}
cloud=["aws", "gcp"],
region="americas",
max_retries=3,
labels={"environment": "production", "team": "ml"},
tags=["pytorch", "training"],
)
print(f"Submitted Job: {job.name} ({job.id}) — {job.status}")
try:
# 2. Block and poll progress (default poll interval 10s)
final_job = job.wait_until_complete(timeout_seconds=7200)
print(f"Succeeded! Actual cost: ${final_job.actual_cost}")
except WorkloadFailedError as e:
print(f"Workload failed with exit code {e.exit_code}\n{e.error_summary}")
except TimeoutError:
client.jobs.cancel(job.id)
Connections, Cronjobs & Keys
client.connections.list()
client.connections.get("my-aws-s3")
client.connections.create(name="new-s3", type="aws", credentials={
"access_key_id": "AKIA...", "secret_access_key": "wJal...", "region": "us-east-1",
})
client.connections.delete("old-connection")
cron = client.cronjobs.create(
name="nightly-backup",
cron_spec="0 2 * * *", # UTC
job_definition={"image": "alpine:latest", "command": ["echo", "backup complete"]},
)
client.cronjobs.get(cron.id) # or client.cronjobs.get("nightly-backup")
client.cronjobs.patch("nightly-backup", is_active=False)
client.cronjobs.delete("nightly-backup")
client.keys.list()
client.keys.create(name="ci", role="editor")
client.keys.delete("ci")
Error handling
HTTP errors map to typed exceptions (solti.exceptions):
| Exception | HTTP | Notes |
|---|---|---|
AuthenticationError |
401 | Invalid or expired API key. |
PermissionDeniedError |
403 | Key role lacks access (e.g. viewer on a write). |
NotFoundError |
404 | Unknown job / connection / cronjob / key. |
ConflictError |
409 | Duplicate resource name. |
ValidationError |
422 | Malformed payload (invalid cron expression, bad volume, …). |
RateLimitError |
429 | Exposes retry_after (seconds) and the X-RateLimit-* headers. |
WorkloadFailedError |
— | Raised by wait_until_complete; carries exit_code, error_summary, oom. |
TimeoutError |
— | Client-side wait timeout in wait_until_complete (also a builtin.TimeoutError). |
All exceptions derive from SoltiError, which exposes status, payload and headers.
Rate-limit retry policy: idempotent reads (GET)
auto-retry up to 2 times honoring the Retry-After header (default 5s, capped at 30s).
Mutations surface RateLimitError to the caller immediately.
Host strategy
The SDK targets the global API host (https://api.solti.run/1) and selects
the project via the X-Solti-Project-Id header.
License
MIT — see LICENSE.
Development
uv sync
uv run pytest
uv run ruff check .
uv build
Metadata
Release files for solti-sdk 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| solti_sdk-0.1.2.tar.gz | 34.5 MB | Without provenance | Details for solti_sdk-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| solti_sdk-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for solti_sdk-0.1.2-py3-none-any.whl |
Total release size: 34.5 MB
Release files / solti_sdk-0.1.2.tar.gz
| Download URL | solti_sdk-0.1.2.tar.gz |
|---|---|
| Size | 34.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f25126f4f1e2cb6311abec92cd00149d44b040d2245ad0133d12406e2c10d09a
|
|
BLAKE2b-256 checksum How to use checksums |
7ab5e58071678656b4f9903503d8f578ce01e7d8078e0faa2a4e4c4cb376ea0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.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}
|
Release files / solti_sdk-0.1.2-py3-none-any.whl
| Download URL | solti_sdk-0.1.2-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
699dda90d74897e0511916f51dddee806b94201bcd3d4ca7bfa77c3e7e148384
|
|
BLAKE2b-256 checksum How to use checksums |
4a72354d2422d4a7a3c22717a67002e304d3981eab5716d6984fd5c40d2b1b5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.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}
|
Security for solti-sdk 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.