Zero-code auto-instrumentation for LLM applications with Pisama failure detection
Project description
pisama-auto
Zero-code auto-instrumentation for LLM applications. Add Pisama failure detection with one line.
Requires Python 3.10 or newer. Python 3.10 through 3.13 are tested.
Quick Start
pip install "pisama[auto]"
pisama[auto] is the recommended install because it keeps the CLI, local
detectors, and auto-instrumentation on one compatible dependency path.
pip install pisama-auto remains supported for applications that only need
the instrumentation layer.
import pisama_auto
pisama_auto.init() # traces locally; set PISAMA_API_KEY to export to Pisama
# 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 export is configured.
Supported Libraries
| Library | Status | What's Traced |
|---|---|---|
anthropic |
GA | messages.create(), messages.stream() |
openai |
GA | chat.completions.create() |
Package lifecycle
pisama-auto is a maintained implementation package. Its public API remains
supported, but it is not a separate product entry point. New users should
install pisama[auto]. Existing direct installations continue to work.
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 50 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
)
With an API key and no explicit endpoint, spans go to the Pisama platform (api.pisama.ai). The exporter exchanges the API key for a short-lived token automatically. Without an API key, traces are generated locally but not exported. Set PISAMA_ENDPOINT to target a self-hosted instance or a custom OTLP collector instead.
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
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.2.0.tar.gz.
File metadata
- Download URL: pisama_auto-0.2.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69db6f5b7e0c61133d03ef9ab6db3c1493801e6f9fe345cc339ac106852b7f40
|
|
| MD5 |
5dbc6b809281f10a9dc115f80f22aec0
|
|
| BLAKE2b-256 |
15cbd8a7d0604302189d08edf1d43a25316fbfc08007233d24d8b71abe1be8fc
|
Provenance
The following attestation bundles were made for pisama_auto-0.2.0.tar.gz:
Publisher:
publish.yml on Pisama-AI/pisama-auto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama_auto-0.2.0.tar.gz -
Subject digest:
69db6f5b7e0c61133d03ef9ab6db3c1493801e6f9fe345cc339ac106852b7f40 - Sigstore transparency entry: 2266869768
- Sigstore integration time:
-
Permalink:
Pisama-AI/pisama-auto@021d1fb8feb3ea9a9dd75eaf245e83e85fccf143 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Pisama-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@021d1fb8feb3ea9a9dd75eaf245e83e85fccf143 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pisama_auto-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pisama_auto-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8a876a6480cae909ebd4ce777b0bcea50f7c5d899e7aa2cc0ae56dec3d77a9d
|
|
| MD5 |
89a36bd5915339762096d66f62343199
|
|
| BLAKE2b-256 |
68d1f01717bd114c71ab6034a360590941a87f2f0a1f221b3bafb820cb265884
|
Provenance
The following attestation bundles were made for pisama_auto-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Pisama-AI/pisama-auto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama_auto-0.2.0-py3-none-any.whl -
Subject digest:
e8a876a6480cae909ebd4ce777b0bcea50f7c5d899e7aa2cc0ae56dec3d77a9d - Sigstore transparency entry: 2266869989
- Sigstore integration time:
-
Permalink:
Pisama-AI/pisama-auto@021d1fb8feb3ea9a9dd75eaf245e83e85fccf143 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Pisama-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@021d1fb8feb3ea9a9dd75eaf245e83e85fccf143 -
Trigger Event:
push
-
Statement type: