Ghost in the Machine:以本地 AI 模型打造互動式終端
Ghost in the Machine
Ghost in the Machine 是一個以 HTML、CSS 和 JavaScript 製作的互動式終端,讓用戶透過命令或提問與數碼幽靈對話。項目使用 Ollama 提供本機模型 API,並以 Llama 3.2 作為預設開放權重模型;推理在本機進行,毋須連接遠端封閉式 AI API,亦可在 script.js 更換模型。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
I built Ghost in the Machine, a spooky interactive terminal where a mysterious digital ghost responds to the user using a locally running open-weight AI model.
The project is intentionally small and is built using only:
- HTML
- CSS
- JavaScript
- Ollama
- A local open-weight AI model
Users can type commands or ask the ghost questions directly from the terminal.
For example:
visitor@ghost:~$ hello ghost
The message is sent to the local AI model, which generates a response in the personality of the Ghost.
I interpreted the theme as the idea of a computer that feels alive because something inside the machine can actually talk back.
Demo
Live Demo: Coming soon.
GitHub Repository:
https://github.com/shikharahirwar489-ui/Ghost-in-the-Machine
Code
The complete project is available on GitHub:
https://github.com/shikharahirwar489-ui/Ghost-in-the-Machine
The project intentionally contains only a few files:
Ghost-in-the-Machine/
├── index.html
├── style.css
├── script.js
└── README.md
The small structure makes the project easy to understand, modify, and experiment with.
How I Built It
The interface is built with standard web technologies:
- HTML creates the terminal interface.
- CSS creates the dark terminal aesthetic, scanlines, glowing elements, and responsive layout.
- JavaScript handles commands and communicates with the local AI.
- Ollama provides the local model API.
- Llama 3.2 is used as the default open-weight model.
The basic architecture is:
User
↓
Ghost Terminal
↓
JavaScript
↓
Ollama
↓
Local Llama 3.2 Model
↓
Ghost Response
The important part is that the AI inference happens locally instead of requiring a remote closed AI API.
The model can also be changed in script.js, making the Ghost customizable.
Why Does Open Innovation Matter?
For this project, open innovation makes the AI layer much more accessible and controllable.
Instead of treating the AI as a black-box cloud service, the model can run directly on the user's own computer.
That makes several things possible:
- 🔒 Greater control over private conversations
- 🌐 The possibility of local/offline use
- 🔧 Ability to change or replace the model
- 🧪 Freedom to experiment with AI behavior
- 💰 No per-request cloud API cost
- 🧠 More control over how the application works
I also liked that the project could stay extremely small.
There is no large backend or complicated framework. The browser interface communicates with a locally running model, making the relationship between the application and AI easy to understand.
Open technologies make experiments like this easier to inspect, modify, and extend.
My Agent Session
I did not use a DevRelay agent session for this project.
The Spirit of It
The idea started with a simple question:
What if your terminal could talk back?
A normal terminal is predictable. You enter a command, the computer responds, and you continue working.
I wanted to turn that familiar experience into something slightly unsettling.
The result is a small terminal where the response isn't always predictable
來源:DEV Community · dev.to