VigilAgent Python SDK
Monitor, debug, and optimize your AI agents in real-time.
Installation
pip install vigilagent
Quick Start
from vigilagent import VigilAgent
# Initialize with your API key (find it in Settings)
va = VigilAgent(api_key="your-api-key")
# Log an LLM call with full message replay
va.log_event(
agent_id="customer-support-agent",
event_type="llm_call",
payload={
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AI?"},
{"role": "assistant", "content": "AI stands for Artificial Intelligence..."}
]
},
tokens_in=25,
tokens_out=150,
cost=0.002,
latency=320
)
Tracing (Group events into sessions)
# Start a trace (a group of related events)
trace = va.start_trace(
agent_id="customer-support-agent",
task_description="Summarize a 5-page PDF document"
)
# Log events within the trace
trace.log_event(
event_type="llm_call",
payload={"model": "gpt-4o", "messages": [...]},
tokens_in=500,
tokens_out=200,
cost=0.005,
latency=1200
)
trace.log_event(
event_type="tool_call",
payload={"tool_name": "web_search", "query": "latest AI news"}
)
# End the trace
trace.end(status="success")
OpenAI Auto-Instrumentation
from vigilagent import VigilAgent
from openai import OpenAI
va = VigilAgent(api_key="your-api-key")
client = OpenAI()
# Wrap your OpenAI client for automatic logging
wrapped_client = va.wrap_openai(client, agent_id="my-agent")
# Use it exactly like normal — all calls are logged automatically!
response = wrapped_client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
Features
- 📊 Real-time monitoring — Track every LLM call, tool invocation, and agent action
- 💰 Cost tracking — Know exactly how much each agent costs per call
- 🔍 Trace Replay — Step through agent execution like a debugger
- ⚡ Low overhead — Async logging, minimal latency impact
- 🔗 OpenAI integration — Auto-instrument with one line of code
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vigilagent_sdk-0.1.0.tar.gz
(7.1 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 vigilagent_sdk-0.1.0.tar.gz.
File metadata
- Download URL: vigilagent_sdk-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05cf45fa5f3aad4a221ec1a5a18d44cc437d50e6a08d3a52196be879b85824f
|
|
| MD5 |
562123e264a3c22d39fa2e89fd52ea4b
|
|
| BLAKE2b-256 |
33cc62d407f7c79730730583e3d51d8fd1098e4ec51f38190ade3a283b05fa58
|
File details
Details for the file vigilagent_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vigilagent_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6896db5de05aaadfd35f05b13d7cb412e89979de35425a48af43ba71a69933e5
|
|
| MD5 |
15e372c7bce085af75cf0153f2205ba2
|
|
| BLAKE2b-256 |
56238107c8572419a32bc49a7a334523b4b4059566bcbfef0a2351f329c9bf3e
|