Skip to main content

fasteval

fasteval-core fasteval-langgraph fasteval-langfuse fasteval-observe Python versions CI License Docs

A decorator-first LLM evaluation library for testing AI agents and LLMs. Stack decorators to define evaluation criteria, run them with the fasteval CLI or plain pytest. Read the docs.

The Evaluation Journey -- from non-deterministic LLM outputs to reliable engineering metrics

Features

  • 50+ built-in metrics -- stack @fe.correctness, @fe.relevance, @fe.hallucination, and more
  • pytest native -- run evaluations with pytest, get familiar pass/fail output
  • fasteval CLI -- fasteval run runs only your evals, with named profiles, tag selection, quality gates and run history
  • Local UI -- watch runs live, inspect every case and judge prompt, re-run failures and compare runs; headless CI runs write a self-contained HTML report
  • Prompt judges and playground -- tune an LLM judge's prompt against real cases, save it as judges/<name>.toml, use it with @fe.prompt_judge() or swap it in with fasteval run --judge
  • LLM-as-judge + deterministic -- semantic LLM metrics alongside ROUGE, exact match, JSON schema, regex
  • Custom criteria -- @fe.criteria("Is the response empathetic?") for any evaluation you can describe in plain English
  • Multi-modal -- evaluate vision, audio, and image generation models
  • Conversation metrics -- context retention, topic drift, consistency for multi-turn agents
  • RAG metrics -- faithfulness, contextual precision, contextual recall, answer correctness
  • Tool trajectory -- verify agent tool calls, argument matching, call sequences
  • Reusable metric stacks -- @fe.stack() to compose and reuse metric sets across tests
  • Human-in-the-loop -- @fe.human_review() for manual review alongside automated metrics
  • Data-driven testing -- @fe.dataset, @fe.csv() and @fe.jsonl() turn every row or record into its own test case
  • Tags -- @fe.tag("smoke") to label evals and select them with fasteval run -t smoke or pytest -m smoke
  • Pluggable providers -- OpenAI (default), Anthropic, or bring your own LLMClient

How It Works

How fasteval works -- Decorate, Test, Score, Evaluate, Result

Quick Start

pip install fasteval-core

Set your LLM provider key:

export OPENAI_API_KEY=sk-your-key-here

Write your first evaluation test:

import fasteval as fe

@fe.correctness(threshold=0.8)
@fe.relevance(threshold=0.7)
def test_qa_agent():
    response = my_agent("What is the capital of France?")
    fe.score(response, expected_output="Paris", input="What is the capital of France?")

Run it:

fasteval run test_qa_agent.py

From a terminal, the run opens live in your browser; in CI it runs headless and writes .fasteval/report.html. It's plain pytest underneath, so this works too:

pytest test_qa_agent.py -v

Running Evals

fasteval                        # project status: config, profiles, last run
fasteval list                   # every eval with its tags, metrics and data source
fasteval run -t smoke           # select by tag; unknown flags pass through to pytest
fasteval run -p ci              # a named profile from [tool.fasteval.profiles]
fasteval run --lf -n auto       # re-run failures, in parallel (pytest-xdist)
fasteval run --min-pass-rate 0.9 --min-score 0.75    # quality gates
fasteval run --judge correctness=my_judge            # swap in a saved prompt judge
fasteval report --html --open   # export the latest run as one HTML file
fasteval ui                     # run history, eval catalog, judges, playground

Profiles keep run settings in pyproject.toml:

[tool.fasteval]
default_profile = "dev"

[tool.fasteval.profiles.dev]
paths = ["evals"]
tags = "not slow"

[tool.fasteval.profiles.ci]
extends = "dev"
tags = ""
review_prompts = false
headless = true
min_pass_rate = 0.9

See The fasteval CLI for details.

Installation

# pip
pip install fasteval-core

# uv
uv add fasteval-core

Optional Extras

# Anthropic provider
pip install fasteval-core[anthropic]

# Vision-language evaluation (GPT-4V, Claude Vision)
pip install fasteval-core[vision]

# Audio/speech evaluation (Whisper, ASR)
pip install fasteval-core[audio]

# Image generation evaluation (DALL-E, Stable Diffusion)
pip install fasteval-core[image-gen]

# All multi-modal features
pip install fasteval-core[multimodal]

Usage Examples

Deterministic Metrics

import fasteval as fe

@fe.contains()
def test_keyword_present():
    fe.score("The answer is 42", expected_output="42")

@fe.rouge(threshold=0.6, rouge_type="rougeL")
def test_summary_quality():
    fe.score(actual_output=summary, expected_output=reference)

Custom Criteria

@fe.criteria("Is the response empathetic and professional?")
def test_tone():
    response = agent("I'm frustrated with this product!")
    fe.score(response)

@fe.criteria(
    "Does the response include a legal disclaimer?",
    threshold=0.9,
)
def test_compliance():
    response = agent("Can I break my lease?")
    fe.score(response)

RAG Evaluation

@fe.faithfulness(threshold=0.8)
@fe.contextual_precision(threshold=0.7)
def test_rag_pipeline():
    result = rag_pipeline("How does photosynthesis work?")
    fe.score(
        actual_output=result.answer,
        context=result.retrieved_docs,
        input="How does photosynthesis work?",
    )

Tool Trajectory

@fe.tool_call_accuracy(threshold=0.9)
def test_agent_tools():
    result = agent.run("Book a flight to Paris")
    fe.score(
        result.response,
        tool_calls=result.tool_calls,
        expected_tools=[
            {"name": "search_flights", "args": {"destination": "Paris"}},
            {"name": "book_flight"},
        ],
    )

Data-Driven Evals

@fe.dataset
def support_questions():
    yield {"id": "refund", "question": "How long do refunds take?", "expected": "Within 30 days"}
    yield fe.case(id="hours", tags=["slow"], question="When is support open?", expected="9am to 6pm PT")

@support_questions
@fe.tag("rag")
@fe.correctness(threshold=0.7)
def test_support_answers(question, expected):
    fe.score(agent(question), expected, input=question)

# One test case per CSV row: test_faq[<question>]
@fe.contains()
@fe.csv("evals/data/faq.csv", id_field="question")
def test_faq(question, expected):
    fe.score(agent(question), expected, input=question)

Multi-Turn Conversations

@fe.context_retention(threshold=0.8)
@fe.conversation([
    {"query": "My name is Alice and I'm a vegetarian"},
    {"query": "Suggest a restaurant for me"},
    {"query": "What dietary restriction should they accommodate?"},
])
async def test_memory(query, expected, history):
    response = await agent(query, history=history)
    fe.score(response, input=query, history=history)

Metric Stacks

# Define a reusable metric stack
@fe.stack()
@fe.correctness(threshold=0.8, weight=2.0)
@fe.relevance(threshold=0.7, weight=1.0)
@fe.coherence(threshold=0.6, weight=1.0)
def quality_metrics():
    pass

# Apply to multiple tests
@quality_metrics
def test_chatbot():
    response = agent("Explain quantum computing")
    fe.score(response, expected_output=reference_answer, input="Explain quantum computing")

@quality_metrics
def test_summarizer():
    summary = summarize(long_article)
    fe.score(summary, expected_output=reference_summary)

Plugins

Plugin Description Install
fasteval-langfuse Evaluate Langfuse production traces with fasteval metrics pip install fasteval-langfuse
fasteval-langgraph Test harness for LangGraph agents pip install fasteval-langgraph
fasteval-observe Runtime monitoring with async sampling pip install fasteval-observe

Testing Pyramid for Agents -- layered testing strategy with fasteval-langgraph

Local Development

# Install uv
brew install uv

# Create virtual environment and install all dependencies
uv sync --all-extras --group dev --group test

# Run the test suite
uv run tox

# Run tests with coverage
uv run pytest tests/ --cov=fasteval --cov-report=term -v

# Format code
uv run black .
uv run isort .

# Type checking
uv run mypy .

# Build the local UI bundle (needed for `fasteval ui` and HTML reports from a source checkout)
cd ui && npm ci && npm run build

Documentation

Full documentation is available at fasteval.io.

Contributing

See CONTRIBUTING.md for development setup, coding standards, and how to submit pull requests.

License

Apache License 2.0 -- see LICENSE for details.

Metadata

Release files for fasteval-core 1.3.2

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

Source distribution (sdist)

Source distribution for fasteval-core 1.3.2
File Size Uploaded Provenance Actions
fasteval_core-1.3.2.tar.gz 213.4 kB With provenance Details for fasteval_core-1.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fasteval-core 1.3.2
File Interpreter ABI Platform Actions
fasteval_core-1.3.2-py3-none-any.whl Python 3 none any Details for fasteval_core-1.3.2-py3-none-any.whl

Total release size: 451.1 kB

Release files / fasteval_core-1.3.2.tar.gz

Download URL fasteval_core-1.3.2.tar.gz
Size 213.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7e6376395d57d10c73d3c1318028c29270f9cb000eda08a7e5d79f39800a1a4c
BLAKE2b-256 checksum
How to use checksums
f1a9fa942fdf012047c5573373f5567ef25198614c868928596d8a42214e88ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / fasteval_core-1.3.2-py3-none-any.whl

Download URL fasteval_core-1.3.2-py3-none-any.whl
Size 237.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9ded7b1223e27d4f35f3498e3c9d3f9ba41c414b7728588904fa1c0ffe57428
BLAKE2b-256 checksum
How to use checksums
3e465c50f07d2b054d7d92e09b80b642daadf2c2ba730c8864b33bcdd4ac8793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for fasteval-core 1.3.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fasteval_core-1.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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