Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prosperus-0.1.0.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

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

prosperus-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

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

Hashes for prosperus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 944a4ab3f8671a7f5b0011bb967815662aa1f4e18af5ca1838074fa1ea394519
MD5 cf98d683133fde650aeb1fa062826bee
BLAKE2b-256 42438927700d3d889228a76f806ea9bc4838970651c20042d11f5862ea4d7f29

See more details on using hashes here.

Provenance

The following attestation bundles were made for prosperus-0.1.0.tar.gz:

Publisher: publish-sdk-python.yml on LatencyTDH/prosperus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for prosperus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 502853d463ceb2da2da847db271f2147d40133cd9118bfa30bc643db674b87bb
MD5 287a5e5288b43655de98f17fa2ae7152
BLAKE2b-256 bde77bf78055b5a6d65ce19e7ef584389b8c3ae3f26aacb73e628bf484ce9741

See more details on using hashes here.

Provenance

The following attestation bundles were made for prosperus-0.1.0-py3-none-any.whl:

Publisher: publish-sdk-python.yml on LatencyTDH/prosperus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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