Skip to contentমূল লেখায় যান

Topic 43 · AI/ML testingটপিক 43 · AI/ML testing

CI/CD Eval Pipelines

An eval suite that only runs on a laptop is a report. An eval suite that runs on every pull request is a gate.

8 min read8 মিনিটে পড়া যায় · 6 sections6টি সেকশন · 4 sources4টি সোর্স · updated Nov 2026আপডেট: Nov 2026

The gate, threshold and flaky caseগেট, থ্রেশহোল্ড আর flaky কেস

Move the threshold and see which PRs pass, and see a flaky case get isolated.থ্রেশহোল্ড সরান আর দেখুন কোন PR পাস করে, তারপর দেখুন একটা flaky কেস আলাদা হয়ে যায়।

2 min2 মিনিট7 steps7টি ধাপ
  • Cases in gateগেটে কেস20
  • Cost limitখরচের সীমা$0.010
pull requestপুল রিকোয়েস্টprompts/**prompts/**Eval gateইভাল গেটPR checkPR চেকMergeমার্জScheduleশিডিউল

You’ll learnআপনি শিখবেন

  • How a paths filter saves costpaths filter কীভাবে খরচ বাঁচায়
  • Pass rate = passed / totalপাস হার = পাস / মোট
  • A pass rate below the threshold blocks the mergethreshold-এর নিচের পাস হার merge আটকায়
  • Why a flaky case runs on a scheduleflaky কেস কেন শিডিউলে চলে

In plain words

The pipeline has three jobs, and they run in increasing cost order.

on every push    the fast, deterministic checks: schema, format, prompt shape
on every PR      the eval suite with a threshold: a merge blocks below it
on a schedule    the expensive evals: the full dataset, the model comparison

The gate is the point. A gate is a threshold that fails the job, which fails the check, which blocks the merge. The threshold has to be a number the team agreed on before the first failure, and it has to be derived from the quality bar rather than from the current score, or the bar rises every time someone raises it.

The PR report is the second point. A failed gate with no explanation is a wall. The report has to name the failing cases, show the outputs, and say which metric moved. Promptfoo's GitHub Action posts a comment on the pull request with a link to the results Source 1সোর্স 1, and GitHub Actions is where the workflow itself lives Source 2সোর্স 2.

The cost gate is the third. An eval suite that costs more than the feature it protects is not sustainable, and a prompt change that quietly doubles the token count should fail the build like any other regression.

সহজ English

The pipeline has three jobs. They run from cheapest to most expensive.

on every push    the fast, deterministic checks: schema, format, prompt shape
on every PR      the eval suite with a threshold: a merge blocks below it
on a schedule    the expensive evals: the full dataset, the model comparison

The gate is the main point. A gate is a threshold that fails the job. A failed job fails the check. A failed check blocks the merge.

The team must agree on the threshold number before the first failure. It must come from the quality bar, not from the current score. Otherwise the bar rises every time someone raises it.

The PR report is the second point. A failed gate with no explanation is a wall. The report must name the failing cases, show the outputs, and say which metric moved. Promptfoo's GitHub Action posts a comment on the pull request with a link to the results Source 1সোর্স 1. The workflow itself lives in GitHub Actions Source 2সোর্স 2.

The cost gate is the third point. An eval suite that costs more than the feature it protects is not sustainable. A prompt change that quietly doubles the token count should fail the build like any other regression.

বাংলা ব্যাখ্যা

pipeline-এ তিনটা কাজ আছে, আর সেগুলো খরচ বাড়ার ক্রমে চলে:

on every push    the fast, deterministic checks: schema, format, prompt shape
on every PR      the eval suite with a threshold: a merge blocks below it
on a schedule    the expensive evals: the full dataset, the model comparison

gate-ই মূল বিষয়। gate হলো একটা threshold যেটা job-কে ব্যর্থ করায়, যেটা check-কে ব্যর্থ করায়, যেটা merge আটকায়। threshold দলকে প্রথম ব্যর্থতার আগেই ঠিক করতে হবে, আর এটা quality bar থেকে আসতে হবে, বর্তমান স্কোর থেকে নয় — নইলে প্রতিবার কেউ বাড়ালেই bar বাড়ে যাবে ।

PR report দ্বিতীয় পয়েন্ট। ব্যর্থ gate-এর সাথে ব্যাখ্যা না থাকলে সেটা একটা দেয়াল। report-এ ব্যর্থ কেসগুলোর নাম, output আর কোন metric সরেছে সেটা থাকতে হবে। Promptfoo-র GitHub Action pull request-এ ফলাফলের link-সহ একটা comment দেয় Source 1সোর্স 1, আর workflow নিজে থাকে GitHub Actions-এ Source 2সোর্স 2।

cost gate তৃতীয়টা। যে eval suite নিজের ফিচারের চেয়ে বেশি খরচ করে সেটা টেকসই নয়, আর prompt পরিবর্তন যেটা নীরবে token সংখ্যা দ্বিগুণ করে দেয় সেটাও অন্য যেকোনো regression-এর মতোই build fail করা উচিত।

How it works

The workflow file is a normal GitHub Actions workflow with the eval step added. The important detail is that the eval step fails the job, because a job that reports a failure without exiting non-zero does not block anything.

# .github/workflows/eval.yml
name: AI eval gate
on:
  pull_request:
    paths: ["app/ai/**", "prompts/**", "evals/**"]

jobs:
  eval:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v4
        with:
          node-version: "24"
      - run: npm ci
      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

The paths filter matters. Without it, every pull request pays for the eval, and the team learns to ignore the gate.

The threshold is enforced by the assertions in the config rather than by a separate script. So the bar lives in one place next to the cases:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9

The cost gate is a second check, and it is the one that stops a prompt change from quietly doubling the bill. Promptfoo's cost assertion fails a case whose inference cost is over a limit Source 4সোর্স 4. The latency assertion fails one slower than a number of milliseconds Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

The latency assertion needs --no-cache Source 4সোর্স 4.

And the report is what turns a red check into a fixable problem. Promptfoo's GitHub Action runs the eval when prompt files change. It also posts a comment on the pull request with a link to the results Source 1সোর্স 1.

The last piece is flakiness control. An eval that fails randomly will get ignored, and an ignored gate is worse than no gate. The controls are:

  • Run the model at a fixed temperature.
  • Average the score over several samples per case.
  • Separate the flaky cases into their own suite that runs on a schedule instead of blocking the merge.

সহজ English

The workflow file is a normal GitHub Actions workflow with the eval step added. The key detail is that the eval step fails the job. A job that reports a failure but does not exit non-zero blocks nothing.

# .github/workflows/eval.yml
name: AI eval gate
on:
  pull_request:
    paths: ["app/ai/**", "prompts/**", "evals/**"]

jobs:
  eval:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v4
        with:
          node-version: "24"
      - run: npm ci
      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

The paths filter matters. Without it, every pull request pays for the eval. Then the team learns to ignore the gate.

The threshold is enforced by the assertions in the config, not by a separate script. So the bar lives in one place, next to the cases:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9

The cost gate is a second check. It stops a prompt change from quietly doubling the bill. Promptfoo's cost assertion fails a case whose inference cost is over a limit. The latency assertion fails a case that is slower than a number of milliseconds Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

The latency assertion needs --no-cache Source 4সোর্স 4.

The report turns a red check into a problem you can fix. Promptfoo's GitHub Action runs the eval when prompt files change. It posts a comment on the pull request with a link to the results Source 1সোর্স 1.

The last piece is flakiness control. An eval that fails randomly will get ignored. An ignored gate is worse than no gate. Run the model at a fixed temperature. Average the score over several samples per case. Put the flaky cases in their own suite, which runs on a schedule and does not block the merge.

বাংলা ব্যাখ্যা

workflow ফাইল একটা সাধারণ GitHub Actions workflow, eval ধাপ যোগ করা। গুরুত্বপূর্ণ বিষয় হলো eval ধাপ job-কে ব্যর্থ করায়, কারণ non-zero ছাড়া ব্যর্থতা রিপোর্ট করা job কিছু আটকায় না।

# .github/workflows/eval.yml
name: AI eval gate
on:
  pull_request:
    paths: ["app/ai/**", "prompts/**", "evals/**"]

jobs:
  eval:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v4
        with:
          node-version: "24"
      - run: npm ci
      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

paths ফিল্টারটা গুরুত্বপূর্ণ: এটা ছাড়া প্রতিটা pull request-এর জন্য eval-এর খরচ, আর দল শেখে যায় gate উপেক্ষা করতে।

threshold config-এর assertion দিয়ে enforce হয়, আলাদা script দিয়ে নয়, যাতে bar কেসগুলোর পাশেই এক জায়গায় থাকে:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9

cost gate আরেকটা চেক, আর সেটাই prompt পরিবর্তন যেন নীরবে বিল দ্বিগুণ করে না তা আটকায়। Promptfoo-র cost assertion inference cost সীমার ওপরে গেলে কেস ব্যর্থ করে, আর latency নির্দিষ্ট millisecond-এর চেয়ে ধীর হলে Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

latency assertion-এর জন্য --no-cache লাগে Source 4সোর্স 4।

আর report, যেটা লাল চেককে সমাধানযোগ্য সমস্যায় বদলে দেয়। Promptfoo-র GitHub Action prompt ফাইল বদলালে eval চালায় আর pull request-এ ফলাফলের link-সহ comment দেয় Source 1সোর্স 1।

শেষ অংশ হলো flakiness control। যে eval মাঝে মাঝে এলোমেলো ব্যর্থ হয় সেটা উপেক্ষা হয়, আর উপেক্ষিত gate কোনো gate-এর চেয়ে খারাপ। নিয়ন্ত্রণগুলো: model একটা নির্দিষ্ট temperature-এ চালান, প্রতি কেসে কয়েকবার sample নিয়ে স্কোরের গড় নেওয়া, আর flaky কেসগুলো আলাদা suite-এ রাখা যেটা merge না আটকিয়ে নির্ধারিত সময়ে চলে।

In practice

The workflow runs the eval and fails on a threshold. Promptfoo's eval command returns exit code 100 when at least one test case fails or the pass rate is below PROMPTFOO_PASS_RATE_THRESHOLD, so the step itself is the gate Source 3সোর্স 3:

      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

A non-zero exit fails the step, which fails the job, which blocks the merge once that check is required.

The report on the pull request comes from Promptfoo's GitHub Action, which needs permission to post pull-request comments and posts a link to the results Source 1সোর্স 1:

permissions:
  pull-requests: write

# ... in the job's steps:
      - uses: promptfoo/promptfoo-action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          prompts: prompts/**/*.json
          config: evals/promptfooconfig.yaml

