From 2b1594b8608ef22070bca2ce6a4245d9066da055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Andr=C3=A9=20Marques?= <32335502+jagmarques@users.noreply.github.com> Date: Wed, 8 Apr 2026 10:24:06 +0200 Subject: [PATCH] docs: add asqav signed audit trail callback integration --- .../docs/observability/asqav_integration.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 docs/my-website/docs/observability/asqav_integration.md diff --git a/docs/my-website/docs/observability/asqav_integration.md b/docs/my-website/docs/observability/asqav_integration.md new file mode 100644 index 00000000000..8ad2cb97bfc --- /dev/null +++ b/docs/my-website/docs/observability/asqav_integration.md @@ -0,0 +1,126 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Asqav - Signed Audit Trail & AI Governance + +[Asqav](https://asqav.com/) provides cryptographically signed audit trails and governance for AI applications. Every LLM call is logged with a tamper-evident signature, giving compliance teams verifiable records of model inputs, outputs, and metadata. + +**Key Features:** + +- **Signed audit logs** - Every call produces a cryptographically signed record, verifiable offline +- **Governance callbacks** - Hook into LiteLLM's callback system with zero changes to your inference code +- **Compliance-ready exports** - Structured logs compatible with SOC 2, ISO 27001, and EU AI Act requirements +- **Model and cost tracking** - Token usage, latency, and cost captured per request + +:::tip + +This is community maintained. Please make an issue if you run into a bug: +https://github.com/BerriAI/litellm + +::: + +## Pre-Requisites + +```bash +pip install "asqav[litellm]" +``` + +Get your API key from [app.asqav.com](https://app.asqav.com/). + +## Quick Start + + + + +```python +import os +import litellm +from asqav.extras.litellm import AsqavGuardrail + +os.environ["ASQAV_API_KEY"] = "your-asqav-api-key" +os.environ["OPENAI_API_KEY"] = "your-openai-api-key" + +# Register the Asqav callback +asqav_handler = AsqavGuardrail() +litellm.callbacks = [asqav_handler] + +response = litellm.completion( + model="gpt-4o-mini", + messages=[{"role": "user", "content": "Summarize the EU AI Act."}], +) + +print(response) +``` + +Every call is logged to Asqav with a signed audit record. No other changes to your code are needed. + + + + +### 1. Install the package on the proxy server + +```bash +pip install "asqav[litellm]" +``` + +### 2. Add Asqav to your `config.yaml` + +```yaml +model_list: + - model_name: gpt-4o-mini + litellm_params: + model: openai/gpt-4o-mini + api_key: os.environ/OPENAI_API_KEY + +litellm_settings: + callbacks: ["asqav.extras.litellm.AsqavGuardrail"] + +general_settings: + master_key: "sk-1234" + +environment_variables: + ASQAV_API_KEY: "your-asqav-api-key" +``` + +### 3. Start the proxy + +```bash +litellm --config config.yaml +``` + +### 4. Test it + +```bash +curl -X POST 'http://0.0.0.0:4000/chat/completions' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer sk-1234' \ + -d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello"}]}' +``` + +Signed audit records appear immediately in your [Asqav dashboard](https://app.asqav.com/). + + + + +## Environment Variables + +| Variable | Description | +| ---------------- | -------------------------------------------- | +| `ASQAV_API_KEY` | Your Asqav API key for authentication | + +## What Gets Logged? + +The [LiteLLM Standard Logging Payload](https://docs.litellm.ai/docs/proxy/logging_spec) is captured on each successful LLM API call, including: + +- Request messages and model parameters +- Response content and finish reason +- Token usage and cost +- Latency metrics +- A cryptographic signature over the full record + +Records are retrievable and verifiable via the Asqav API or dashboard. + +## Support + +- Docs: [docs.asqav.com](https://docs.asqav.com/) +- Issues: [github.com/asqav/asqav-sdk](https://github.com/asqav/asqav-sdk/issues)