Skip to main content

argus-sdk

Detect when your LLM's behavior has statistically shifted — one line of code to instrument.


What it does

LLMs change. Model providers silently update weights, swap infrastructure, or adjust safety filters. Your evals pass, but production quietly drifts. Argus catches this.

argus-sdk wraps your existing Anthropic or OpenAI client and captures derived signals from every LLM call — output tokens, latency, finish reason. It ships those signals in the background to Argus, which runs statistical tests (Mann-Whitney U + Bonferroni correction) to detect distribution shifts and alerts you via Slack when drift is confirmed.

No prompt text. No completion text. Derived signals only.


Install

pip install argus-sdk

For OpenAI support:

pip install "argus-sdk[openai]"

Quick start

Cloud (argus-sdk.com)

from argus_sdk import patch
patch(api_key="argus_sk_...")  # defaults to https://argus-sdk.com

import anthropic
client = anthropic.Anthropic()  # automatically instrumented

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello"}],
)

Self-hosted

docker run -p 4000:4000 -p 3000:3000 -v argus-data:/data ghcr.io/whozpj/argus:latest
from argus_sdk import patch
patch(endpoint="http://localhost:4000")

import anthropic
client = anthropic.Anthropic()

Supported clients

Client Sync Async Streaming
anthropic.Anthropic ✓ — ✓
anthropic.AsyncAnthropic — ✓ ✓
openai.OpenAI ✓ — ✓
openai.AsyncOpenAI — ✓ ✓

Streaming calls (stream=True) are transparently intercepted — the signal is reported after the stream is exhausted. User code is unchanged.

Note: client.messages.stream() (Anthropic context manager API) is not intercepted.


Explicit mode

Instrument a specific instance instead of all future clients:

import anthropic
from argus_sdk import patch

client = anthropic.Anthropic()
patch(endpoint="https://argus-sdk.com", client=client, api_key="argus_sk_...")

Flush on exit (short scripts & CLIs)

Signals are sent in a background worker thread. For short-lived scripts:

from argus_sdk import patch, flush

patch(api_key="argus_sk_...")

# ... your LLM calls ...

flush()  # blocks until all queued events are sent

What gets captured

Field Example
model claude-sonnet-4-6
provider anthropic
input_tokens 312
output_tokens 87
latency_ms 843
finish_reason stop
timestamp_utc 2026-04-07T14:22:01Z

No prompt text. No completion text.


How drift detection works

The Argus server builds a baseline per model using Welford's online algorithm (ready after 200 events). Every 60 seconds it runs a Mann-Whitney U test on output tokens and latency against the current window. Bonferroni correction controls false positives across multiple signals. A hysteresis state machine fires alerts when drift score exceeds 0.7 and clears when it drops below 0.4 for three consecutive windows.


Self-hosted environment variables

Variable Default Description
ARGUS_ADDR :4000 Server listen address
ARGUS_DB_PATH argus.db SQLite file path (self-hosted)
ARGUS_SLACK_WEBHOOK (empty) Slack webhook URL for alerts

License

MIT

Metadata

Release files for argus-sdk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argus-sdk 0.2.1
File Size Uploaded Provenance
argus_sdk-0.2.1.tar.gz 14.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for argus-sdk 0.2.1
File Interpreter ABI Platform
argus_sdk-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / argus_sdk-0.2.1.tar.gz

Download URL argus_sdk-0.2.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
30cbe0e1ae3a4e907a1a98b947bc1ad3f46f3b2e6c9279405d24dc19619e0c02
BLAKE2b-256 checksum
How to use checksums
f12877ca64fd77a11692c0eef26645b6f060136a1beb7362fe78f87b0aab9ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / argus_sdk-0.2.1-py3-none-any.whl

Download URL argus_sdk-0.2.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eb30a8a97313cd381822ef1fcc45c050c831c9797bbd6ba4153da26b0af17d6
BLAKE2b-256 checksum
How to use checksums
821ed2244e6bb1b8a0a41743c5d75305680bd49b2f0d33a12c30d0463e94842f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for argus-sdk 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page