CAFE is a design-of-experiments platform for RAG, agents, and LLM chains. Declare the factors you want to vary, run them with replication, and attribute quality to the components that actually drive it — with p-values.
[ FACTORIAL ANALYSIS COMPLETE ]
Score |
0.95 | █
0.78 | █ █
0.55 | █ █ █
0.30 | █ █ █ █
+------------
none dense dense+
rerank
Built with
You bring your pipeline as a black box; CAFE builds the experiment around it and tells you which components actually drive quality — and which just add cost.
Declare categorical, ordinal, or continuous factors, and CAFE expands the full factorial design automatically — or a fractional 2k-p design when the full grid is too large, with resolution and alias reporting.
Every configuration runs multiple times to separate real effects from run-to-run LLM noise. Checkpoints are written as it goes, so an interrupted study resumes instead of restarting — and one failed item never sinks the whole run.
Ordinal rubrics get a cumulative-link mixed model, binary pass/fail a logistic GLMM, and numeric scores a linear one. On top: partial η² attribution, Cohen's d, Pareto frontiers, and Krippendorff's α for judge↔human reliability.
Wrap your system as run(config, item) and list the factors to vary.
Choose full or fractional factorial. Preview the plan and cost before spending tokens.
Run every cell × input × replication. Resume from checkpoints automatically.
LLM judge with transparent prompts, or collect human ratings for calibration.
Get per-factor effects, significance, interactions, and a quality/cost Pareto frontier.
Use it from Python, a notebook, or the web platform.
cafe-core with zero core dependenciesimport cafe study = cafe.Study( name="rag-reranker", system=my_rag, factors=[ cafe.Factor("retrieve", ["none", "dense", "dense_rerank"]), cafe.Factor("model", ["small", "large"]), ], dataset=questions, rubric=cafe.rubrics.CORRECTNESS_0_3, judge=cafe.LLMJudge(model="ollama_cloud/gpt-oss:20b"), replications=3, ) result = study.evaluate() # answers → judge → attribution print(result.report())
Browse an actual CAFE evaluation — a HotpotQA RAG study over 18 configurations.
| Config | Mean | η² | p |
|---|---|---|---|
| dense_rerank · large | 2.71 | 0.23 | <0.001 |
| dense · large | 2.45 | 0.05 | <0.001 |
| none · large | 1.98 | - | - |
| dense_rerank · small | 1.62 | - | - |
Join researchers and engineers who want their evaluation to be as rigorous as their model training. Star the repo, read the docs, or cite the paper.
Built in the open — contributions are welcome. Add your own techniques, open an issue, or send a pull request; see the contributing guide to get started.