cd /news/artificial-intelligence/midnight-ink-ghost-stories-written-b… · home › topics › artificial-intelligence › article
[ARTICLE · art-158930] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Midnight Ink: Ghost Stories Written by AI Inside Your Browser

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.

by read1 min views1 publishedOct 27, 2026

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine. Midnight Ink is a ghost-story generator powered by an open-weight AI model running inside your browser.

Choose 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.

My interpretation of “Ghost in the Machine” is literal: the storyteller lives on the visitor’s own device.

The first generation downloads approximately 370 MB of model assets. No API key or paid inference service is required.

The application uses HTML, CSS, JavaScript, and a dedicated Web Worker. Serve the included dist folder over HTTP to run it.

The application uses SmolLM2-360M-Instruct through its ONNX Community conversion, with Transformers.js 3.8.1 and ONNX Runtime’s WebAssembly backend.

The quantized model runs in a Web Worker, keeping the interface responsive while generated text streams into the manuscript panel.

Story prompts are processed locally. Initial library and model downloads require an internet connection; guaranteed offline startup is not implemented.

A 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.

Downloadable model weights make on-device generation possible without sending story prompts to a remote inference API.

The model is visible and replaceable. Developers can experiment with compatible alternatives and balance writing quality, download size, memory, and speed.

The tradeoff is a substantial initial download and performance that depends on the visitor’s device.

Built with ChatGPT/Codex assistance for implementation, styling, testing, and this write-up.

Thanks to Hugging Face’s SmolLM team, ONNX Community, Transformers.js, and ONNX Runtime.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @smollm2-360m-instruct 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/midnight-ink-ghost-s…] indexed:0 read:1min 2026-10-27 · —