Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Python SDK

cetra is the Python SDK for cetra, the single-binary LLM observability server. It is a thin layer over OpenTelemetry: spans go out as OTLP/HTTP protobuf to <base_url>/v1/traces, and scores go to <base_url>/api/v1/scores. Python >= 3.11. MIT.

The server stores traces only. If another OpenTelemetry GenAI instrumentation sends prompts and completions as log events, they reach /v1/logs and are dropped; the project shows a hint in the UI. Set that instrumentation to capture message content on spans.

Install

pip install cetra-sdk

Auto-instrumentation is optional, one extra per library:

instrument name Extra
openai cetra-sdk[openai]
anthropic cetra-sdk[anthropic]
langchain cetra-sdk[langchain]
llama-index cetra-sdk[llama-index]
litellm cetra-sdk[litellm]
google-genai cetra-sdk[google-genai]
bedrock cetra-sdk[bedrock]
openai-agents cetra-sdk[openai-agents]
crewai cetra-sdk[crewai]
dspy cetra-sdk[dspy]
groq cetra-sdk[groq]
mistralai cetra-sdk[mistralai]
cohere cetra-sdk[cohere]
ollama cetra-sdk[ollama]
together cetra-sdk[together]
instructor cetra-sdk[instructor]
agno cetra-sdk[agno]
smolagents cetra-sdk[smolagents]
haystack cetra-sdk[haystack]
beeai cetra-sdk[beeai]
mcp cetra-sdk[mcp]
autogen-agentchat pip install openinference-instrumentation-autogen-agentchat

The instructor and beeai distributions do not support every Python version: the instructor extra installs on Python 3.13 or earlier, and beeai on Python 3.14 or earlier.

cetra-sdk[all] installs every instrumentor that has an extra. The core package pulls in only opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp-proto-http and requests.

Quick start

import cetra

cetra.init(api_key="sk-cetra-test")


@cetra.observe(kind="tool", name="search_docs")
def search_docs(query: str, limit: int = 2) -> list[str]:
    return ["doc-1", "doc-2"]


@cetra.observe(name="answer")
def answer(question: str) -> str:
    docs = search_docs(question)
    return f"It is in {docs[0]}."


answer("why?")

cetra.flush()  # blocks until spans (and scores) are exported

init() is called once per process; it also registers an atexit hook that calls shutdown() (flush, then stop). flush() is the manual lever when you need the data out now — see Serverless.

Without an API key (argument and CETRA_API_KEY both unset), init() logs one warning — cetra: no API key; set CETRA_API_KEY, or CETRA_ENABLED=false to silence this; tracing is disabled — and the SDK runs as a no-op: nothing raises, nothing is sent. Set CETRA_ENABLED=false to silence the warning.

Documentation

The full guide and reference are at https://cetra.sh/docs/reference/python/ (configuration, tracing, context, scores, datasets and experiments, OpenTelemetry, the API).

Metadata

Release files for cetra-sdk 0.1.0rc3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cetra-sdk 0.1.0rc3
File Size Uploaded Provenance Actions
cetra_sdk-0.1.0rc3.tar.gz 64.4 kB With provenance Details for cetra_sdk-0.1.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cetra-sdk 0.1.0rc3
File Interpreter ABI Platform Actions
cetra_sdk-0.1.0rc3-py3-none-any.whl Python 3 none any Details for cetra_sdk-0.1.0rc3-py3-none-any.whl

Total release size: 138.6 kB

Release files / cetra_sdk-0.1.0rc3.tar.gz

Download URL cetra_sdk-0.1.0rc3.tar.gz
Size 64.4 kB
Tags Source
SHA-256 checksum
How to use checksums
988d35bf9e410179b4262366945b984c9333fddea9474daa41f6c94794425044
BLAKE2b-256 checksum
How to use checksums
acfb82f8315371f5d3df932e1e37d7d3b2cd787e2542cd44e0090a1c9dea85e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / cetra_sdk-0.1.0rc3-py3-none-any.whl

Download URL cetra_sdk-0.1.0rc3-py3-none-any.whl
Size 74.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
763bcfe2f26255cd6617242cbbb4df3472c676259199de76272a914e2d644cdc
BLAKE2b-256 checksum
How to use checksums
2c8a1eae9183a637f327f3e17c0064e2288fc680b0c6c91409fa572a87047241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for cetra-sdk 0.1.0rc3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cetra_sdk-0.1.0rc3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page