Repository navigation
Getting Started
Lucius Morningstar edited this page Aug 23, 2026
·
3 revisions
- Python 3.10+ (tested on 3.13)
- An OpenRouter API key (the eval LLM gateway)
- Optional but recommended: the
embeddingsbatch (pip install -r requirements/embeddings.txt) for the local embedding rescue (free, offline)
Dependencies are purpose-scoped batches (KANBAN-081): requirements.txt is
the CORE floor only (agent → prompt → scoring chain). Add task batches as
needed — tracing (Langfuse/Phoenix), evals (Braintrust), datasets
(HF publishers + vision), reporting (decks/plots/xlsx), embeddings,
dev (tests), or everything via all — see README §Setup for the full table.
git clone https://github.com/Exios66/llm-entity-extraction
cd llm-entity-extraction
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # core only
pip install -r requirements/all.txt # + every non-dev batch for eval work
pip install -e . # agents/src/config importable from any codebase
cp config/environments/braintrust.env.example config/environments/braintrust.env # Braintrust org/project keys
cp config/environments/.env.example config/environments/.env # OPENROUTER_API_KEY (+ Langfuse keys for mirrors)# 1) Sync the CUAD corpus into Braintrust (one time)
python scripts/datasets/stream_cuad_to_bt.py --text-only --dry-run # preview
python scripts/datasets/stream_cuad_to_bt.py --text-only
# 2) Run a cheap classification eval (ONE prompt version at a time)
python scripts/eval/run_classification_eval.py --dataset mailroom-cuad-contracts \
--prompt-version sorter_v0 --limit 5
# 3) Rebuild the derived artifacts + the site
python scripts/reporting/render_experiment_log.py
python scripts/site/build_site.py
node tests/assets/site_render_audit.js # headless render audit
# 4) Commit + push (this updates the GH Pages site — /docs is served from main)
git add reports/ docs/data
git commit -m "EXPERIMENT: <name>"
git push origin main-
Diagnose with data — read the last runs in
reports/experiment_log.md(or the site): per-field scores, confusion matrices, failure insights, cost. -
Change ONE thing — a new prompt version (constant +
PROMPT_VERSIONSentry insrc/prompts.py). The version key IS the experiment identity; never mutate a prompt after it has run. -
Unit-test —
python -m pytest tests/ -qbefore spending money. -
Dry-run —
--dry-runon the runner to confirm the plan. -
Cheap pilot — same seed as previous runs for direct comparison
(
--sample 5 --seed 42). -
A/B on identical rows —
evaluate_prompt_version.py --prompt-a A --prompt-b B; the delta carries a bootstrap CI + significance verdict. - Full-sample when meaningful — same-sample comparisons are the ONLY valid accuracy comparisons.
-
Log & document — verify the JSONL record, regenerate the md + site,
commit with its
[Unreleased]changelog entry (see Release-Process).
The synced copy lives at llm-mailroom/docs/reports/experiments/experiment_log.md.
After upstream pushes, llm-mailroom re-syncs:
cd ../llm-mailroom
PYTHONPATH=src python -c "from legalbench.experiment_log import regenerate, default_log_path; regenerate(default_log_path())"llm-entity-extraction · prompt experiment loop for llm-mailroom — repository · experiment-log site