aicompliant-discover v2.0.0
Enterprise-grade AI system auto-discovery SDK for Python.
v2.0.0 uses explicit wrapping (no monkey-patching, no global state mutation).
Installation
pip install aicompliant-discover
Quick Start
from aicompliant_discover import AIDiscovery
import anthropic
discovery = AIDiscovery(
api_key="dk_your_api_key",
endpoint="https://aicompliant.ai/v1/discovery/llm-usage",
)
# Wrap your Anthropic client — automatic usage tracking
client = discovery.wrap_anthropic(anthropic.Anthropic())
msg = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
# Usage automatically reported to AICompliant!
Supported Providers
Anthropic
client = discovery.wrap_anthropic(anthropic.Anthropic())
# or async:
client = discovery.wrap_anthropic(anthropic.AsyncAnthropic())
Google GenAI
model = discovery.wrap_google(genai.GenerativeModel("gemini-2.5-flash"))
response = model.generate_content("Hello")
Any Provider (generic trace)
result = discovery.trace(
"My System", "OpenAI",
lambda: openai.chat.completions.create(...),
model="gpt-4",
extract_usage=lambda r: {
"input_tokens": r.usage.prompt_tokens,
"output_tokens": r.usage.completion_tokens,
},
)
Manual Reporting
discovery.capture(
system_name="Resume Screener",
provider="Anthropic",
model="claude-sonnet-4-20250514",
input_tokens=500,
output_tokens=1500,
)
Configuration
| Parameter | Env Var | Description |
|---|---|---|
api_key |
AIC_API_KEY |
AICompliant API key |
endpoint |
AIC_ENDPOINT |
Discovery webhook URL |
system_name |
AIC_SYSTEM_NAME, SERVICE_NAME, APP_NAME |
Default system name |
flush_size |
— | Events before auto-flush (default: 50) |
flush_interval |
— | Seconds between flushes (default: 30) |
v2.0.0 Migration from v1.0.0
v1.0.0 used monkey-patching (discovery.init()). v2.0.0 uses explicit wrapping:
# v1.0.0 (deprecated)
discovery.init()
client = anthropic.Anthropic()
# v2.0.0
client = discovery.wrap_anthropic(anthropic.Anthropic())
No global state is modified. Multiple discovery instances can coexist.
Release files for aicompliant-discover 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aicompliant_discover-2.0.0.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aicompliant_discover-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / aicompliant_discover-2.0.0.tar.gz
| Download URL | aicompliant_discover-2.0.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c95181324529b5319f02b020f02c2a6b98e84a849576c2a51eeb292aef4e2ef1
|
|
BLAKE2b-256 checksum How to use checksums |
2f63125005d2bc0d14dcd9c42aebdf23852a9cbf2ab4fcb8c07a0ade728e35d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / aicompliant_discover-2.0.0-py3-none-any.whl
| Download URL | aicompliant_discover-2.0.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59b1ffb1fc703e56135a35b9855dcc742ef62210402ff4e5d4efc14f274ca9b9
|
|
BLAKE2b-256 checksum How to use checksums |
cad61e452f83e0ce572c42282e3f119195ad9b635146fa7465306563125000f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|