{"slug": "william-a-tiny-poetry-model-in-the-browser", "title": "William: A tiny poetry model in the browser", "summary": "William, a tiny poetry language model trained by a developer, runs entirely in the browser using ONNX Runtime Web. The 6-layer transformer was trained on the Gutenberg Poetry Corpus and fine-tuned on Poetry Foundation poems, then quantized to a 14 MB int8 model. Users can edit a title line and generate short poems locally without any server endpoint.", "body_md": "# William: a tiny poetry model in the browser\n\nWilliam is a tiny local language model I trained to write short poems. The model on this page is loaded by the browser and sampled locally, one token at a time. There is no server endpoint behind the button.\n\nloading William...\n\nThe title line is editable. William tokenizes it in the browser before generating the poem.\n\nWilliam is a small decoder-only transformer: 6 layers, 384 hidden dimensions,\n6 attention heads, and a 256-token context window. I trained it locally with\n[MLX](https://github.com/ml-explore/mlx) on Apple Silicon.\n\nThe training pipeline was two-stage. First, the model learned general\npoem-shaped text from the\n[ biglam/gutenberg-poetry-corpus](https://huggingface.co/datasets/biglam/gutenberg-poetry-corpus)\nline corpus after filtering out Project Gutenberg boilerplate, headers,\neditorial apparatus, prose-like blocks, and non-English fragments. Then I\nfine-tuned it on title/body poem pairs from\n\n[, with extra filtering for rows that were too long or too prose-like for the short context window. I also used](https://huggingface.co/datasets/suayptalha/Poetry-Foundation-Poems)\n\n`suayptalha/Poetry-Foundation-Poems`\n\n[locally as a grading model to help reject low-fitness fine-tuning rows and audit pretraining artifacts.](https://huggingface.co/prism-ml/Bonsai-8B-mlx-1bit)\n\n`prism-ml/Bonsai-8B-mlx-1bit`\n\nFor this page, the MLX checkpoint was converted to ONNX and dynamically quantized to int8. The page downloads that static model file and runs it with ONNX Runtime Web in your browser; the model asset is around 14 MB.", "url": "https://wpnews.pro/news/william-a-tiny-poetry-model-in-the-browser", "canonical_source": "https://akshit.org/2026/06/21/william/", "published_at": "2026-06-27 11:32:59+00:00", "updated_at": "2026-06-27 12:05:00.946499+00:00", "lang": "en", "topics": ["large-language-models", "generative-ai", "ai-tools", "ai-research"], "entities": ["MLX", "ONNX Runtime Web", "Gutenberg Poetry Corpus", "Poetry Foundation", "Bonsai-8B-mlx-1bit", "Apple Silicon"], "alternates": {"html": "https://wpnews.pro/news/william-a-tiny-poetry-model-in-the-browser", "markdown": "https://wpnews.pro/news/william-a-tiny-poetry-model-in-the-browser.md", "text": "https://wpnews.pro/news/william-a-tiny-poetry-model-in-the-browser.txt", "jsonld": "https://wpnews.pro/news/william-a-tiny-poetry-model-in-the-browser.jsonld"}}