Behavioral evaluation framework for non-deterministic AI agents
Project description
EntroPy
Behavioral evaluation framework for non-deterministic AI agents.
Measures what other frameworks miss: uncertainty, drift, stochastic behavior, and emergent failures — via Monte Carlo evaluation over repeated runs and entropy-based metrics. Framework-agnostic, local-first, zero vendor lock-in.
Install
pip install -e . # core (pandas, matplotlib, jinja2, rich, pyyaml)
pip install "entropy-ai[langchain]" # optional: a framework adapter
pip install "entropy-ai[pdf,jupyter]" # optional: PDF / Jupyter reports
Quick start
from entropy import Suite, Dataset, Case
def my_agent(inp): ...
# return an output, an AgentRun, or a dict with events
dataset = Dataset([Case(input="q1", expected="correct answer")])
results = Suite(seed=42).run(my_agent, dataset, trials=100)
print(results) # success_rate, behavioral_entropy, drift_score, ...
The canonical output (spec §9 / §21) includes: success_rate, reliability,
variance, robustness, entropy, confidence_interval, behavioral_entropy,
behavioral_variance, trajectory_entropy, trajectory_diversity, tool_reliability,
drift_score, goal_stability, recovery_score, emergent_behavior, and more.
56 metrics total; entropy.default_metrics() lists the canonical set.
Tracing
from entropy import trace, event, instrument
with trace() as t:
event("action", "tool:search")
# or auto-wrap any agent:
wrapped = instrument(my_agent) # returns an AgentRun per call
Custom metrics (plugin system)
from entropy import metric
@metric("my_metric")
class MyMetric:
def compute(self, batch): ... # batch has outputs/events/successes/costs/...
Simulation, Chaos, Observability
from entropy import AdversarialSimulator, ChaosRunner, Watcher
adv = AdversarialSimulator(seed=0)
for v in adv.iterate("book a flight"):
print(v) # typo / injection / distraction / leak variants
ChaosRunner(seed=0).run(agent, dataset, ["api_fail", "timeout"]) # fault injection
Watcher(agent, dataset, trials=20).watch(rounds=10) # live drift + anomalies
Framework adapters (lazy)
from entropy import from_langchain, from_langgraph, from_openai, from_custom
runnable = from_langchain(my_langchain_agent) # maps framework runs -> AgentRun
All 9 adapters (LangChain, LangGraph, OpenAI Agents, CrewAI, PydanticAI,
AutoGen, Google ADK, MCP, custom) import their framework lazily, so
import entropy works with none of them installed.
CLI
entropy init # scaffold a project
entropy run --agent m:a --dataset d.json --trials 100
entropy test --agent m:a --dataset d.json --baseline base.json [--update]
entropy benchmark --agents m:a m:b --dataset d.json
entropy chaos --agent m:a --dataset d.json --faults api_fail,timeout
entropy simulate --kind adversarial --text "book a flight"
entropy ui --agent m:a --dataset d.json --serve
entropy watch --agent m:a --dataset d.json --rounds 10
entropy report --results r.json --format html
entropy dataset --path d.json
entropy doctor # check optional deps
Reports
from entropy import export_report
export_report(results, "html", "report.html") # also: json, markdown, pdf, jupyter
Layout
core/ (models, tracing, exporters, suite) · metrics/ (registry + all
categories) · datasets/ · simulation/ · chaos/ · regression/ ·
benchmarks/ · observability/ · reports/ · dashboard/ · integrations/
(adapters) · cli/ · plugins/.
Tests: python -m pytest tests/.
Documentation
The static documentation site lives in docs/ — plain
HTML/CSS/JS with no build step, deployable to GitHub Pages.
- Source:
docs/index.html,docs/guide/*.html,docs/api.html,docs/examples.html, plusdocs/assets/(CSS, JS, logo, search index). - Local preview: serve the folder, e.g.
python -m http.server -d docs 8000then openhttp://localhost:8000. - Deploy: push to
main; the.github/workflows/pages.ymlworkflow uploadsdocs/and publishes it via GitHub Pages. Alternatively, set Settings → Pages → Build and deployment → Source to Deploy from a branch and choose themainbranch/docsfolder.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file entropy_ai-0.1.1.tar.gz.
File metadata
- Download URL: entropy_ai-0.1.1.tar.gz
- Upload date:
- Size: 41.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d9b9e397d5178cd992dde2bb0381a1858684936c8af18eee77da85080dac0a0
|
|
| MD5 |
7b2259568ef7c86f0f2182925de39f2d
|
|
| BLAKE2b-256 |
775703aec5848d1d51ccb1953c6e07e60aaf50c534dcb5d592e26bc9c6381d90
|
File details
Details for the file entropy_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: entropy_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 52.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e90801442b10964aecd94cd161c4e2c7aca6a5ec404f011a6d4052c66bdc2a2
|
|
| MD5 |
a51b811b4a75a33f4f928e91f8a18345
|
|
| BLAKE2b-256 |
6861cecd6d80c1e82724e6044db0f3fb8a0985acbb8a36126432c416ae539290
|