Skip to content
Eya Ammari, back to top
Back to the portfolio

Personal project

Lahja

Regression testing for multilingual chatbots: before switching to a cheaper LLM, Lahja checks per language, in French, Arabic and Tunisian Derja, whether answer quality really dropped.

The problem

Switching a chatbot to a cheaper model saves money, but quality can drop in one language and not in another, and an AI judge can be wrong about a dialect like Tunisian Derja. Lahja runs both models on the same test set and says, language by language, whether quality really dropped or whether the difference is just noise.

What it does

  • Runs the current model and a candidate model on the same test set, several times per case, and resumes a run where it stopped.
  • A blind LLM judge grades every answer with written rubrics.
  • A labeling command lets a human grade answers blind, with a preview that keeps Arabic readable.
  • Measures how far the judge can be trusted in each language and script with Cohen’s kappa, written by hand, with a bootstrap confidence interval.
  • A paired bootstrap comparison gives the verdict: pass, fail, inconclusive, or judge not trusted, with Markdown and JSON reports.

Key decisions

  1. 01

    Trust the judge per language

    An AI judge can be right in French and wrong in Derja, so Lahja measures its agreement with reviewed labels separately for each language and script, with Cohen’s kappa, and can answer “judge not trusted”.

  2. 02

    A real drop, or noise?

    A paired bootstrap compares the two models on the same cases, and the verdict can be pass, fail or inconclusive when the data cannot decide.

  3. 03

    Statistics written by hand

    Cohen’s kappa and the paired bootstrap are written by hand with NumPy, not taken from a statistics library.