observra
Zero-touch tracing and gateway routing for LLM SDKs — configure once, keep writing the provider SDK's own client exactly as before.
Install
pip install observra
Configure
Only gateway_key is required — gateway_url defaults to the production gateway (https://gateway.observra.in):
import observra
observra.configure(gateway_key="obs_live_xxx")
Or via environment variable (no explicit configure() call needed):
export OBSERVRA_GATEWAY_KEY="obs_live_xxx"
Use
No wrapper client — write plain provider SDK code exactly as you already would. configure() transparently patches the SDK (Gemini) and, for every known provider host, patches httpx itself (OpenAI, Anthropic — and Gemini too, for non-SDK callers), so any request to those hosts routes through the gateway and gets traced/guardrailed, no matter which library actually made the call:
from google import genai
client = genai.Client(api_key="AIza...") # your own Gemini key, forwarded as-is
response = client.models.generate_content(
model="gemini-2.0-flash",
contents="Summarize this support ticket: ...",
)
print(response.text)
from openai import OpenAI
client = OpenAI(api_key="sk-...") # your own OpenAI key
response = client.chat.completions.create(model="gpt-4o-mini", messages=[{"role": "user", "content": "..."}])
from anthropic import Anthropic
client = Anthropic(api_key="sk-ant-...") # your own Anthropic key
response = client.messages.create(model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": "..."}])
Same for async clients, and for any framework integration that builds one of these internally — e.g. LangChain's ChatGoogleGenerativeAI routes through the gateway automatically too, no extra step. See examples/raw_http_gemini.py for the same guarantee at the raw-HTTP level — no provider SDK at all, just httpx pointed straight at Google's real endpoint.
Inside a LangChain agent — instrument() additionally traces every step (agent/chain/tool boundaries) under one trace, on top of the LLM-call-level tracing configure() already gives you:
observra.instrument()
Guardrails (PII/secret detection on prompts and responses) run on every call automatically — violations are recorded as span events (guardrail.violation), the payload itself is never blocked or altered.
See examples/ for full runnable scripts, and traces show up in your Observra dashboard's Request Flow view.
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 observra_sdk_python-0.1.6.tar.gz.
File metadata
- Download URL: observra_sdk_python-0.1.6.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5d39714d1aeeb16dad8a1d88975decbeb28d4fd10f299c935dfdb77f96a207
|
|
| MD5 |
975c7644ff5fab4da97048ba29439118
|
|
| BLAKE2b-256 |
cf6d0a527caf27e60ec63b146339c4e9d5b7a8c33c2f671cf4bb5ce599988fd0
|
Provenance
The following attestation bundles were made for observra_sdk_python-0.1.6.tar.gz:
Publisher:
publish.yml on aviasoletechnologies/observra-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
observra_sdk_python-0.1.6.tar.gz -
Subject digest:
bc5d39714d1aeeb16dad8a1d88975decbeb28d4fd10f299c935dfdb77f96a207 - Sigstore transparency entry: 2434908275
- Sigstore integration time:
-
Permalink:
aviasoletechnologies/observra-sdk-python@c99edc50565a111328060c30331accb089d9d8ab -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aviasoletechnologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c99edc50565a111328060c30331accb089d9d8ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file observra_sdk_python-0.1.6-py3-none-any.whl.
File metadata
- Download URL: observra_sdk_python-0.1.6-py3-none-any.whl
- Upload date:
- Size: 52.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4091ff7232cb502983ef24cbda91bc473f6e7d67405677fc4956cbc79c75c792
|
|
| MD5 |
1bc49f13b30888d4731291185c4c58b1
|
|
| BLAKE2b-256 |
b80eed0123ef1370b45d0ef3c2b5c928a07e7241e78179db6291165eab5c27dd
|
Provenance
The following attestation bundles were made for observra_sdk_python-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on aviasoletechnologies/observra-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
observra_sdk_python-0.1.6-py3-none-any.whl -
Subject digest:
4091ff7232cb502983ef24cbda91bc473f6e7d67405677fc4956cbc79c75c792 - Sigstore transparency entry: 2434908330
- Sigstore integration time:
-
Permalink:
aviasoletechnologies/observra-sdk-python@c99edc50565a111328060c30331accb089d9d8ab -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aviasoletechnologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c99edc50565a111328060c30331accb089d9d8ab -
Trigger Event:
push
-
Statement type: