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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evallm_cli-0.1.0.tar.gz (71.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evallm_cli-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file evallm_cli-0.1.0.tar.gz.

File metadata

  • Download URL: evallm_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 71.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for evallm_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f80f0c94e36211617048d21cea2ee07019f14140d5e9c64804116fad6c397df
MD5 63939956195bd0e99906c4de401ae205
BLAKE2b-256 5442d006430e79fc75497526884a107977cf72509d3490347b9bf4d219eebbcc

See more details on using hashes here.

File details

Details for the file evallm_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: evallm_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for evallm_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad5c1255eb387e310a061dae73c714811793b50cd1e4cbb01e5986f7eea8b04f
MD5 7ec136961c2991eca09a32ce7ab41db4
BLAKE2b-256 83628855f361a366d3f47a7192f930ec6139ebce9f1437fd5d6247ee11da324d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page