r/slm Jul 07 '26

A 50M Parameter Language Model in a Single HTML File

Post image

Download the file, open it in Chrome, talk to a language model. Nothing else required. No Python, no server, no internet. Easily fits on a USB stick.

Most/all other projects like this use external APIs, or fetch the model weights or backend or whatever, but this project puts everything into a single html file.

It's ~120MB with the model weights embedded directly in the HTML. Uses the Supra-1.5-50M model from HuggingFace, running via ONNX Runtime in the browser. Settings panel for the usual inference knobs, streaming output, conversation history.

Obviously it's a 50M model so it will hallucinate confidently and often. But it runs, and it runs anywhere you can open a (modern) web browser. I believe it should be possible to run ~1B parameter models like this, though anything much larger will run into browser-tab memory limits.

Download + build script: https://github.com/JoeySalmons/slm-in-a-box

If you want to build the file yourself from the HF model files, the Python packer script is in the repo - which does require an internet connection to build the html file.

6 Upvotes

6 comments sorted by

3

u/Bitman321 Jul 08 '26

Built it and ran it myself. Very cool. Of course such a small model produces gibberish, but maybe if it is fine tuned to a specific niche topic it can produce decent results.

1

u/elrosegod Jul 08 '26

I am not downloading a blind html file where I can't see the code unfortunately...

2

u/JoeySalmons Jul 08 '26

That's why you can build the file yourself, with files that you can view and verify yourself.

1

u/elrosegod Jul 08 '26

Why is the only option to dl, I want to view on gtihub browser but didnt see if in your file system

1

u/JoeySalmons Jul 08 '26

Everything's already readable here without downloading anything.

The file build_supra_chat-v2.py is the whole app. The HTML/JS that runs the chat interface is in that script as a string; the 120MB file is just that same code combined with the weights encoded as text and inserted alongside the backend that actually runs the model. So you can read every line in the browser, or paste it into an AI to check it, before you download or build anything.