---
title: "How a local copy of Gemini won Best Use of Gemma at Junction 2026 — Asror Wali"
description: "At Junction 2026 I called the real Gemini API on fake clinic messages and fine-tuned Gemma into a local decision model, reranker and transcriber, so real patient messages never leave the clinic. It won one of the three Best Use of Gemma prizes."
url: "https://asror.dev/blog/junction-2026-gemma"
---

# How a local copy of Gemini won Best Use of Gemma at Junction 2026

At Junction 2026 I called the real Gemini API on fake clinic messages and fine-tuned Gemma into a local decision model, reranker and transcriber, so real patient messages never leave the clinic. It won one of the three Best Use of Gemma prizes.

Published Nov 17, 2026

[AI](https://asror.dev/blog?topic=ai)

![](https://asror.dev/_astro/hero-gemini-and-copy.Cgc5pXII_2jd8ch.webp)

[Rahmakyan/gemma-lab Open source · MIT · the code, the fake data and the benchmark reports ](https://github.com/Rahmakyan/gemma-lab)

Last weekend at [Junction 2026](https://www.hackjunction.com/) in Espoo, my project won Google DeepMind’s **Best Use of Gemma** challenge, as one of three winning teams. The prize has no ranking between the three, and each team gets €1,000.

The project answers one question: how do you use a strong AI model on data that must never go to a public API? My example was a clinic inbox full of patient messages. Gemini sorts them well, but you can’t send it real patient messages. So I called the real Gemini API on _fake_ messages, and used its answers to fine-tune small Gemma models that run on a laptop.

I turned Gemma into three things it isn’t out of the box:

- **a decision model** that sorts each message by urgency and team, and agrees with Gemini on 91.7% of answers on messages it never saw (plain Gemma: 40.3%);
- **a reranker** that puts the inbox messages that match a staff search first;
- **a transcriber** that writes down voicemails, built on EmbeddingGemma 2, a model that can hear but can’t write.

![The Best Use of Gemma winners on the Junction 2026 stage: Manchester Cool Dudes, Speediskey and Rahmy](https://asror.dev/_astro/stage-winners.B_mercO0_2n4RRa.webp)

Rahmy was a team of one: me.

## The problem: patient data can’t go to an API

A clinic inbox fills up with refill requests, billing questions, and now and then a voicemail where someone’s dad can’t speak properly. Someone has to read every one and decide how urgent it is and who should handle it.

A model like Gemini does this well. But patient messages, health records and legal or HR cases are exactly the data you’re not allowed to send to someone else’s server. The models you _can_ run locally, like a 1B Gemma, are small and don’t know the task.

## The idea: the real API on fake data, then fine-tune Gemma

The fix is distillation: a big “teacher” model labels examples, and a small “student” model is fine-tuned to give the same answers. The trick is what goes into the teacher. It’s the real, production Gemini API, but it only ever sees fake data. That makes it safe to call as often as you like, and the labels it gives are the real thing.

1. **Write fake messages.** Gemini writes realistic, made-up patient messages.
2. **Label them with the real API.** The Gemini Decisions API answers four questions about each fake message, with a probability for each option.
3. **Fine-tune Gemma on those labels** on a rented GPU on [Modal](https://modal.com).
4. **Run the fine-tuned Gemma on real messages, on your own machine.** The real data never leaves it.

I used this loop three times. For the decision model and the reranker, Gemini labels fake messages. For the transcriber, Gemini writes fake voicemails and speaks them, so the audio and the true text both come from the API.

## Step 1: 1,566 fake clinic messages

Fake data is only useful if it covers the real cases. So each message starts as a tuple of six traits: topic, urgency, who is writing, how clear they are, their style, and the channel. Here is one tuple:

> prescription refill · routine · a parent of a young child · very worried about a minor problem · formal · voicemail transcript

Gemini turns each tuple into a message, and a realism filter drops the ones that read wrong. About 85% pass. I split the test set in two: _coverage_ messages that look like normal traffic, and _challenge_ messages built to be tricky, like that worried parent asking for a routine refill.

## Step 2: four questions, with probabilities

The Gemini Decisions API answers typed questions and gives a probability for every option, not only the top answer. I used one question of each type:

| Question | Type | Asks |
| --- | --- | --- |
| `triage` | choice | emergency, same day, routine or admin? |
| `route` | choice | nurse, doctor, pharmacy, front desk or billing? |
| `callback_today` | yes/no | must a clinician phone back today? |
| `severity` | score | none to critical, five levels |

The probabilities matter. A message that Gemini rates 55% routine and 30% same day teaches the student something that a plain “routine” label doesn’t.

## Step 3: fine-tune Gemma into a decision model

I trained three students on 1,125 messages and tested them on 296 they never saw:

- **Gemma 3 1B + LoRA.** A small adapter on top of Gemma 3 1B learns to match Gemini’s probabilities. It reads the answer straight from the probabilities of the option words, in one pass.
- **EmbeddingGemma + LoRA.** EmbeddingGemma turns a message into one vector, and a simple classifier per question reads the answer from it. The adapter and the classifiers learn together.
- **EmbeddingGemma, frozen.** The same, but only the classifiers learn.

| Student | Agrees with Gemini | Train time | Time per message |
| --- | --- | --- | --- |
| Always give Gemini’s average answer | 56.8% | – | – |
| Plain Gemma 3 1B, no training | 40.3% | – | – |
| Gemma 3 1B + LoRA | **91.7%** | 16 min | 92 ms |
| EmbeddingGemma + LoRA | 91.0% | 2.5 min | 5.6 ms |
| EmbeddingGemma, frozen | 86.7% | 10 s | 4.4 ms |

“Agrees” means the student’s top answer is Gemini’s top answer, averaged over the four questions. Times are on an NVIDIA A10.

## What the numbers say

**Plain Gemma is worse than a constant guess.** Untrained, Gemma 3 1B scores 40.3%, below the 56.8% you’d get by always giving Gemini’s average answer. A small model doesn’t know the task. After training it does.

**The small embedding model is almost as good and 16 times faster.** The EmbeddingGemma student is 0.7 points behind the Gemma 3 1B student, trains in a sixth of the time and answers in 5.6 ms instead of 92 ms. For a busy inbox, that’s the one I shipped in my demo app.

**More fake data kept helping.** On the same 137 test messages, the Gemma student went from 88.9% to 90.9% with a bigger adapter, and to 92.3% with twice the data. More fake messages only cost Gemini calls, so this is the cheapest lever.

**Newer wasn’t better.** EmbeddingGemma 2 scored below the first EmbeddingGemma, at 88.8% against 91.0%. It lost on search as well.

## The same loop makes a reranker and a transcriber

A clinic inbox needs more than triage, so I turned Gemma into two more tools.

**The reranker.** Gemini wrote 200 fake staff searches and graded every message against every search. On 36 test searches, a Gemma 3 1B student that reads the search and the message together reaches an NDCG@10 of 0.800 (1.0 means it ranks exactly like Gemini). Plain EmbeddingGemma gets 0.652 and plain Gemma 0.451. An EmbeddingGemma student is a bit worse at 0.776, but its message vectors can be stored, so a search takes 0.17 ms per message instead of 20 ms. The test set is small, so treat those numbers as rough.

**The transcriber.** EmbeddingGemma 2 has an audio encoder, so it can hear, but it can’t write text. I trained a small reader (20M numbers) that maps each 40 ms of sound into EmbeddingGemma 2’s text space and picks the closest of about 200,000 English words. Training data was 460 hours of [LibriSpeech](https://www.openslr.org/12) plus fake voicemails: Gemini wrote the scripts, spoke them with 30 voices, and I added a phone-line effect.

| Transcriber | Word error rate on phone voicemails |
| --- | --- |
| Gemini’s own transcriber (the bar) | 2.8% |
| 100 h of audio, small reader | 11.6% |
| 460 h, bigger reader | 9.3% |
| \+ overlapping 30 s windows | 8.1% |
| \+ a word language model | 6.9% |

It’s still more than twice Gemini’s error rate, and the errors are the kind that matter. In one test voicemail, “his speech sounds kind of slurred” came out as “kind of blurred”. Slurred speech is a stroke sign.

## A local API with the same shape as Gemini’s

The local server takes the same request as the Gemini Decisions API and gives the same answer shape. An app switches from Gemini to the local copy by changing one URL. It listens on `127.0.0.1` only and keeps nothing it reads:

```sh
curl -s 127.0.0.1:8250/v1/decisions -H 'content-type: application/json' -d '{
  "input": "my dad is very confused since this morning and his face looks droopy",
  "questions": {"triage": {"type": "choice", "instructions": "How urgent?",
    "criteria": {"emergency": "…", "same_day": "…", "routine": "…", "admin": "…"}}}}'
```

It also has `/v1/rerank` for search and `/v1/transcribe` for audio. The demo page puts Gemini’s triage slip on top of the local one, so you can lift it and compare the two on each test message.

## Kotona: a healthcare app to show the models at work

Benchmarks don’t show what a model is for, so I also built Kotona, a healthcare app that uses all three tools. It’s for people who are back home after TMS treatment for depression. Each day they say or type a few sentences about how they slept, what they did and how they feel.

- The **transcriber** writes down what they said, and the audio is deleted.
- The **decision model** reads the words and answers four questions, each with a probability: the mood, a sign of relapse, contact today, and the main topic.
- The care team gets a short list of who to call today and why, and uses the **reranker** to search the check-ins in plain words, like “sleeping worse”.

A fixed safety rule reads every check-in before the model does. Words about self-harm put the person at the top of the care team’s list, and the model can add a flag but never clear one. All three models run on the clinic’s own server. Kotona uses the EmbeddingGemma decision model, because Gemma 3 1B is more accurate but too large and slow for a small clinic server.

## How it won

The challenge had one criterion: the best use of Gemma, judged on a creative use, strong technical work and a real-world problem. I think four things got it there.

- **Gemma did the job a big model couldn’t do there.** The point was not “Gemma as a cheaper Gemini” but “Gemma where Gemini is not allowed”.
- **Gemma turned into three new tools.** Out of the box, none of these models is a decision model, a reranker or a transcriber. Fine-tuned on the real Gemini API’s answers to fake data, Gemma 3 1B and EmbeddingGemma became the decision model and the reranker. EmbeddingGemma 2’s audio encoder became the ear of the transcriber.
- **Every claim had a number.** Each student was scored against Gemini, plain Gemma and a constant guess, on messages it never saw, including where it still falls short.
- **A real app, not only a benchmark.** Kotona showed the three Gemma tools doing a job for a care team, with every check-in kept on the clinic’s server.

The code, the fake data and every benchmark report are in [Rahmakyan/gemma-lab](https://github.com/Rahmakyan/gemma-lab).
