DEV Community

Yuva Kunaal
Yuva Kunaal Subscriber

Posted on

I made a 4B local model grade mock interviews, and it has to quote you before it can mark you down

I built Local AI Interviewer, an open-source mock-interview coach that runs on your own computer. You give it questions, or let it build them from your resume. It asks them out loud, takes your typed or spoken answer, asks a follow-up when your answer leaves a gap, and ends with a scored report that explains every mark.

GitHub logo Yuvakunaal / local-ai-interviewer

Private mock interviews for tech roles, graded by an AI on your own computer. Evidence-checked scoring, voice, questions from your resume. Optional free Groq cloud.

Local AI Interviewer logo

Local AI Interviewer

Private mock interviews for tech roles, graded by a local LLM on your own computer.

CI Latest release License: MIT Runs locally with Ollama

Quick start · Features · How it works · Docs · Contributing · Roadmap

Demo: pick a preset and start; a question about Snowflake is spoken and answered, a follow-up is asked, and the report shows the score with each mistake quoted from the answer and marked verified or not verified

Practise interviews for any tech role (software, data, cloud, security, ML, QA, DevOps and more). The app asks your questions aloud, listens to your typed or spoken answer, asks a follow-up when one is worth asking, and ends with a scored report that explains every mark. It can also build questions from your own resume.

  • Private by default. The AI runs on your own computer through Ollama. No account, no API key, no telemetry, and your answers never leave the machine.
  • Graded with evidence. The grader has to quote your own words for every mistake it claims. A mistake it cannot quote is shown as unverified and is not counted against you. How grading works
  • No GPU…

The default model is qwen3.5:4b through Ollama, and I built and tested everything on an 8 GB MacBook Air. That choice made one problem much bigger than the rest: can you trust a 4B model to grade you?

The problem with a small grader

A small model is private, free and fast enough on a laptop. It is also happy to tell you that you said something you never said. In a mock interview, that's the worst possible failure: you lose points for a mistake you didn't make, and you start doubting answers that were right.

So I stopped treating the model's output as the verdict and started treating it as evidence to be checked. Two rules do most of the work.

Rule 1: the model doesn't set the score

The model returns a JSON object with ratings on a few dimensions (correctness, depth, clarity and so on), the points you got right, and the points it thinks you got wrong. The app turns the ratings into a score, using a profile for the subject: SQL, Python, system design and behavioural questions are weighted differently. The model also never decides what happens next in the interview. The app's state machine does.

Rule 2: every criticism needs a quote

Every "you got this wrong" claim has to quote the answer. Before a claim is shown as a mistake, the app checks that the quote really occurs in what you said. Here's a simplified version of the check:

def quote_in_answer(quote, answers, min_words=2):
    # norm(): lower-case, keep letters and digits, collapse spaces
    fragments = [norm(f) for f in re.split(r"\.\.\.|…", quote) if norm(f)]
    if sum(len(f.split()) for f in fragments) < min_words:
        return False                      # a one-word "quote" proves nothing
    for answer in answers:
        hay, pos = f" {norm(answer)} ", 0
        for f in fragments:               # "..." may skip words, but the order must hold
            i = hay.find(f" {f} ", pos)
            if i < 0:
                break
            pos = i + len(f)
        else:
            return True
    return False
Enter fullscreen mode Exit fullscreen mode

(the real one is here)

A mistake the app can't back with a quote stays visible, labelled unverified, but it's left out of the mistakes list and out of the correct/incorrect verdict. To be precise about the limit: the score still comes from the model's dimension ratings, and an invented mistake may have pulled those down a little. The quote check stops invented mistakes from being reported as yours. It doesn't make the model's ratings perfect.

Did it work?

I wrote a benchmark: 10 technical questions, each with five answers (strong, partial, subtly wrong, wrong, and "I don't know"), plus 6 prompt-injection attempts. That's 56 answers, each graded three times by the real local model, with the expected score bands written down before the first run.

Measure Result
Answer pairs ranked in the right order 70 / 70
Answers inside their expected score band 55 / 56
Quotes the grader cited that are really in the answer 273 / 279
Spread when the same answer is graded 3 times median 0.2, max 2.0 points

