Zero-code auto-instrumentation for LLM applications — adds Pisama failure detection with one line
Project description
pisama-auto
Zero-code auto-instrumentation for LLM applications. Add Pisama failure detection with one line.
Quick Start
pip install pisama-auto
import pisama_auto
pisama_auto.init() # traces locally; set PISAMA_API_KEY + PISAMA_ENDPOINT to export
# All subsequent LLM calls are automatically traced
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
# ^ This call is automatically traced (and sent to Pisama if endpoint is configured)
Supported Libraries
| Library | Status | What's Traced |
|---|---|---|
anthropic |
GA | messages.create(), messages.stream() |
openai |
GA | chat.completions.create() |
How It Works
pisama_auto.init()sets up an OpenTelemetry tracer that exports to Pisama- It then patches supported LLM libraries to emit spans with
gen_ai.*semantic conventions - Pisama's detection engine analyzes the traces for 44 failure modes
- Results appear in your Pisama dashboard
Configuration
pisama_auto.init(
api_key="ps_...", # or set PISAMA_API_KEY env var
endpoint="https://your-instance/api/v1/traces/ingest", # or PISAMA_ENDPOINT env var
service_name="my-agent", # OTEL service name
auto_patch=True, # auto-patch all detected libraries
)
Without an endpoint, traces are generated locally but not exported. Set PISAMA_ENDPOINT to send them to the Pisama platform.
Selective Patching
import pisama_auto
pisama_auto.init(auto_patch=False) # don't auto-patch
from pisama_auto.patches import patch
patch("anthropic") # only patch anthropic
Project details
Release history Release notifications | RSS feed
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 pisama_auto-0.1.0.tar.gz.
File metadata
- Download URL: pisama_auto-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cda88582c35f3894a9340c6d33162402805cbeade92335d085f4182a84c825a
|
|
| MD5 |
ae48c4cb1d76341613de98956a56694e
|
|
| BLAKE2b-256 |
e9c0effa0ae3c7edac22864fd5ad03f72b324ea25e36f557413884f9bd5276de
|
Provenance
The following attestation bundles were made for pisama_auto-0.1.0.tar.gz:
Publisher:
publish.yml on tn-pisama/pisama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama_auto-0.1.0.tar.gz -
Subject digest:
3cda88582c35f3894a9340c6d33162402805cbeade92335d085f4182a84c825a - Sigstore transparency entry: 1265012766
- Sigstore integration time:
-
Permalink:
tn-pisama/pisama@d88f7e1d75419c36d911128fce3a3480196b27fd -
Branch / Tag:
refs/tags/pisama-auto-v0.1.0 - Owner: https://github.com/tn-pisama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d88f7e1d75419c36d911128fce3a3480196b27fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file pisama_auto-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pisama_auto-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c15b2d46ccc34880dafd010e7b23a59fdb228e3ba43ba61154a4e629f4acfe4d
|
|
| MD5 |
942a7afb3aa86bf546d8b37962d259ed
|
|
| BLAKE2b-256 |
7e1fdddd64e288f769a2b35e5a8836c9e058ae6b8b4f5d3e321e13695884d42e
|
Provenance
The following attestation bundles were made for pisama_auto-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tn-pisama/pisama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama_auto-0.1.0-py3-none-any.whl -
Subject digest:
c15b2d46ccc34880dafd010e7b23a59fdb228e3ba43ba61154a4e629f4acfe4d - Sigstore transparency entry: 1265012812
- Sigstore integration time:
-
Permalink:
tn-pisama/pisama@d88f7e1d75419c36d911128fce3a3480196b27fd -
Branch / Tag:
refs/tags/pisama-auto-v0.1.0 - Owner: https://github.com/tn-pisama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d88f7e1d75419c36d911128fce3a3480196b27fd -
Trigger Event:
push
-
Statement type: