Skip to main content

evallm

Test and evaluate LLM outputs against expected results - from the command line

evallm lets you define test cases (inputs and expected outputs), run them against an LLM, and see where it succeeds or fails. Use it to catch prompt regressions, compare prompts and models, and see results in the terminal or as a self-contained HTML report.

Installation

pip install evallm-cli

evallm requires Python 3.10+ and an Anthropic API key.

Get an API key from the Anthropic Console.

Set your API key as an environment variable:

export ANTHROPIC_API_KEY="sk-ant-..."

The export command only works in the current session. To make it permanent, add it to your shell config — ~/.zshrc for zsh or ~/.bashrc for bash.

Quick start

Create a new evaluation project:

evallm init my-eval
cd my-eval

This creates the project structure. The key files are the config (evallm.yaml) and the test suites (suites/):

my-eval/
├── evallm.yaml
├── suites/
│   └── example.jsonl
└── results/

Configure your evaluation in evallm.yaml:

name: my-sentiment-eval
description: Sentiment classification for product reviews

system_under_test:
  provider: anthropic
  model: claude-sonnet-4-6
  system_prompt: |
    Classify the sentiment of the review as one of: positive, negative, neutral.
    Return only the label, nothing else.
  temperature: 0.0
  max_tokens: 100

suites:
  - name: sentiment_v1
    file: suites/example.jsonl
    evaluator: exact_match

Inside suites/ you can create multiple .jsonl files, each a separate test suite. Define test cases in each of them, like in this example:

{"input": "This product is amazing!", "expected": "positive"}
{"input": "Terrible experience, would not recommend", "expected": "negative"}
{"input": "It works as described", "expected": "neutral"}

Each line is a single test case with an input (sent to the LLM) and an expected output (compared against the response).

Run the evaluation:

evallm run evallm.yaml

evallm prints a summary panel with the timestamp, total score, and pass rate, followed by per-suite results.

Use --report or -r to also generate a self-contained HTML report, saved next to the config file. Use --cases or -c to see detailed per-case results in the terminal.

Commands

Command Description
evallm init <name> Create a new evaluation project
evallm validate <config> Check a config file for errors
evallm run <config> Run evaluation suites
evallm history List past runs
evallm show <run-id> Show a past run by ID

The most useful flags for run:

  • -r, --report — also generate a self-contained HTML report
  • -c, --cases — show per-case results in the terminal
  • -d, --db — path to the database file (defaults next to the config)

Run evallm <command> --help for the full list of options.

How it works

evallm runs each test case through your configured LLM and scores the output with an evaluator. Evaluators are modular: exact match is available now, with LLM-as-judge planned next.

Every run is saved to a local SQLite database, so you can review past results with history and show. Runs can also be exported as a self-contained HTML report.

License

MIT

Metadata

Release files for evallm-cli 0.1.0

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

Source distribution (sdist)

Source distribution for evallm-cli 0.1.0
File Size Uploaded
evallm_cli-0.1.0.tar.gz 71.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for evallm-cli 0.1.0
File Interpreter ABI Platform
evallm_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 88.6 kB

Release files / evallm_cli-0.1.0.tar.gz

Download URL evallm_cli-0.1.0.tar.gz
Size 71.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0f80f0c94e36211617048d21cea2ee07019f14140d5e9c64804116fad6c397df
BLAKE2b-256 checksum
How to use checksums
5442d006430e79fc75497526884a107977cf72509d3490347b9bf4d219eebbcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / evallm_cli-0.1.0-py3-none-any.whl

Download URL evallm_cli-0.1.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad5c1255eb387e310a061dae73c714811793b50cd1e4cbb01e5986f7eea8b04f
BLAKE2b-256 checksum
How to use checksums
83628855f361a366d3f47a7192f930ec6139ebce9f1437fd5d6247ee11da324d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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