Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visceral_ai-0.2.0.tar.gz (82.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visceral_ai-0.2.0-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

Details for the file visceral_ai-0.2.0.tar.gz.

File metadata

  • Download URL: visceral_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 82.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for visceral_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d11ad77818f22a6d23a43e88863ffa3497108e5ff33041a10addebaa72f05632
MD5 4610f6798ec1d5dec358b65d6eafd2f3
BLAKE2b-256 184700c619adb8d976d37e2d59afcf5df40521cd1e3c2d829a84bc95c908b911

See more details on using hashes here.

Provenance

The following attestation bundles were made for visceral_ai-0.2.0.tar.gz:

Publisher: publish.yml on visceral-ai/visceral-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file visceral_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: visceral_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 53.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for visceral_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91e256e8cbfaeb6c234f32f66b63b0a574e8bb590c3d637b38220586e90cd073
MD5 5808f54b89d4867326f8420b881a3979
BLAKE2b-256 8a27e1f8b526272408bcfa1940c45868b7600a5c86863f5b5ccbc5fff7e0ab79

See more details on using hashes here.

Provenance

The following attestation bundles were made for visceral_ai-0.2.0-py3-none-any.whl:

Publisher: publish.yml on visceral-ai/visceral-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page