What it still gets wrong

  • It misses one subtle error every single time: an answer claiming that "a tuple that contains lists can be a dictionary key" is graded as correct. Small models can miss a plausible wrong claim, especially without a rubric.
  • Strong answers top out around 8.3/10, so the top of the scale is compressed.
  • I wrote the labels myself. This shows the scores rank answers sensibly. It doesn't show that a 7.8 means what a human interviewer would give.

The full write-up is in docs/evaluation.md.

The rest of the app

  • Resume-based questions. Upload a PDF; it's parsed locally into a profile of your skills, each linked to the resume line it came from, and questions about your real projects.
  • Adaptive interviews. The next question and its difficulty depend on your answers, with a plain-language reason for each choice.
  • Voice. Questions are spoken (a premium voice on Apple Silicon, your OS's offline voices elsewhere), and spoken answers are transcribed locally with Whisper.
  • Reports. Scores per skill, progress since your last attempt, a learning plan, and PDF, Markdown or JSON export.
  • Optional cloud. No GPU or not enough memory? Paste a free Groq key and grading runs there instead. It's off until you switch it on.

Under the hood: FastAPI, SQLite, React and TypeScript, with tests running on Windows, Linux and macOS in CI.

Try it

You need Python 3.10+, Chrome or Edge, and Ollama (or a Groq key). Download the zip from the latest release, unzip it, and run:

./setup-models.sh     # shows the download size, asks before downloading the model
./start.sh --open     # Windows: setup-models.bat, then start.bat
Enter fullscreen mode Exit fullscreen mode

Where I'd love help

  • Windows and Linux reports. Both pass CI, but nobody has done a full interview on them by hand yet.
  • A better benchmark. Answers labelled by people who actually run interviews would tell me far more than my own labels.
  • Feedback on the grading approach. If you've built LLM graders, I'd like to hear how you handled invented mistakes.

If this is useful to you, a ⭐ on GitHub helps other people find it.

Top comments (6)

Collapse
 
userxnom profile image
Abdullah Naseer •

The 'quote it or it doesn't count' rule is the part I'd steal — most small-model graders I've seen just assert, and the assertion is the whole product. The benchmark write-up is honest too, especially admitting the tuple-with-lists error it misses every single time. That kind of failure disclosure is what makes the 70/70 believable. Does the quote check ever backfire on strong answers that paraphrase well, where the model is right but can't find the exact words to prove it?

Collapse
 
yuva_kunaal profile image
Yuva Kunaal •

Thank you, really glad that part stood out!

Good question. The quote is checked against the candidate's own answer, not a reference answer. So a strong candidate explaining in their own words is never compared with textbook wording.

The risk is the AI paraphrasing the candidate instead of quoting them. Then the quote isn't found and the claim shows as "possible error, not counted". So it fails in the lenient direction: a real mistake can slip through, but a good answer can't be marked down by it. That's deliberate. For practice, a missed criticism costs less than an invented one.

In the benchmark, strong answers never triggered it: 90 of 90 quotes were found. All 6 that weren't found came from prompt-injection attempts (5) and one partial answer.

One honest limit: the score comes from the AI's ratings, so an error it believed but couldn't quote may still lower the rating slightly. Measuring how often it paraphrases a real mistake is next on my list.

Collapse
 
yuva_kunaal profile image
Yuva Kunaal •

if you like the repo and project, Please star it!

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

Making the grader quote the answer before a criticism counts is a neat check. A small model inventing mistakes is the exact failure that would sink a tool like this.

Collapse
 
yuva_kunaal profile image
Yuva Kunaal •

Thanks Odinaka! That was exactly the fear: a practice tool that blames you for things you never said does more harm than no tool.

The quote check only covers one direction, though. It stops invented mistakes, but it can't catch a real mistake the model simply misses. My benchmark has one it misses every time: "a tuple containing lists can be a dict key" gets marked correct. Catching those needs a better model or a rubric, not a quote check.

If you ever try it, I'd love to hear how the grading feels on your own answers.

Give it a try, and star the repo!

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the one-direction limit is a fair catch. a quote check stops invented mistakes, and the other direction still needs a reader.