Visceral Python SDK — runtime optimization layer for AI agents
Project description
Visceral Python SDK
visceral — runtime optimization layer for AI agents. Wrap your LLM client and
Visceral observes traffic, finds wasted work, and proves a cheaper call is safe
before making it. Fails open: if Visceral is unreachable, your agent runs exactly
as before.
Install
pip install "visceral-ai[openai]" # or [anthropic], [google], [all-providers]
Distribution name is visceral-ai; the import package is visceral.
Requires Python 3.10+.
Usage
from openai import OpenAI
from visceral import wrap
client = wrap(OpenAI(), agent_id="my-agent") # same client back, now instrumented
Authentication
You hold exactly one secret: the workspace API key (vsc_...), from your
workspace's Settings page in the dashboard (or from Visceral during
onboarding). Set it as VISCERAL_API_KEY, or pass api_key= to wrap();
set VISCERAL_BASE_URL only if self-hosting. The key both authenticates the
SDK and selects the workspace your traffic lands in — there is no separate
user or org credential. One process serves one workspace: wrap every client
in a process with the same key.
Prompt and response text never leaves your process unencrypted: content is stripped or AES-256-GCM-encrypted before export with a per-workspace encryption key the SDK fetches automatically — you never handle it — and spans that cannot be redacted are dropped, never sent.
Develop
pip install -e ".[dev]"
ruff check src/ tests/
pytest
License
Apache-2.0 — see LICENSE.
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 visceral_ai-0.1.1.tar.gz.
File metadata
- Download URL: visceral_ai-0.1.1.tar.gz
- Upload date:
- Size: 37.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abd45beca08d74e294f8a801676364438dfd6c504f3ed17581f44f67e57e2c68
|
|
| MD5 |
0d06cdb276d02483f73458790fd0bf09
|
|
| BLAKE2b-256 |
fc0c96b28c27e671072d15915861313bf8ed932b7d67cfbcffe058e8c38fd3df
|
Provenance
The following attestation bundles were made for visceral_ai-0.1.1.tar.gz:
Publisher:
publish.yml on visceral-ai/visceral-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visceral_ai-0.1.1.tar.gz -
Subject digest:
abd45beca08d74e294f8a801676364438dfd6c504f3ed17581f44f67e57e2c68 - Sigstore transparency entry: 2135116039
- Sigstore integration time:
-
Permalink:
visceral-ai/visceral-py@66bb488f6e8b39c84e823de826665fa75937af39 -
Branch / Tag:
refs/tags/sdk-v0.1.1 - Owner: https://github.com/visceral-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66bb488f6e8b39c84e823de826665fa75937af39 -
Trigger Event:
push
-
Statement type:
File details
Details for the file visceral_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: visceral_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9b7668d9e2c0a3349f8e39530a0d8855b5bee4b1e5b9501afa8e0a33f186ea
|
|
| MD5 |
a1032827fad9584c26bafdb60a2ba3be
|
|
| BLAKE2b-256 |
06edf21b634eb34eebd462f764f1275988378d301a96e412af431a0c76ba2fd6
|
Provenance
The following attestation bundles were made for visceral_ai-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on visceral-ai/visceral-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visceral_ai-0.1.1-py3-none-any.whl -
Subject digest:
2e9b7668d9e2c0a3349f8e39530a0d8855b5bee4b1e5b9501afa8e0a33f186ea - Sigstore transparency entry: 2135116067
- Sigstore integration time:
-
Permalink:
visceral-ai/visceral-py@66bb488f6e8b39c84e823de826665fa75937af39 -
Branch / Tag:
refs/tags/sdk-v0.1.1 - Owner: https://github.com/visceral-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66bb488f6e8b39c84e823de826665fa75937af39 -
Trigger Event:
push
-
Statement type: