<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mukund Jha</title>
    <description>The latest articles on DEV Community by Mukund Jha (@mukundjha33).</description>
    <link>https://dev.to/mukundjha33</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4095077%2Fdbd5b97a-8282-46af-b54e-428cb1bbe9cb.png</url>
      <title>DEV Community: Mukund Jha</title>
      <link>https://dev.to/mukundjha33</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mukundjha33"/>
    <language>en</language>
    <item>
      <title>Stop LLM Prompt Regressions in CI/CD: An Open-Source Guide using LLM-as-a-Judge</title>
      <dc:creator>Mukund Jha</dc:creator>
      <pubDate>Wed, 26 Aug 2026 06:11:14 +0000</pubDate>
      <link>https://dev.to/mukundjha33/stop-llm-prompt-regressions-in-cicd-an-open-source-guide-using-llm-as-a-judge-4o7i</link>
      <guid>https://dev.to/mukundjha33/stop-llm-prompt-regressions-in-cicd-an-open-source-guide-using-llm-as-a-judge-4o7i</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb7j5smhzv6ii3o21f11g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb7j5smhzv6ii3o21f11g.png" alt="Cover Image" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop LLM Prompt Regressions in CI/CD: An Open-Source Guide using LLM-as-a-Judge
&lt;/h2&gt;

&lt;p&gt;If you are building AI features, you have probably experienced this nightmare:&lt;/p&gt;

&lt;p&gt;You tweak one line in your system prompt to fix a minor edge case. You test it twice in the OpenAI Playground, and it looks great. You push to production.&lt;/p&gt;

&lt;p&gt;The next day, you find out that your "harmless" tweak caused the LLM to hallucinate a 60-day refund policy (instead of 30) and start leaking competitor names.&lt;/p&gt;

&lt;p&gt;Traditional unit tests &lt;code&gt;(assert output == "exact string")&lt;/code&gt; don't work because LLMs are non-deterministic. You end up manually testing 20 edge cases before every deploy, hoping you didn't break anything.&lt;/p&gt;

&lt;p&gt;This is called Prompt Regression, and it is the biggest bottleneck preventing AI apps from moving fast.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;In this article, I’ll show you how to use an architecture called LLM-as-a-Judge to automatically test your AI outputs, and I'll introduce an open-source Python CLI I built called Crilio that integrates this directly into your GitHub Actions.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;
The Problem: LLMs are non-deterministic; traditional tests fail.&lt;br&gt;
The Solution: Use a fast, cheap model (like GPT-4o-mini) to "judge" your main model's outputs against strict rules.&lt;br&gt;
The Tool: Crilio is a free, open-source CLI that automates this in CI/CD.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is LLM-as-a-Judge?&lt;/strong&gt;&lt;br&gt;
Since we cannot do exact string matching on generative AI, we have to evaluate outputs semantically.&lt;/p&gt;

&lt;p&gt;The "LLM-as-a-Judge" pattern uses a fast, cheap LLM to grade the output of your main LLM.&lt;/p&gt;

&lt;p&gt;Instead of writing Python code to check if a string contains a word, you write a rule in plain English:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Must mention the 30-day return window."
"Must NOT mention competitor names like Amazon or Walmart."

You send your Target LLM's response and the rule to the Judge LLM. The Judge returns a strict JSON object: {"rule_passed": false, "reason": "Mentioned Amazon"}.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the Judge says the rule failed, your CI/CD pipeline fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Implement This in CI/CD&lt;/strong&gt;&lt;br&gt;
I was manually testing prompts before every git push, and it was driving me crazy. So I built Crilio, a lightweight Python CLI that acts like Jest for LLM prompts.&lt;/p&gt;

&lt;p&gt;It uses the BYOK (Bring Your Own Key) model, so you use your own OpenAI or Anthropic keys, and it costs fractions of a cent to run.&lt;/p&gt;

&lt;p&gt;Here is how you set it up in under 2 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install and Initialize&lt;/strong&gt;&lt;br&gt;
Install the CLI via PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install crilio
crilio init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Define Your Test Rules&lt;/strong&gt;&lt;br&gt;
Open the crilio.yaml file and write your test prompts and the strict rules the AI must follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
yaml

crilio.yaml
tests:
  - name: "Refund Policy Check"
    prompt: "How long do I have to return a product?"
    rules:
      - "Must mention the 30-day return window."
      - "Must NOT mention competitor names like Amazon or Walmart."
      - "Tone must be polite and professional."


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Run the Tests Locally&lt;/strong&gt;&lt;br&gt;
Add your API key to your environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export OPENAI_API_KEY="sk-..."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Run the tool:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;crilio run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Crilio will call your Target LLM (e.g., GPT-4o), capture the response, and send it to the Judge LLM (GPT-4o-mini). If the AI broke a rule, Crilio prints a beautiful red ❌ report in your terminal and exits with an error code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The Gatekeeper: GitHub Actions&lt;/strong&gt;&lt;br&gt;
The real magic happens when you put this in your CI/CD pipeline. Create a file at .github/workflows/crilio.yml in your repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yaml

name: Crilio AI Tests
on: [pull_request]
jobs:
  test:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.10'
      - run: pip install crilio
      - run: crilio run
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, whenever a developer creates a Pull Request, GitHub automatically runs Crilio. If their prompt change causes the AI to hallucinate or break a rule, the GitHub Action fails. The PR is blocked from merging.&lt;/p&gt;

&lt;p&gt;You have just turned your non-deterministic AI into a tested, reliable software component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Works Better Than Manual Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Catches Cascading Breakages&lt;/em&gt;: You might fix a refund bug, but accidentally break the shipping policy. The Judge catches both.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Zero Infrastructure&lt;/em&gt;: Because Crilio uses BYOK, you don't need to host a database or an evaluation server. It runs entirely in your GitHub Actions runner.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Developer Experience&lt;/em&gt;: Developers don't have to learn a complex observability platform. They just write a YAML file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Roadmap&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Crilio is completely free and open-source (AGPL). Right now, it supports OpenAI and Anthropic, and it runs perfectly in the terminal and CI/CD.&lt;/p&gt;

&lt;p&gt;The next step is building a Cloud Dashboard so teams can view historical regression data over time (which will be the paid tier).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Give it a Try&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are tired of playing whack-a-mole with your AI prompts, I’d love for you to try Crilio and give me your brutal feedback.&lt;/p&gt;

&lt;p&gt;GitHub Repo: &lt;a href="https://github.com/mukundzha/crilio" rel="noopener noreferrer"&gt;https://github.com/mukundzha/crilio&lt;/a&gt;&lt;br&gt;
PyPI: pip install crilio&lt;/p&gt;

&lt;p&gt;If you found this helpful, drop a ⭐ on the repo—it helps other developers find it! Let me know in the comments how you are currently handling prompt testing in your CI/CD pipelines.And also give me some suggestions regarding upcoming features.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>testing</category>
      <category>openai</category>
    </item>
  </channel>
</rss>
