Python SDK for Prosperus LLM Observability
Project description
Prosperus Python SDK
Instrument your LLM applications with traces, spans, evaluations, and metrics.
Install with:
pip install prosperus
# or
uv add prosperus
The distribution name and the Python import package are both prosperus.
Quick Start
from prosperus import Prosperus, llm, workflow
ph = Prosperus(
api_key="ph-...",
app_name="my-chatbot",
endpoint="http://localhost:4100", # use your local server during development
)
ph.enable()
@workflow
def handle_request(user_msg: str) -> str:
return call_model(user_msg)
@llm(model_name="gpt-5.4", model_provider="openai")
def call_model(prompt: str) -> str:
reply = f"Echo: {prompt}"
Prosperus.annotate(
input_data=[{"role": "user", "content": prompt}],
output_data=[{"role": "assistant", "content": reply}],
metrics={"input_tokens": 5, "output_tokens": 7},
)
return reply
print(handle_request("Hello"))
ph.shutdown()
Development
cd packages/sdk-python
uv sync
uv run pytest
uv run ruff check src/
uv run mypy src/
Configuration
| Parameter | Type | Description |
|---|---|---|
api_key |
str |
API key for authentication |
app_name |
str |
Application identifier used to group traces |
endpoint |
str |
Prosperus ingest endpoint. Defaults to https://ingest.prosperus.dev |
flush_interval |
float |
Seconds between background flush attempts |
span_processor |
Callable[[SpanData], SpanData | None] | None |
Optional processor for redaction or filtering before export |
What You Can Import
The top-level package re-exports the most common SDK entry points:
from prosperus import Prosperus, llm, workflow, tool, SpanKind, SpanContext
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prosperus-0.1.0.tar.gz.
File metadata
- Download URL: prosperus-0.1.0.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
944a4ab3f8671a7f5b0011bb967815662aa1f4e18af5ca1838074fa1ea394519
|
|
| MD5 |
cf98d683133fde650aeb1fa062826bee
|
|
| BLAKE2b-256 |
42438927700d3d889228a76f806ea9bc4838970651c20042d11f5862ea4d7f29
|
Provenance
The following attestation bundles were made for prosperus-0.1.0.tar.gz:
Publisher:
publish-sdk-python.yml on LatencyTDH/prosperus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prosperus-0.1.0.tar.gz -
Subject digest:
944a4ab3f8671a7f5b0011bb967815662aa1f4e18af5ca1838074fa1ea394519 - Sigstore transparency entry: 1282676213
- Sigstore integration time:
-
Permalink:
LatencyTDH/prosperus@82a8f90490a9df3d8ad039cd1e8e8022a46b1d3b -
Branch / Tag:
refs/tags/sdk-python-v0.1.0 - Owner: https://github.com/LatencyTDH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@82a8f90490a9df3d8ad039cd1e8e8022a46b1d3b -
Trigger Event:
push
-
Statement type:
File details
Details for the file prosperus-0.1.0-py3-none-any.whl.
File metadata
- Download URL: prosperus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
502853d463ceb2da2da847db271f2147d40133cd9118bfa30bc643db674b87bb
|
|
| MD5 |
287a5e5288b43655de98f17fa2ae7152
|
|
| BLAKE2b-256 |
bde77bf78055b5a6d65ce19e7ef584389b8c3ae3f26aacb73e628bf484ce9741
|
Provenance
The following attestation bundles were made for prosperus-0.1.0-py3-none-any.whl:
Publisher:
publish-sdk-python.yml on LatencyTDH/prosperus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prosperus-0.1.0-py3-none-any.whl -
Subject digest:
502853d463ceb2da2da847db271f2147d40133cd9118bfa30bc643db674b87bb - Sigstore transparency entry: 1282676240
- Sigstore integration time:
-
Permalink:
LatencyTDH/prosperus@82a8f90490a9df3d8ad039cd1e8e8022a46b1d3b -
Branch / Tag:
refs/tags/sdk-python-v0.1.0 - Owner: https://github.com/LatencyTDH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@82a8f90490a9df3d8ad039cd1e8e8022a46b1d3b -
Trigger Event:
push
-
Statement type: