From modules to models: the npm package becomes a classifier
gpu-lexer is a syntax highlighter with 41,321 parameters that ships as a 27.4KB npm import and runs on WebGPU. It agrees with Shiki on 88.02% of held-out token labels, and on ten copies of three.min.js it finishes in 402ms where Shiki takes 29.6 seconds. Three days later gpu-time did the same for dates: 24,761 parameters that read "every other Friday at noon" and hand back real occurrences plus an RFC 5545 recurrence rule. Two in a week is a genre.
The genre has a shape worth naming before it gets a name of its own. The small npm module that solved one fuzzy thing — Prism and highlight.js for tokens, chrono for dates — is becoming a small model that solves the same thing. Those modules were always heuristics: hand-maintained grammar files and regexes that were slightly wrong in ways nobody rioted over. A model that is slightly wrong in a different way is a fair trade for them. That is the whole market, and it is real.
This isn't new, but the labels are
Tiny models inside ordinary software are two decades old. Bayesian spam filters, spell-check, and autocomplete were all small learned classifiers before "language model" meant anything to the public. What is new is narrower. First, the packaging: an npm install, a WebGPU kernel, and a training run that fits in a weekend on one machine. Second, and more interesting, where the labels came from. gpu-lexer did not hire annotators. It ran Shiki over 4,688,781 tokens of source and treated Shiki's output as truth. That is a grammar being distilled into weights — not code replaced by a model, but code compiled into one, with the compiler's quirks baked in.
The distillation is why the language-agnostic claim holds. A segmentation
model doesn't know what a car is; it knows which arrangements of edges get
labeled "car" by whoever built the training set. gpu-lexer treats each token
as a pixel and the file as a one-row image, and learns that
[word] [word] = [thing] puts a keyword in the first slot without knowing
whether that keyword is const, val, or auto. A grammar-based
highlighter encodes that pattern once per language. This encodes it once.
That is the real argument, and it is why Vue, Svelte, and Astro work here
when Prism still doesn't ship them.
The analogy breaks exactly where the scores do. Pixels have strong spatial locality; code doesn't. Whether a token is a type or a function can hang on a declaration 400 lines up, and templating languages are mixed-context by construction. gpu-lexer's own table shows it: ActionScript, Dart, JSX, Python, Svelte, and TSX land at 95–100% agreement, while VB and Jinja fall under 50%. Locality lies there, and the model has no way to know.
What you buy, and what you give up
The purchase is easy to state. One code path for every language, present and future. A speed gap of two orders of magnitude on a large file. No grammar to maintain, ever.
The cost is the contract. Four things change when a module becomes a model:
- The source can't be read. There is no rule to open and fix when a label is wrong. There is a dataset, and a retrain.
- Tests become a score. The spec for gpu-lexer is "88.02% agreement with Shiki." That number is the whole guarantee, and it is a population statement — it says nothing about the file in front of you.
- Changes are datasets, not PRs. Teaching the model a new construct means adding labeled examples and training again. Nobody reviews a diff.
- Versions drift everywhere at once. A retrain moves every label a little. Two releases of a regex agree on every input they both handle; two releases of a model don't promise that.
The module ships with a score instead of a spec. For highlighting, that trade is obviously fine. For gpu-time it is less obvious, because "October 2 at eight pm" landing on October 3 is a missed meeting, not a wrong color.
Agreement is not correctness
The weak criticism of gpu-lexer is "it's sometimes wrong," and the author is right to swat it. Highlight.js has been wrong on ordinary JavaScript for years. The stronger criticism, which nobody in the launch thread made, is that agreement with Shiki is not correctness. Every quirk in every Shiki grammar is now ground truth. The model's taste is Shiki's taste, forever, and the ceiling on how good it can get is how good Shiki already was. Borrowing a labeler is what made the project buildable in a weekend. It is also what fixed its ceiling on day one.
gpu-time made a different choice, and it is the one I'd expect to define the genre. Reading the demo, the model only labels tokens — this word is a weekday, that one is an hour, this one means "recurring" — and ordinary code does the calendar arithmetic. The fuzzy surface goes to the network; the exact part stays deterministic. A 24K-parameter model can't be trusted to add. It can be trusted to notice.
That split also says what should not become a model: anything with an
oracle you could just write. isEven stays a function. A chess move's
legality stays a rules engine. The rule of thumb is to hand the model only
the part of the module that was already a heuristic, and keep the rest as
code.
Where the studio sits
None of this is an instrument. gpu-lexer and gpu-time end in an argmax — take the highest-scoring label, done — so there is no temperature, no sampler, nothing for a player to feel. They read an input and say what it is. The studio's models read a prefix and produce something new. That is encoder versus decoder, oracle versus character, a fixed menu of answers versus a distribution you play. Same phrase, "small model," opposite success criteria.
What the week did prove is the pipe. A model as a static asset, running client-side at production quality with no server and no download step, is the path the logits oracle note laid out for the studio's own player. gpu-lexer walked the whole path in a browser, and int6 packing plus a WebGPU kernel is the part worth stealing.
The week did not prove the thesis. Both releases are models that do a job. The studio's bet is on models that have a character, and that still has to be argued for on its own. The next question is the one these two projects sidestep: what a classifier looks like when a person, not an oracle, decided what the labels mean. That is the next note.