Skip to main content

AgentAudit

PyPI Python License GitHub Stars

Open source evaluation toolkit for LLM pipelines and AI agents.

Hallucination detection · Faithfulness scoring · Cost tracking Latency logging · Regression testing · Agent trace viewer

Self-hostable · No SaaS · No login · No data leaving your machine

pip install auditlm
agentaudit init
agentaudit dashboard

Why AgentAudit?

32% of AI teams cite quality as their #1 barrier to production. Most teams ship prompts blindly or debug with print statements.

AgentAudit gives you a proper evaluation layer:

  • Hallucination detection — did the model make up something not in the source?
  • Faithfulness scoring — did the model contradict the retrieved context?
  • Cost tracking — how much does each query cost in USD and INR?
  • Latency logging — how slow is each step?
  • Regression testing — did my last prompt change make things better or worse?
  • Agent trace viewer — which tools did the agent call, in what order?

Quick Start

1. Install

pip install auditlm

2. Setup (one time)

agentaudit init

Walks you through picking a provider (Gemini or OpenAI), pasting your API key, and choosing a judge model. Config saved locally at ~/.agentaudit/.env.

3. Add to your pipeline

Before:

def answer_question(query):
    docs = retriever.search(query)
    return llm.generate(query, docs)

After — 3 lines added:

from agentaudit import audit, set_context          # line 1

@audit(name="my_pipeline")                          # line 2
def answer_question(query):
    docs = retriever.search(query)
    set_context(docs)                                # line 3
    return llm.generate(query, docs)

Your code works exactly the same. AgentAudit silently evaluates every run.

4. See results

agentaudit dashboard

Opens a local dashboard at localhost:8501 with four pages: Overview · Run Details · Trends · Regression


Zero-code starter

agentaudit example

Creates my_pipeline.py with clear TODO markers. Replace two lines, run it, done.


CLI

Command What it does
agentaudit init First-time setup
agentaudit dashboard Open Streamlit dashboard
agentaudit compare --pipeline NAME Compare last two runs
agentaudit config --show Show current config
agentaudit config --reset Update API key or model
agentaudit example Generate starter file

How it works

AgentAudit uses LLM-as-judge — sends your pipeline's output and context to a judge model (Gemini Flash by default) and asks:

"Extract every claim. For each, is it supported by the context?"

The judge returns claims with verdicts (SUPPORTED / UNSUPPORTED / CONTRADICTED) and AgentAudit calculates:

hallucination_score = unsupported claims / total claims

Everything saved to local SQLite. Nothing leaves your machine.


Exact cost tracking (optional)

By default, AgentAudit estimates tokens from text length. For exact cost, add one line:

from agentaudit import set_tokens

set_tokens(
    input=response.usage.prompt_tokens,
    output=response.usage.completion_tokens,
)

Dashboard labels costs as estimated or exact.


Agent tracing

from agentaudit import AgentTracer

with AgentTracer("my_agent") as tracer:
    result = search_tool(query)
    tracer.log_tool_call("search", input=query, output=result)
    tracer.log_response(answer)

Supported judge models

Google Gemini (free tier available): gemini-flash-latest · gemini-3.5-flash · gemini-3-flash · gemini-3.1-pro

OpenAI: gpt-4o-mini · gpt-4o

Custom models: add_model_pricing("model", input_per_1k, output_per_1k)


Tech stack

Python · SQLite · Streamlit · LLM-as-judge · pyproject.toml


Contributing

PRs welcome. Open an issue for bugs or feature requests.

License

MIT

Metadata

Release files for auditlm 0.1.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 auditlm 0.1.1
File Size Uploaded Provenance
auditlm-0.1.1.tar.gz 32.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for auditlm 0.1.1
File Interpreter ABI Platform
auditlm-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 69.1 kB

Release files / auditlm-0.1.1.tar.gz

Download URL auditlm-0.1.1.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4a0993e6dfabdaca85a0014839e61afce67cf81b376f5ac7b0361da20f54e389
BLAKE2b-256 checksum
How to use checksums
86b8c0365ebbaecd697ee811a60c400ed1d560f4a6fe0ae2b72a4d0dafc50ba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / auditlm-0.1.1-py3-none-any.whl

Download URL auditlm-0.1.1-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6921aeb9674a872b7de9004c958be455c1cabf5ab10920cf91e9243f9b8c8066
BLAKE2b-256 checksum
How to use checksums
aac205e25553cfeb767e7a6574c48e605bd757fc1da8299bb6587431786e9a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for auditlm 0.1.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