TinyGPT
A 13.8-million-parameter language model for Hindi and Hinglish, written from scratch. It runs right here, on your device: what you type never leaves this page.
Starting…
Decoding settings:
TinyGPT writes the way its training text reads — Hindi Wikipedia and Hinglish — but it learned the language, not the facts. Asked for the capitals of 20 states and countries, it puts the right city first only twice, no better than chance. Treat names, dates and places as invented.
A copy of the model fine-tuned on Hinglish-TOP finds what the request asks for (the intent) and the details an assistant would need (the slots).
TinyGPT is a decoder-only Transformer — the Llama recipe: rotary positions, RMSNorm, SwiGLU — trained from scratch on 18 million tokens of Hindi Wikipedia and Hinglish, on a laptop. Everything is written by hand: the tokenizer, the model, training, decoding, fine-tuning with LoRA, and the service.
How this page works
Your browser downloads the model files once (55 MB each, kept for your next visit) and does all the work itself: the tokenizer, the forward pass through every layer, the sampling. That code is a JavaScript copy of the Python version, checked against PyTorch: the same token ids, logits within a few millionths, and the same parses.
| Parameters | 13.8 million |
|---|---|
| Bits per byte on unseen text (lower is better) | – |
| Capitals of 20 places: right city ranked first | 2 of 20 (chance: 1) |
| Parser: whole parse right on unseen requests | – |
| Parser: intent right | – |
The parser is a twin of this model — pretrained the same way, minus Hinglish-TOP's validation and test requests — fine-tuned on 2,993 Hinglish-TOP requests. It writes the request back with brackets around the details. The code and a write-up of every step are on GitHub.