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.

CI/CD for AI appsDiagram with these labels, in reading order: Pull Request; (PR); Run Eval Suite; on Curated Dataset; Score with; Deterministic Checks; Model-Graded; Rubrics (LLM); Compare Results; to Baseline.Pull Request(PR)Run Eval Suiteon Curated DatasetScore withDeterministic ChecksModel-GradedRubrics (LLM)Compare Resultsto Baseline
CI/CD Pipeline for AI Apps

The eval suite on every pull request

  1. A pull request triggers the pipeline, for example through GitHub Actions.
  2. The app runs against a curated evaluation dataset.
  3. Deterministic checks (schema validation, regex matching) score structure.
  4. An LLM acting as judge grades subjective quality.
  5. Latency, token use and cost are recorded.
  6. 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.

Automate the gate Manual review alone lets regressions ship unnoticed.

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.

CI/CD for AI appsDiagram with these labels, in reading order: Latency Increase Detected; Check Prompt Efficiency; Check RAG Configuration; Check Model Version; Optimize Prompts; Adjust RAG Settings; Rollback Model Version.Latency Increase DetectedCheck Prompt EfficiencyCheck RAG ConfigurationCheck Model VersionOptimize PromptsAdjust RAG SettingsRollback Model Version
Debugging CI/CD latency issues
  • 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.

Back to the knowledge baseRequest an assessment