cd /news/artificial-intelligence/afterlight-ghost-in-the-machine · home › topics › artificial-intelligence › article
[ARTICLE · art-158561] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Afterlight: Ghost in the Machine 👻

A developer built Afterlight, a static browser-based ghost-story generator that runs the open-weight Xenova/flan-t5-small model locally via Transformers.js, requiring no backend, API key, or hosted inference service. The app lets users pick a premise, mood, and story length, and falls back to a built-in generator if the model fails to load. The developer argues browser inference gives more control over availability, pricing, and usage limits, while noting trade-offs around device memory and first-load caching.

by read5 min views1 publishedOct 27, 2026

This is a submission for the Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine.

Afterlight is a browser-based supernatural storytelling studio powered by open-weight AI.

The idea came from the thought that some stories never really disappear. They stay with us as memories, old photographs, forgotten places, and stories passed down through generations.

I wanted to build something that combined that feeling with AI. Afterlight lets users create atmospheric ghost stories by choosing a premise, selecting a mood, and adjusting the story length.

It also includes a feature called Keep a Memory Glowing, which lets users incorporate a meaningful detail, song, or memory into a fictional remembrance-inspired story.

I designed the interface around the atmosphere of the project: dark colours, moonlight-inspired accents, subtle textures, and a quiet, cinematic layout.

The project focuses on three things:

An offline-first supernatural story studio. It runs as a static website and uses Transformers.js to load the open-weight Xenova/flan-t5-small model directly in the browser. No Python, Flask, Ollama, API key, or backend server is required.

file://)

py -m http.server 8000

VS Code users can also use the Live Server extension and click Go Live.

The browser needs internet access on the first run to download Transformers.js and the model files. The first load can take a while. After the files are cached, inference runs in your browser; exact offline behavior depends on whether all assets have been cached and your browser settings.

If the model fails to load or your device cannot…

The application is designed to run as a static website. After the required model files have been downloaded, the model can perform inference in the browser.

The first run requires an internet connection to download the AI library and model. If model fails, the application switches to a built-in fallback story generator so users can still explore the interface.

GitHub repository: [Add your public GitHub repository URL here]

The project uses a simple, accessible structure:

index.html — the user interface and application layoutstatic/styles.css — visual design, responsive layout, and animationsstatic/app.js — story generation, browser model integration, and fallback handlingREADME.md — installation instructions and project documentation The code is structured so that the interface and model integration can be modified independently.

I built Afterlight using HTML, CSS, and JavaScript. Instead of creating a Python backend or depending on a hosted AI API, I used Transformers.js to run text generation directly in the browser.

The application is configured to use the Xenova/flan-t5-small model package. This allows the browser to load model files and perform inference on the user's device, rather than sending each prompt to a remote inference service.

The main workflow is straightforward:

I also added suggested story premises, a copy-to-clipboard feature, feedback, and responsive styling to make the application feel like a finished creative tool rather than a bare text-generation demo.

The goal was to keep the project easy to understand, run, and extend.

For me, open innovation is about having more control over the tools we build with.

When an application relies entirely on a closed, hosted AI service, its functionality can depend on API availability, pricing, usage limits, and decisions made by an external provider.

Afterlight explores a different approach.

By using a browser-based model, the application can perform inference on the user's device without requiring a paid inference API key. Prompts are processed locally by the application, rather than being sent to a hosted model endpoint.

This approach offers several advantages:

There are trade-offs, too. Browser inference depends on the device's available memory and processing power. The first model download requires internet access, and the quality of generated stories depends on the selected model.

Afterlight is a small experiment, but it demonstrates why open models and accessible tooling can make creative AI development more flexible.

Afterlight uses a browser-based text-generation pipeline rather than a separate agent framework.

The generation workflow takes the user's premise, mood, and length preference and combines them into a prompt. An optional remembrance detail can be included as creative context.

The application then attempts inference through Transformers.js. If the model cannot be loaded or returns an unusable result, the fallback logic takes over.

This keeps the application simple and makes the distinction between model-generated output and fallback-generated output visible to the user.

Agent session recording: Not applicable to this implementation; no separate agent-session recording is included.

The idea behind Afterlight is that a ghost does not always have to be frightening.

Sometimes, the things that linger are memories, places we miss, or stories that deserve to be remembered.

I wanted the application to capture both sides of that idea: the eerie atmosphere of a supernatural story and the warmth of remembering something meaningful.

The remembrance feature is deliberately framed as fiction. AI can help people express a feeling or build a story around a memory, but it should not pretend to contact the dead or claim to know what a real person would say.

For me, that balance is what makes this project fit the theme. The machine creates the words, but the meaning comes from the person who brings the story to life.

Partner-specific prize categories: None selected yet.

I will add any applicable categories after checking the official challenge's partner requirements and confirming that the project meets their eligibility criteria.

Submission type: Individual project.

Afterlight is being prepared as an individual submission. No teammate credits are required.

Thanks for reading! 👻

If you try Afterlight, experiment with an unusual premise, change the atmosphere, and see what kind of story emerges.

Sometimes the most interesting part of AI isn't the answer it gives us. It's the possibility it helps us imagine.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @afterlight 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/afterlight-ghost-in-…] indexed:0 read:5min 2026-10-27 · —