Syntropy AI Observability SDK for Python — trace, guard, and govern your AI agents.
Project description
Syntropy Python SDK
Trace, guard, and govern your AI agents with zero-effort integration.
Installation
pip install syntropy-ai
Quick Start
from syntropy import Syntropy
client = Syntropy(
api_key="syn_your_key_here",
base_url="https://ingest.syntropy.dev",
agent_id="my-agent",
)
# Trace an LLM call (buffered, non-blocking)
client.trace(
prompt="What is the capital of France?",
response="The capital of France is Paris.",
model="gpt-4o",
tokens_in=12,
tokens_out=8,
latency_ms=340,
)
# Synchronous trace (blocks until confirmed)
result = client.trace_sync(
prompt="Hello",
response="Hi there!",
model="gpt-4o-mini",
)
print(result.success, result.trace_id)
OpenAI Integration
Auto-trace all chat.completions.create() calls:
import openai
from syntropy import Syntropy
from syntropy.integrations.openai import wrap_openai
syn = Syntropy(api_key="syn_...", agent_id="my-agent")
client = wrap_openai(openai.OpenAI(), syntropy=syn)
# This call is now auto-traced — no code changes needed:
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
Async Support
from syntropy.client import AsyncSyntropy
async def main():
client = AsyncSyntropy(
api_key="syn_...",
base_url="https://ingest.syntropy.dev",
agent_id="my-agent",
)
result = await client.trace(
prompt="Hello",
response="Hi!",
model="gpt-4o",
)
print(result.success)
await client.close()
Batch Tracing
client.trace_batch([
{"agent_id": "agent-1", "prompt": "Q1", "response": "A1", "model": "gpt-4o"},
{"agent_id": "agent-2", "prompt": "Q2", "response": "A2", "model": "gpt-4o"},
])
Configuration
| Option | Default | Description |
|---|---|---|
api_key |
required | Your Syntropy API key |
base_url |
http://localhost:4000 |
Ingestion service URL |
agent_id |
"" |
Default agent ID |
flush_interval |
2.0 |
Seconds between buffer flushes |
batch_size |
50 |
Max traces per batch |
max_queue_size |
10000 |
Max buffered traces |
enabled |
True |
Set False to disable tracing |
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
syntropy_ai-0.1.0.tar.gz
(18.2 kB
view details)
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 syntropy_ai-0.1.0.tar.gz.
File metadata
- Download URL: syntropy_ai-0.1.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ed9c4aba651fcab60af6a7cb6aa66861fa85e7366f824f55f577fd87f50d33
|
|
| MD5 |
5d90d04abaad3c1e6e57e2b945bfec6f
|
|
| BLAKE2b-256 |
d0f41d005454cc0294c869681abc692dbb1986e384f4e425312b88c6bacb47e0
|
File details
Details for the file syntropy_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: syntropy_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dc39a455980d88fb97853fd184e5c69bcfa759fedf2a5e1a978f8cf3471b81f
|
|
| MD5 |
b88544ec7ea621f79f181cd4af747953
|
|
| BLAKE2b-256 |
5e2c3325248425041e5c60e27e8d942746540c5da71c94892b48d732d91cc14d
|