# I built a language model that only learns when someone pays $2.49

> Source: <https://dev.to/dnilgis/i-built-a-language-model-that-only-learns-when-someone-pays-249-4m56>
> Published: 2026-11-03 23:04:01+00:00

Most AI labs take their training data for free and charge you for the output. I wanted to see what happens if you flip that. You pay for the input, and the output is free.

The result is [brAIAIn](https://www.braiain.com), a parody AI lab with a real model behind it. The model knows exactly what people have paid to tell it, and nothing else. Each sentence someone buys becomes a new model version, with its own release notes, a research paper, a status page incident, and benchmark scores. It currently has 476 parameters and scores 0.0% on GSM8K.

The joke only works if the machinery is real, so here is how it runs. It runs on no servers, no database, no webhooks, and a hosting bill of $0.

`pip install`, anywhere.
A webhook needs something always listening, and I didn't want to run a server. So the workflow runs on a schedule, every 10 minutes. It asks the Stripe API for completed Checkout Sessions on the Payment Link, using a restricted Stripe key.

A sentence arrives as a custom field on the checkout. The trainer:

Retraining everything on every run sounds wasteful, but the whole model is smaller than this article. It also means that removing a sentence actually removes it, from every version, on the next run. There is no "the weights remember."

GitHub's scheduler is often late, sometimes by a lot. An external free cron service calls the `workflow_dispatch` endpoint as a backup, so a purchase usually goes live within minutes.

It is a word-level trigram model with backoff. That is a count of which word follows each pair of words, and of which word follows each single word for when it has never seen the pair.

``` python
def train(passages):
    tri, bi, uni = {}, {}, {}
    for p in passages:
        toks = [BOS, BOS] + tokens(p) + [EOS]
        for i in range(2, len(toks)):
            a, b, c = toks[i - 2], toks[i - 1], toks[i]
            k = a + " " + b
            tri.setdefault(k, {})
            tri[k][c] = tri[k].get(c, 0) + 1
            bi.setdefault(b, {})
            bi[b][c] = bi[b].get(c, 0) + 1
            if c != EOS:
                uni[c] = uni.get(c, 0) + 1
    return {"tri": tri, "bi": bi, "uni": uni}
```

The "parameters" on the spec sheet are real. They are the number of distinct word pairs and triples it has counted.

Two details make it feel more like a real lab's model than it has any right to:

The trained model is exported as a small JSON file. The chat page loads it and samples from it in JavaScript:

``` js
while (out.length < maxWords) {
  var k = a + " " + b, c;
  if (m.tri[k]) c = pick(m.tri[k]);
  else if (m.bi[b]) c = pick(m.bi[b]);
  else break;
  if (c === EOS) break;
  out.push(c); a = b; b = c;
}
```

It generates eight candidates and keeps the one that shares the most words with your question. That is the entire "alignment" layer. It does not understand the question. It is just more likely to repeat some of it back, which in fairness is also how a lot of meetings work.

Inference costs nothing because your laptop is the GPU.

The trainer runs each version on a handful of real benchmark questions, including GSM8K grade-school math. It reports the score next to the best published scores from real model papers, with sources. brAIAIn scores 0.0%. The site has a [side-by-side page](https://www.braiain.com/versus.html) showing each problem, the correct answer, and what brAIAIn said instead.

`amount_subtotal`. That way an old $50 link and a new $24.99 link both come out as "naming."
Lifetime revenue so far is $10. The unit economics are excellent, because the unit is a sentence and the cost of goods is zero.

Ask it something at [braiain.com](https://www.braiain.com). The answer will be confident and wrong. If you want it to know something, it is $2.49, and you get release notes.

The code, the corpus, and every version are public in the repo.
