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.0rc1

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

Built distribution (wheel)

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

Total release size: 132.8 kB

Release files / cetra_sdk-0.1.0rc1.tar.gz

Download URL cetra_sdk-0.1.0rc1.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
37bca1dea107eff9c97db0d55ce523af4c814324edb58e05ac20b7c461a36cf1
BLAKE2b-256 checksum
How to use checksums
ade1bcaf6c3beaa1dea9fe5a668b63b038062454513f55424f07884040bc5e52
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 21, 2026.

Transparency log

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

Download URL cetra_sdk-0.1.0rc1-py3-none-any.whl
Size 71.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f86ef75f6184b3064ab33bd2fb8a6ee2b457bab442cec98091829acf778789ab
BLAKE2b-256 checksum
How to use checksums
527e7bd41de166667c8d2659276d713168a80d02cde5e5a8de5395f8d3f333c3
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 21, 2026.

Transparency log

Security for cetra-sdk 0.1.0rc1

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.0rc1.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 21, 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