跳到正文
DEV Community· Varun Fatehpuria·· 2 小時前AI 評分36

PHANTOM Terminal:仍有東西在運行 👻

PHANTOM Terminal: Something Is Still Running 👻

AI 導讀

開發者打造 PHANTOM Terminal,讓用戶在本機體驗以 AI 生成怪談的終端介面。它設有終端怪談、鬼故事和記憶檔案三種模式,預設使用 Qwen2.5 3B,透過 Ollama 在本機推理。應用程式不會自動讀取 Shell 歷史或執行指令;Ollama 無法使用時,亦可透過離線範本瀏覽介面。

正文

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

What I Built

What if your terminal could tell ghost stories?

Meet PHANTOM Terminal, a local-first, AI-powered haunted terminal inspired by the eerie feeling that something might still be running long after a machine should have gone quiet.

For this week's Ghost in the Machine theme, I wanted to combine the atmosphere of retro computer terminals with the possibilities of open-weight AI. Instead of building another chatbot with a conventional interface, I created a terminal-inspired experience where ordinary text fragments become mysterious transmissions.

PHANTOM currently has three modes:

  • Terminal Haunting: Feed it a harmless command or log fragment and receive eerie commentary.
  • Ghost Story: Turn a prompt about abandoned servers, forgotten software, or strange computer activity into an original horror story.
  • Memory Archive: Preserve meaningful stories, favorite songs, meals, traditions, and memories in a gentler experience inspired by remembrance and Día de los Muertos.

The interface uses a dark terminal aesthetic, phosphor-green accents, subtle CRT-inspired styling, and a minimal command-line layout.

The central idea is simple: a machine doesn't need to be connected to the cloud to feel alive.

PHANTOM does not automatically inspect your shell history or execute commands. You choose what text to share with it.

Demo

The project currently runs locally.

Run it yourself:

  1. Install Python 3.10 or newer.
  2. Optionally install Ollama to enable local AI inference.
  3. Download the default model:
   ollama pull qwen2.5:3b
  1. Start the application:
   python app.py

On Windows, you can also use py app.py.

  1. Open http://127.0.0.1:8000 in your browser.

The application includes a template-based fallback, so you can explore the interface even when Ollama is unavailable. The fallback works offline but does not generate responses using an LLM.

A public deployment and recorded video demo are not available yet.

Code

Project: PHANTOM Terminal — Ghost in the Machine

The source code includes the Python backend, terminal-inspired frontend, local-model integration, offline fallback, documentation, and automated tests.

Project repository: [https://github.com/Varun-666/ghost-in-the-machine]

Project structure:

ghost-in-the-machine/
├── app.py
├── static/
│   ├── index.html
│   ├── style.css
│   └── app.js
├── tests/
│   └── test_app.py
├── README.md
├── LICENSE
└── .gitignore

The project is licensed under MIT.

How I Built It

I built PHANTOM using Python, HTML, CSS, and JavaScript, with Ollama serving an open-weight language model locally.

The default model is Qwen2.5 3B, which can be replaced with another compatible model by changing the configuration.

The architecture is intentionally straightforward:

  1. The user selects a mode and enters a text fragment.
  2. The frontend sends the input to the local Python backend.
  3. The backend attempts to generate a response using Ollama's local API.
  4. If the model service is unavailable, the application switches to its built-in fallback.
  5. The frontend displays the response in the terminal interface.

The application does not require a hosted AI API, a cloud account, or a paid inference service.

I also included basic input validation, safe rendering of generated text, a prompt-length limit, and automated tests.

The current version is a local web application rather than a fully autonomous agent. It deliberately avoids executing shell commands or accessing system files automatically.

Why Does Open Innovation Matter?

For PHANTOM, open innovation is not just a technology choice. It is part of the project's identity.

A haunted terminal is an interesting experiment, but the idea becomes much more meaningful when the underlying AI can run on your own machine.

1. Privacy by design

A user might want to turn personal notes, old logs, or meaningful memories into a story. Running inference locally means those prompts do not need to be sent to a third-party AI provider.

PHANTOM has no cloud AI API integration, and it does not automatically save prompts or responses. When Ollama is enabled, the application sends prompts to the local Ollama service on the same machine.

2. Offline access

After the required software and model have been downloaded, the application can generate responses without an internet connection. This makes experimentation possible without relying on the availability of an external AI service.

3. Freedom to change models

The model is not permanently tied to a single provider. Users can experiment with different compatible models, compare their writing styles, and adapt the experience to their hardware and preferences.

4. No per-request API fees

Local inference avoids per-request charges from a hosted AI API. It still has hardware, electricity, storage, and setup costs, but there is no mandatory cloud inference bill.

5. Long-term ownership

An application built around replaceable models and an open codebase is easier to inspect, modify, self-host, and maintain independently of a single AI provider.

A closed API could also generate convincing ghost stories. What it would not inherently provide is the same combination of local execution, model choice, inspectable application code, and freedom from a required hosted inference service.

That is the part of open innovation I wanted to explore: making AI something people can run, understand, and adapt themselves.

My Agent Session

PHANTOM currently uses a local model interface rather than an autonomous agent harness. I have not recorded a DevRelay session for this project, so I am leaving this section out rather than linking to a session that does not exist.

The Spirit of It

There is something unsettling about an old computer that still has one process running.

Maybe it is an abandoned game server. Maybe it is a log file with a timestamp that makes no sense. Maybe it is a forgotten program that someone wrote years ago and never finished.

I wanted PHANTOM to capture that feeling without needing an elaborate horror game or an expensive cloud model.

But there is another side to the idea.

For Día de los Muertos, the same technology can be used to preserve the small things that make memories meaningful: a family recipe, a favorite song, a familiar saying, or a story that deserves to be told again.

One mode lets a machine whisper fictional horrors. Another lets it help keep real memories alive.

The machine doesn't have to forget just because we stopped listening.

Sometimes, the most interesting thing about a ghost is what it helps us remember.

Prize Categories

Primary fit: Open-Source AI / Local Inference.

PHANTOM is built around open-weight AI served locally through Ollama, with a replaceable model configuration and a functional offline fallback.

I am entering the main Ghost in the Machine challenge. I have not selected additional partner prize categories because I have not verified which specific partner categories and eligibility requirements apply.


Built for the Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine.

來源:DEV Community · dev.to