### Set up development environment and run tests Source: https://github.com/abhixhek/jevcal/blob/main/README.md Sets up a virtual environment with uv, installs the package in editable mode with development dependencies, runs the test suite, and regenerates the bundled example dataset. ```bash uv venv && uv pip install -e ".[dev]" pytest python scripts/make_example.py # regenerate the bundled example dataset ``` -------------------------------- ### Install jevcal from GitHub Source: https://github.com/abhixhek/jevcal/blob/main/README.md Install the core package or the variant with Anthropic support for using Claude as a teacher or fallback. Not on PyPI yet; requires Python 3.10+. ```bash pip install "git+https://github.com/abhixhek/jevcal" # core pip install "jevcal[anthropic] @ git+https://github.com/abhixhek/jevcal" # + Claude as teacher / fallback ``` -------------------------------- ### Run jevcal demo with built-in simulator Source: https://github.com/abhixhek/jevcal/blob/main/README.md Run the bundled demo with the built-in simulator (no API key needed). The output shows per-question thresholds, handled and accepted accuracy, ECE, and status, plus escalation and cost savings metrics. ```bash $ jevcal demo # bundled example, built-in simulator, no API key question threshold handled accepted acc all acc ECE status is_urgent 0.994 21.2% 100.0% 94.5% 3.5% ok department 0.954 81.3% 96.3% 93.8% 3.5% ok frustration 0.875 98.0% 95.4% 95.5% 1.6% ok (handled / accepted accuracy are measured on the held-out split) rows that escalate: 85.4% cascade $1.930 per 1k rows vs LLM-only $2.25 (14.4% saved) a row escalates when any question is unsure; the bottleneck is is_urgent (handles 21.2% at a 97% target) ``` -------------------------------- ### Run jevcal demo and open report Source: https://github.com/abhixhek/jevcal/blob/main/README.md Run the built-in demo against a simulator (not Jev) to see the workflow and report without an API key. The simulator is deliberately overconfident so there is something to find. ```bash jevcal demo open jevcal-demo/report.html ``` -------------------------------- ### Use Cascade runtime in Python Source: https://github.com/abhixhek/jevcal/blob/main/README.md Ship the cascade in Python. With no fallback configured it fails closed: low-confidence answers come back as None, never as a guess. The log_path records escalations where the LLM disagrees for future eval rows. ```python from jevcal.runtime import Cascade, llm_fallback cascade = Cascade.from_lock( "decisions.lock.json", fallback=llm_fallback("anthropic:claude-opus-5"), log_path="decisions.jsonl", # escalations where the LLM disagrees are your next eval rows ) decisions = cascade.decide(ticket_text) decisions["queue"].answer # "billing" decisions["queue"].source # "jev" | "fallback" | "unresolved" ``` -------------------------------- ### Run jevcal to measure and compile Source: https://github.com/abhixhek/jevcal/blob/main/README.md Measure and compile thresholds. Produces decisions.lock.json (thresholds + evidence) and jevcal-report.html (reliability diagram, accuracy-vs-coverage curve, per-answer accuracy, cost split). Thresholds are picked on one half of data and verified on the other; add --conservative to require the 95% lower confidence bound. ```bash export TYPESAFE_API_KEY=... jevcal run --questions questions.yaml --data data.jsonl --target 0.98 ``` -------------------------------- ### Label data with LLM teacher Source: https://github.com/abhixhek/jevcal/blob/main/README.md Label unlabeled data using an LLM teacher (Claude) when you have no labels yet. It never overwrites existing labels. LLM labels are a teacher signal, not ground truth; spot-check a sample. ```bash export ANTHROPIC_API_KEY=... jevcal label --questions questions.yaml --data raw.jsonl --out data.jsonl --llm anthropic:claude-opus-5 ``` -------------------------------- ### Define decisions in questions.yaml Source: https://github.com/abhixhek/jevcal/blob/main/README.md Define your decisions in questions.yaml using the same shape as the TypeSafe API. Each question has a type, instructions, criteria, and an optional target threshold. ```yaml model: jev-1.13.0 questions: is_fraud: type: noul instructions: Is this email a fraud attempt? criteria: "true": Asks for credentials, payment, or urgent action under false pretenses. "false": Ordinary correspondence. target: 0.99 queue: type: choice instructions: Which team should handle this ticket? criteria: { billing: Charges and refunds, sales: Pricing and plans } ``` -------------------------------- ### Lint question wording Source: https://github.com/abhixhek/jevcal/blob/main/README.md Lint the wording of questions against the model's documented weak spots (negations, counting, dates, compound questions, overlapping options). No API key needed. ```bash jevcal lint --questions questions.yaml --data data.jsonl ``` -------------------------------- ### Optimize question wording with LLM Source: https://github.com/abhixhek/jevcal/blob/main/README.md Let the LLM fix badly worded questions. All rewrites are evaluated in a single request per row. A rewrite is kept only if the held-out split agrees it handles more traffic at your target. ```bash jevcal optimize --questions questions.yaml --data data.jsonl --llm anthropic:claude-opus-5 ``` -------------------------------- ### Check for drift in CI Source: https://github.com/abhixhek/jevcal/blob/main/README.md Guard the cascade in CI. Fails when accepted accuracy drops below target, when coverage falls, or with --strict when the model version that answered is not the one the thresholds were tuned on. ```bash jevcal check --lock decisions.lock.json --data data.jsonl # exit 1 on drift ```