The cost gate is an assertion in the same config, not a separate script Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

And the flaky-case isolation, which is what keeps the gate trusted:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9
tests: file://evals/stable-cases.yaml

The stable cases run in the merge gate. The cases that flake run on the schedule, with the same assertions, so a genuinely flaky case is still measured. Nothing gets a permanent pass, and nothing random blocks a merge.

সহজ English

The workflow runs the eval and fails on a threshold. Promptfoo's eval command returns exit code 100 when at least one test case fails. It also does this when the pass rate is below PROMPTFOO_PASS_RATE_THRESHOLD. So the step itself is the gate Source 3সোর্স 3:

      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

A non-zero exit fails the step. That fails the job. Once the check is required, the failed job blocks the merge.

The report on the pull request comes from Promptfoo's GitHub Action. It needs permission to post pull-request comments. It posts a link to the results Source 1সোর্স 1:

permissions:
  pull-requests: write

# ... in the job's steps:
      - uses: promptfoo/promptfoo-action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          prompts: prompts/**/*.json
          config: evals/promptfooconfig.yaml

The cost gate is an assertion in the same config, not a separate script Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

The flaky-case isolation is what keeps people trusting the gate:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9
tests: file://evals/stable-cases.yaml

The stable cases run in the merge gate. The cases that flake run on the schedule, with the same assertions. So a truly flaky case is still measured. Nothing gets a permanent pass, and nothing random blocks a merge.

বাংলা ব্যাখ্যা

workflow eval চালায় আর threshold-এ ব্যর্থ হয়। Promptfoo-র eval command অন্তত একটা test case ব্যর্থ হলে বা pass rate PROMPTFOO_PASS_RATE_THRESHOLD-এর নিচে গেলে exit code 100 ফেরত দেয়, তাই step নিজেই gate Source 3সোর্স 3:

      - name: Run the eval gate
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: npx promptfoo eval --output results.json --no-cache

non-zero exit step ব্যর্থ করায়, যেটা job ব্যর্থ করায়, আর সেই check required হলে merge আটকায়।

pull request-এ report আসে Promptfoo-র GitHub Action থেকে, যেটার pull-request comment দেওয়ার permission লাগে আর যেটা ফলাফলের link দেয় Source 1সোর্স 1:

permissions:
  pull-requests: write

# ... in the job's steps:
      - uses: promptfoo/promptfoo-action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          prompts: prompts/**/*.json
          config: evals/promptfooconfig.yaml

cost gate একই config-এর একটা assertion, আলাদা script নয় Source 4সোর্স 4:

defaultTest:
  assert:
    - type: cost
      threshold: 0.01
    - type: latency
      threshold: 5000

আর flaky-case আলাদা করা, যেটাই gate-কে বিশ্বাসযোগ্য রাখে:

defaultTest:
  assert:
    # llm-rubric is model-graded: set a grader provider and its API key
    - type: llm-rubric
      value: The answer only uses the policy
      metric: faithfulness
      threshold: 0.9
tests: file://evals/stable-cases.yaml

স্থায়ী কেসগুলো merge gate-এ চলে। যেসব কেস flaky সেগুলো নির্ধারিত সময়ে চলে, একই assertion-সহ, যাতে সত্যিকারের flaky কেসও মাপা হয়। কিছুকে স্থায়ী পাস দেওয়া হয় না, আর কিছুই এলোমেলো করে merge আটকায় না।

Common mistakes

Mistake 1: a gate with no threshold. "The eval failed" without a number means the team argues about the bar instead of the quality .

Mistake 2: the threshold set from the current score. Then the bar silently rises every time somebody raises it.

Mistake 3: running the eval on every push. The cost is real and the team learns to ignore it.

Mistake 4: no report on the pull request. A red check with no output is a wall Source 1সোর্স 1.

Mistake 5: no cost gate. A prompt change that doubles the token count is a regression like any other.

Mistake 6: a flaky gate. A gate that fails randomly gets ignored, and an ignored gate is worse than no gate.

সহজ English

Mistake 1: a gate with no threshold. Saying "The eval failed" without a number makes the team argue about the bar instead of the quality.

Mistake 2: the threshold set from the current score. Then the bar silently rises every time somebody raises it.

Mistake 3: running the eval on every push. The cost is real. The team learns to ignore it.

Mistake 4: no report on the pull request. A red check with no output is a wall Source 1সোর্স 1.

Mistake 5: no cost gate. A prompt change that doubles the token count is a regression like any other.

Mistake 6: a flaky gate. A gate that fails randomly gets ignored. An ignored gate is worse than no gate.

বাংলা ব্যাখ্যা

Mistake ১: threshold ছাড়া gate। সংখ্যা ছাড়া "eval ব্যর্থ" মানে দল মান নিয়ে ঝগড়া করে, মান নিয়ে নয়।

Mistake ২: threshold বর্তমান স্কোর থেকে ঠিক করা। তাহলে bar নীরবে প্রতিবার বাড়ে।

Mistake ৩: প্রতিটা push-এ eval চালানো। খরচ আসল, আর দল শেখে যায় উপেক্ষা করতে।

Mistake ৪: pull request-এ report নেই। output ছাড়া লাল চেক একটা দেয়াল Source 1সোর্স 1।

Mistake ৫: cost gate নেই। token সংখ্যা দ্বিগুণ করা prompt পরিবর্তন একটা regression-ই।

Mistake ৬: flaky gate। যে gate এলোমেলো ব্যর্থ হয় সেটা উপেক্ষা হয়, আর উপেক্ষিত gate কোনো gate-এর চেয়ে খারাপ।

