Phantom Shell:由本地開放權重模型附身的鬧鬼終端機
Phantom Shell — a haunted terminal possessed by a local open-weight model
Phantom Shell 是一款 CLI,讓透過 Ollama 執行的本地開放權重模型為終端機指令加入簡短評論,並可供用戶聊天或進入互動式附身模式。Ollama 未安裝或無法使用時,內置的 mock ghost 仍可離線示範完整操作體驗;核心功能無需閉源 SaaS LLM。
Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼
Phantom Shell 👻 — Ghost in the Machine (Hacktoberfest 2026 Week 4)
Challenge: #devchallenge #hf26challenge — Week 4 Ghost in the Machine
Author: Ri Piao · X @pr742674
What I built
Phantom Shell is a CLI that lets an open-weight model possess your terminal.
You run a normal shell command. The phantom — a local model via Ollama — whispers a short, eerie commentary about what you just did. You can also chat with it, or drop into possess mode: an interactive haunted REPL.
If Ollama is not installed, a built-in mock ghost still demos the full UX so judges (and you) can try it offline in seconds.
Theme take: the “ghost” should live in the machine — open weights, local inference, no cloud API key. Privacy is the haunting.
Demo
git clone https://github.com/pr7426/ghost-in-the-machine.git
cd ghost-in-the-machine
python3 -m phantom_shell demo
# or:
./scripts/demo.sh
Interactive:
python3 -m phantom_shell possess
# phantom> echo boo
# phantom> .chat Who are you?
# phantom> .quit
With a real local model:
ollama pull llama3.2
python3 -m phantom_shell possess --model llama3.2
Sample transcript (checked into the repo): demo/sample_session.txt
Repository
🔗 Repo: https://github.com/pr7426/ghost-in-the-machine
License: MIT · Language: Python 3.10+ · Deps: stdlib only for core
Open-source AI used
| Piece | Detail |
|---|---|
| Serving | Ollama (/api/chat) |
| Model |
llama3.2 by default (any Ollama open model works: phi3, qwen2.5, gemma2, …) |
| Offline | Mock ghost when Ollama is down |
| Optional path | llama.cpp / GGUF via Ollama or a local server (--host) |
No closed SaaS LLM is required for the core experience.
Why open innovation matters (here)
- Offline & private — command context and chat stay on-device; great for a personal shell.
- Swappable weights — one flag changes the soul of the ghost; community models welcome.
- Hackable — tiny stdlib client, MIT, easy to fork into prompts, tools, or a full agentic shell.
- Inclusive demos — mock mode means anyone can run the challenge submission without a GPU.
Open weights turn “AI feature” into something you can own, inspect, and remix — which is the point of a Ghost that lives in your machine.
Thanks Hacktoberfest + DEV for Week 4 — may your shells stay haunted. 🎃
來源:DEV Community · dev.to