{"slug": "midnight-ink-ghost-stories-written-by-ai-inside-your-browser", "title": "Midnight Ink: Ghost Stories Written by AI Inside Your Browser", "summary": "A developer built Midnight Ink, a ghost-story generator that runs entirely in the browser using the open-weight SmolLM2-360M-Instruct model via its ONNX Community conversion, Transformers.js 3.8.1, and ONNX Runtime's WebAssembly backend. The quantized model runs in a dedicated Web Worker so generated text streams into the interface without blocking it, and the first generation downloads roughly 370 MB of model assets with no API key or paid inference service. The developer notes the small model sometimes writes poetry instead of prose, repeats itself, or misses requested details, and there is no prewritten fallback.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26).*\n\nMidnight Ink is a ghost-story generator powered by an open-weight AI model running inside your browser.\n\nChoose an eerie setting, a haunted object, and a mood, then summon a story. Watch the words appear as they are generated, stop whenever you want, and copy or download the result.\n\nMy interpretation of “Ghost in the Machine” is literal: the storyteller lives on the visitor’s own device.\n\nThe first generation downloads approximately 370 MB of model assets. No API key or paid inference service is required.\n\nThe application uses HTML, CSS, JavaScript, and a dedicated Web Worker. Serve the included dist folder over HTTP to run it.\n\nThe application uses SmolLM2-360M-Instruct through its ONNX Community conversion, with Transformers.js 3.8.1 and ONNX Runtime’s WebAssembly backend.\n\nThe quantized model runs in a Web Worker, keeping the interface responsive while generated text streams into the manuscript panel.\n\nStory prompts are processed locally. Initial library and model downloads require an internet connection; guaranteed offline startup is not implemented.\n\nA successful browser test downloaded the model and streamed actual generated text. The small model sometimes writes poetry instead of prose, repeats itself, or misses requested details. There is no prewritten story fallback.\n\nDownloadable model weights make on-device generation possible without sending story prompts to a remote inference API.\n\nThe model is visible and replaceable. Developers can experiment with compatible alternatives and balance writing quality, download size, memory, and speed.\n\nThe tradeoff is a substantial initial download and performance that depends on the visitor’s device.\n\nBuilt with ChatGPT/Codex assistance for implementation, styling, testing, and this write-up.\n\nThanks to Hugging Face’s SmolLM team, ONNX Community, Transformers.js, and ONNX Runtime.", "url": "https://wpnews.pro/news/midnight-ink-ghost-stories-written-by-ai-inside-your-browser", "canonical_source": "https://dev.to/beyza_begmartan_89806c3/midnight-ink-ghost-stories-written-by-ai-inside-your-browser-3fcl", "published_at": "2026-10-27 17:38:08+00:00", "updated_at": "2026-10-27 17:42:27.117646+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "generative-ai", "ai-tools", "developer-tools"], "entities": ["SmolLM2-360M-Instruct", "Transformers.js", "ONNX Runtime", "Hugging Face", "ONNX Community", "Midnight Ink"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/midnight-ink-ghost-stories-written-by-ai-inside-your-browser", "markdown": "https://wpnews.pro/news/midnight-ink-ghost-stories-written-by-ai-inside-your-browser.md", "text": "https://wpnews.pro/news/midnight-ink-ghost-stories-written-by-ai-inside-your-browser.txt", "jsonld": "https://wpnews.pro/news/midnight-ink-ghost-stories-written-by-ai-inside-your-browser.jsonld"}}