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]

cetra-sdk[all] installs every instrumentor. 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.0rc2

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.0rc2
File Size Uploaded Provenance Actions
cetra_sdk-0.1.0rc2.tar.gz 61.5 kB With provenance Details for cetra_sdk-0.1.0rc2.tar.gz

Built distribution (wheel)

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

Total release size: 132.8 kB

Release files / cetra_sdk-0.1.0rc2.tar.gz

Download URL cetra_sdk-0.1.0rc2.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
055496c3d3881de473e1aead29f0c343b32b496329bc24dfa2d2dcf529dacea2
BLAKE2b-256 checksum
How to use checksums
41ebddbab6149f9b4084ba76c5598c77765e86d7ab3822005d3cd5246067a21f
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 22, 2026.

Transparency log

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

Download URL cetra_sdk-0.1.0rc2-py3-none-any.whl
Size 71.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ddda46e313f741e8fc0516ae2bac2c4ce775a4780b6b69ca0e8830080e78531
BLAKE2b-256 checksum
How to use checksums
5d3075388b9843d1eedc2fc17549969d4c87e97ffb894482706acd4813e140ea
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 22, 2026.

Transparency log

Security for cetra-sdk 0.1.0rc2

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.0rc2.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 22, 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