Skip to main content

cafe-core

The CAFE evaluation engine: define a compound AI system as a black box, declare the factors to vary, and run a design-of-experiments study over it — headless, no web stack, no database required.

CAFE generates full and fractional factorial designs, runs each configuration with replication (resumable checkpoints), scores answers with a configurable LLM judge and/or human raters, and attributes quality to the factors with models that account for question difficulty, matched to the rubric's scale (linear · cumulative-link · logistic) plus inter-rater reliability (Krippendorff's α). See the examples/ notebooks for the full walkthrough.

Install

Requires Python ≥ 3.11 and R; the mixed-effects models (ordinal CLMM, logistic GLMM) run in R.

pip install "cafe-core[all]"    # library + LLM judge + datasets + notebooks

# R + the model packages  (Debian/Ubuntu shown; macOS: `brew install r`)
sudo apt install r-base
Rscript -e 'install.packages(c("ordinal", "lme4"))'

cafe doctor                     # verify the environment: Python, R engine, LLM access

To work on the code, or to get the example notebooks and the self-hostable web app, install from the repository instead:

git clone https://github.com/fabian-lu/Cafe.git && cd Cafe
uv venv && uv pip install -e "packages/cafe-core[all,dev]"

Try it (no API keys)

cafe run example            # run the bundled toy 2-factor study
cafe run example --smoke    # preflight: 1 input, 1 rep, cost/time estimate
cafe validate example       # expand the design without running

Library use

import cafe

async def my_system(config, item):
    # your compound system: routing, RAG, cascade, agent — anything.
    return f"answer for {item!r} using {config['model']}"

study = cafe.Study(
    name="my-study",
    system=my_system,
    factors=[
        cafe.Factor("model", ["small", "large"]),
        cafe.Factor("prompt", ["plain", "cot"]),
    ],
    dataset=["question 1", "question 2"],
    replications=3,
)

results = study.run(checkpoint_path=".cafe/my-study.jsonl")  # resumable
print(results.summary())
for obs in results:
    print(obs.config, obs.output, obs.elapsed_s)

study.run() returns a Results object you hold like any value. The optional checkpoint_path makes a long run crash-safe: re-running resumes instead of restarting.

Metadata

Release files for cafe-core 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 cafe-core 0.1.0
File Size Uploaded Provenance
cafe_core-0.1.0.tar.gz 142.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cafe-core 0.1.0
File Interpreter ABI Platform
cafe_core-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 279.9 kB

Release files / cafe_core-0.1.0.tar.gz

Download URL cafe_core-0.1.0.tar.gz
Size 142.5 kB
Tags Source
SHA-256 checksum
How to use checksums
21dffbd623ac4f764f5c687bcff7b1068362fbb3c2147c7500e76dc69df34f34
BLAKE2b-256 checksum
How to use checksums
27e586eba8f2e1fb9c7abdf3705ed178cd57c13287aad2380973e3509c6b29fe
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 Oct 22, 2026.

Transparency log

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

Download URL cafe_core-0.1.0-py3-none-any.whl
Size 137.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a8e3775d947abd999d7c5c6fd1b7693243f985473093446c30892617b68faab
BLAKE2b-256 checksum
How to use checksums
6444f7b4d27d26becc56a8a9e459c2e35697f41e9319a28d3cafa83f1f827c88
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 Oct 22, 2026.

Transparency log

Security for cafe-core 0.1.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cafe_core-0.1.0.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 Oct 22, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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