What a tester can check

Tutorial advice

This advice is the tutorial's own. It does not come from the sources.

  • Write the threshold down in the config next to the cases, with a comment explaining what it protects. A number nobody understands gets changed.
  • Store the eval results as a build artifact. When the score drops three weeks later, the history is the only way to see what moved.
  • Test the gate itself: open a pull request with a deliberately broken assertion and check that it blocks and that the comment explains why.
  • Give the job a token budget of its own and alert when the eval spend itself goes up. The eval is a cost centre too.
  • Put the eval behind the paths filter for the files that can change it. Every unrelated pull request should not pay for it.
  • When you find a flaky case, move it to the scheduled suite in the same commit, so it does not get quietly deleted instead.

সহজ English

Tutorial advice

This advice is the tutorial's own. It does not come from the sources.

  • Write the threshold down in the config next to the cases, with a comment explaining what it protects. A number nobody understands gets changed.
  • Store the eval results as a build artifact. When the score drops three weeks later, the history is the only way to see what moved.
  • Test the gate itself: open a pull request with a deliberately broken assertion and check that it blocks and that the comment explains why.
  • Give the job a token budget of its own and alert when the eval spend itself goes up. The eval is a cost centre too.
  • Put the eval behind the paths filter for the files that can change it. Every unrelated pull request should not pay for it.
  • When you find a flaky case, move it to the scheduled suite in the same commit, so it does not get quietly deleted instead.

বাংলা ব্যাখ্যা

Tutorial advice

এই পরামর্শ টিউটোরিয়ালের নিজস্ব। এটি সোর্স থেকে আসেনি।

  • threshold-টা config-এ কেসগুলোর পাশেই লিখুন, সাথে একটা comment দিয়ে ব্যাখ্যা করুন এটা কী রক্ষা করে। কেউ না বোঝা এমন সংখ্যা বদলে দেওয়া হয়।
  • eval ফলাফল build artifact হিসেবে রাখুন। তিন সপ্তাহ পরে স্কোর কমলে ইতিহাসই একমাত্র উপায় বলতে পারে কী বদলেছে।
  • gate-কেও টেস্ট করুন: ইচ্ছাকৃতভাবে ভাঙা assertion দিয়ে একটা pull request খুলে দেখুন সেটা আটকায় কি না আর comment ব্যাখ্যা করে কি না।
  • job-কে নিজস্ব একটা token বাজেট দিন আর eval খরচ বাড়লে alert দিন। eval-ও একটা cost centre।
  • eval-টা যেসব file বদলাতে পারে তার paths filter-এর পেছনে রাখুন। অপ্রাসঙ্গিক প্রতিটা pull request-এর জন্য এটা খরচ হওয়া উচিত নয়।
  • flaky কেস পেলে একই commit-এ নির্ধারিত suite-এ সরান, যাতে সেটা চুপচাপ delete না হয়ে যায়।

Key words

WordWhat it means
Quality gateA threshold that fails the build, and so blocks the merge
ThresholdThe score the eval must reach, agreed before the first failure
CI/CDThe pipeline that runs the checks on every change
Pull request reportThe eval results written onto the pull request for the reviewer
Cost gateA check that fails when a prompt change makes the calls too expensive
Flaky caseA test that fails at random and must be separated from the gate
Paths filterThe list of files that trigger the workflow
Build artifactThe stored eval results, which are the history of the score
RegressionA change that made the quality worse, which the gate is there to catch
  1. [1]
    Testing Prompts with GitHub Actions

    Promptfoo (docs) · accessed 2026-11-01দেখা হয়েছে: 2026-11-01

  2. [2]
    GitHub Actions documentation

    GitHub · accessed 2026-11-01দেখা হয়েছে: 2026-11-01

  3. [3]
    Command line

    Promptfoo (docs) · accessed 2026-11-01দেখা হয়েছে: 2026-11-01

  4. [4]
    Deterministic assertions

    Promptfoo (docs) · accessed 2026-11-01দেখা হয়েছে: 2026-11-01