Current collected state Current
Observed since 21 Oct, 10:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AIGuard SDK for monitoring and logging AI model invocations
Python SDK for monitoring and logging AI model invocations with AIGuard.
pip install aiguard
Or install from source:
pip install -e /path/to/python-sdk
from aiguard import AIGuard
guard = AIGuard(api_key="your-api-key")
# Start an invocation
invocation = guard.start_invocation({
"eventId": "unique-event-123",
"event": "chat-completion",
"userId": "user-456",
"inputMessage": "Hello, how are you?",
"model": "gpt-4",
"convoId": "conversation-789",
"properties": {"temperature": 0.7}
})
# ... make your AI call ...
# End the invocation
completed = guard.end_invocation({
"eventId": "unique-event-123",
"output": "I am doing well, thank you!"
})
guard.log({
"model": "gpt-4",
"input": [{"role": "user", "content": "Hello"}],
"output": "Hi there!",
"latency": 150,
"tokens": {"prompt": 10, "completion": 5, "total": 15},
"status": "success"
})
from openai import OpenAI
from aiguard import AIGuard
guard = AIGuard(api_key="your-api-key")
client = guard.wrap_openai(OpenAI())
# All chat completion calls are now automatically logged
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
AIGuard(api_key, base_url="http://localhost:5000/api")Initialize the AIGuard client.
start_invocation(data) -> dictStart tracking an invocation. Required fields: eventId, event, userId.
end_invocation(data) -> dictEnd an invocation. Required field: eventId.
log(data) -> NoneFire-and-forget logging of a model call.
wrap_openai(client) -> clientWrap an OpenAI client for automatic logging.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 17 Dec 2025 | 3 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:db9c10c9060e72625caa1c7741c39dd58b2e164020f029e1c75803f03cfb8eaa