CI/CD for LLM apps runs an eval suite on each change to prompts, RAG configuration or model version. Promotion is gated on quality, cost and safety thresholds.
The eval suite on every pull request
- A pull request triggers the pipeline, for example through GitHub Actions.
- The app runs against a curated evaluation dataset.
- Deterministic checks (schema validation, regex matching) score structure.
- An LLM acting as judge grades subjective quality.
- Latency, token use and cost are recorded.
- Scores are compared with a baseline, and any regression blocks the merge.
Tools that fit here include Promptfoo for prompt evaluation, LangSmith or Langfuse for tracking, and DeepEval or Braintrust for broader evaluation.
Example scenario: a developer edits a prompt to raise engagement. The eval run shows engagement up but latency over the threshold, so the regression check blocks the merge.
A prompt that improves one metric while pushing another past its limit does not merge.
Graded scores in place of pass or fail tests
Ordinary CI tests are deterministic. LLM tests are probabilistic and scored on a scale, so the merge gate asks whether scores meet a threshold across many cases. That requires a versioned evaluation set to serve as ground truth.
Cheap checks per PR, heavy evals nightly
- Deterministic assertions cover structure and must-not-fail cases, with a clear pass or fail.
- LLM-as-judge covers open-ended quality, calibrated against human labels.
- Run inexpensive checks on each PR to catch obvious problems early.
- Run the full eval suite nightly or just before a release.
The tools split roughly by job: the eval runner executes cases, the tracker records scores and traces, and the CI system enforces the gate. Whatever the mix, the goal is the same: a change reaches the main branch only after it has been scored against the same dataset as the version it replaces.
Why manual prompt review does not scale
Reviewing a few prompts by hand misses regressions: a fix for one prompt can break others. Human judgment also varies between reviewers. An automated gate gives a quantitative comparison against a baseline and shows whether a change improved quality overall.
A latency increase after deployment
Example scenario: a deployment raises response latency by 25% (illustrative). Possible causes are a model version that the eval suite did not test well, or prompt and retrieval changes whose effects the suite did not cover.
- Compare eval results for the new version with earlier benchmarks.
- Log the failing queries and examine what they share.
- A/B test the new version against the previous stable one.
Revert to the stable version while you fix what the suite missed. You lose the new version's improvements for a while. Watch error rates and user satisfaction after redeploying.