TermiSense:離線解讀終端錯誤,3 秒提供修復方法
TermiSense
TermiSense 以本機運行的 Llama 3.2 1B 解讀終端錯誤,並在 3 秒內提供淺白英文説明及具體修復方法。系統透過 Ollama、ChromaDB 向量檢索及 FastAPI 運作,支援 Python、Node、Rust、npm 和 shell 錯誤。所有處理均在用戶電腦上離線完成,毋須雲端或 API keys,也不會傳送資料。
Every developer has stared at this and felt stupid.
A wall of red text. A cryptic stack trace. A TypeError you've seen a hundred times and still can't remember how to fix. You Google it. You paste it into ChatGPT. You read ten Stack Overflow answers from 2015 that don't apply to your version. Thirty minutes gone. Flow broken. And you still don't understand what actually went wrong.
Worse — you just sent your proprietary code, your stack traces, and your file paths to a cloud server you don't control.
Beginners give up here. They close the terminal, close the laptop, and decide maybe programming isn't for them. The error was never the problem. Not understanding it was.
TermiSense fixes that. It turns any terminal error — Python, Node, Rust, npm, shell — into a plain-English explanation with a concrete fix, in under 3 seconds, entirely on your laptop. No cloud. No API keys. No data leaving your machine.
Your terminal finally speaks human.
Not to writing code. Not to designing systems. To decoding error messages.
The current tools fail us:
Cloud LLMs (ChatGPT, Claude) — cost money, require internet, and send proprietary code off-device. Enterprises ban them for a reason.
Stack Overflow — outdated, mismatched, and slow. Answers from 2013 rarely solve 2026 problems.
IDEs — display errors beautifully. Never explain them.
AI coding assistants (Copilot, Cursor) — optimize for generating code, not understanding errors.
The result: Beginners drop out. Professionals lose flow. Enterprises can't adopt AI tooling at all.
TermiSense is the first AI-powered error explainer that runs entirely offline. FastAPI backend. Llama 3.2 1B via Ollama. ChromaDB vector retrieval. All on your laptop. Zero cloud. Zero cost. Zero data exposure.
Three seconds from cryptic error to clear fix.
Program 'pip.exe' failed to run: An Application Control policy has blocked this file.
I'd never seen it before. ChatGPT gave me a generic answer. Stack Overflow had one thread from 2019 that didn't match. I was stuck.
Then I remembered — I'm building a tool for exactly this. I pasted the error into TermiSense, clicked Explain, and in three seconds I had:
WHAT: Windows blocked pip.exe via a security policy
WHY: Smart App Control doesn't trust the pip launcher script
FIX: Use python -m pip install to bypass the wrapper
PREVENT: Add python.exe to the Application Control allowlist
Fixed. Flow restored. And it never touched the internet.
That's TermiSense. Every terminal error, explained offline, in three seconds.
Developers lose significant productive time every week deciphering cryptic terminal errors. Existing solutions force a trade-off: cloud LLMs (ChatGPT, Claude) provide fast explanations but require internet access, cost money, and transmit proprietary code, stack traces, and file paths to third-party servers — a dealbreaker for enterprise, defense, and healthcare environments. Traditional IDEs display errors but never explain them. AI coding assistants focus on code generation, not error comprehension. Meanwhile, beginners — who would benefit most from contextual explanations — are pushed out of software development by a steep learning curve that no existing tool addresses offline.
Solution:
TermiSense is an offline, privacy-first web application that transforms any terminal error into a plain-English explanation with a concrete fix, in under 3 seconds, entirely on the user's local machine. Powered by Llama 3.2 1B via Ollama and augmented with ChromaDB vector retrieval of curated few-shot examples, TermiSense detects error families across Python, Node, Rust, npm, and shell, then returns a structured four-part response — WHAT, WHY, FIX, PREVENT — rendered in a clean, developer-focused UI. Zero cloud. Zero API keys. Zero cost. Works fully offline in environments where cloud tools cannot reach.
"Every developer wastes hours on cryptic terminal errors — and today's fix is to paste your proprietary code into ChatGPT. We built TermiSense: an offline web app that explains any terminal error in plain English, in 3 seconds, using Llama 3.2 1B running on your laptop. No cloud. No API keys. No data leaving your machine. Your terminal finally speaks human."
Here's why:
→ Your stack traces contain file paths, package names, and internal identifiers
→ Sending them to OpenAI/Anthropic is a privacy and compliance nightmare
→ Enterprises literally can't use it
→ You pay per token to solve a problem that should be free
→ It needs internet — the moment your build breaks on a plane, you're stuck
We built the alternative.
TermiSense — offline AI that explains any terminal error in 3 seconds, on your laptop. Llama 3.2 1B. ChromaDB. FastAPI. Zero cloud.
Your terminal finally speaks human.
[Screen shows an ugly Python traceback]
"Every developer has stared at this and felt stupid. We built something that fixes that — offline, in three seconds."
[Cut to TermiSense UI, error dissolves into WHAT/WHY/FIX/PREVENT]
That's the whole pitch. Everything else is elaboration.
💡 The One Sentence to Remember
If you can only say one sentence about TermiSense for the rest of your hackathon — say this:
"TermiSense turns any terminal error into a plain-English explanation with a fix — in 3 seconds, offline, on your laptop, with zero cloud dependency."
That sentence covers: what it does, how fast, where it runs, and why it matters.
📌 Project Name
TermiSense
🎯 Tagline (One-Liner)
Your terminal, finally speaks human — offline AI that explains any error in 3 seconds.
🔗 Links
GitHub Repository: https://github.com/lighteningeditz-bot/Termisense.git
Demo Video: https://drive.google.com/uc?id=1ue4gNxO6Ag_Nz9o9CZe0I8MkLF_D6Dyc&export=download
Team: Siva Sandeep Paddana
💡 Inspiration
Every developer has been there. You're deep in flow, you hit Run, and the terminal explodes with red text. A ModuleNotFoundError. A Rust borrow-checker complaint. A cryptic ERESOLVE. You copy-paste into ChatGPT. You Google it. You read ten Stack Overflow threads from 2014. Thirty minutes later, you still don't fully understand what went wrong.
And worse — you just sent your proprietary code, file paths, and stack traces to a cloud server you don't control.
Beginners give up here. They close the terminal and decide programming isn't for them. The error was never the problem — not understanding it was.
We asked: what if AI could explain any terminal error, in plain English, in 3 seconds, without ever touching the cloud?
That question became TermiSense.
🧠 What It Does
TermiSense is an offline, privacy-first web application that transforms any terminal error into a plain-English explanation with a concrete fix — in under 3 seconds, entirely on your laptop.
The 4-Section Answer
Every error gets broken down into four clean sections:
Section Purpose
WHAT What the error actually means in plain English
WHY The root cause — what triggered it
FIX Concrete, copy-pasteable steps to resolve it
PREVENT How to avoid this class of error in the future
Each section has a one-click copy button, and the detected error family appears as a colored chip at the top.
Supported Error Families
🐍 Python — tracebacks, imports, syntax errors
🟢 Node.js — missing modules, dependency conflicts
🦀 Rust — borrow checker, type mismatches
📦 npm — ERESOLVE, permission errors
🐚 Shell — command not found, permission denied
🔌 Network — connection refused, timeouts
⚠️ Generic — segfaults, OOM, and more
Input Options
Paste raw error text
Upload .log / .txt / .out files
Add context (optional): open file path, code snippet, dependency file contents
🎬 How We Built It
TermiSense is a 5-stage pipeline built entirely on a local, offline stack.
Architecture
text
┌──────────────────────────────────────────────────────────┐
│ Browser (localhost:8000) │
│ Paste error · Upload log · Optional context · Explain ▶ │
└───────────────────────────┬──────────────────────────────┘
│ POST /explain
▼
┌──────────────────────────────────────────────────────────┐
│ FastAPI Backend │
│ │
│ 1. NORMALIZE Strip ANSI, trim stack trace │
│ 2. CLASSIFY Regex-based error family detection │
│ 3. RETRIEVE ChromaDB top-k similar examples │
│ 4. PROMPT Build engineered prompt with few-shots │
│ 5. REASON Llama 3.2 1B via Ollama (local) │
└───────────────────────────┬──────────────────────────────┘
▼
┌────────────────────────┐
│ Ollama (localhost) │
│ llama3.2:1b │
└────────────────────────┘
Stage-by-Stage
Normalize — ANSI escape codes stripped. Stack trace trimmed to first 10 lines (context) + last 20 (the actual error). Keeps the signal, drops the noise.
Classify — Regex-based detection across 10 error families. python-traceback, node-module-not-found, rust-borrow-checker, npm-eresolve, shell-command-not-found, permission-denied, connection-refused, syntax-error, segfault, and generic.
Retrieve — ChromaDB (local vector database) does semantic search across curated error→fix examples in Skills.md. The top-2 most similar past examples are pulled to ground the model.
Prompt — A tightly-engineered prompt is assembled: strict system rules + retrieved few-shots + user's project context + the error itself.
Reason — The prompt goes to Llama 3.2 1B running locally via Ollama. The model returns exactly four sections thanks to low temperature (0.2) and a locked format.
The Small-Model Secret
A 1B-parameter model is not a reasoning powerhouse. Left alone, it produces vague answers. We compensate with three techniques:
Strict prompt templates — locked 4-section format, 150-word cap, low temperature
Curated few-shot examples — real error→fix pairs from Skills.md
Vector retrieval — ChromaDB supplies the two most similar past examples
Result: A 1B model that behaves like a much larger one — for this specific, narrow task.
🛠️ Tech Stack
Layer Technology Why
Backend FastAPI + Uvicorn Async, fast, minimal boilerplate
LLM Runtime Ollama 100% local, one-command install
LLM Model Llama 3.2 1B Tiny, fast, runs on any laptop
Vector Store ChromaDB Local, persistent, auto-embeddings
HTTP Client requests Simple, reliable, synchronous
Frontend HTML5 + Tailwind CSS + Vanilla JS Zero build step, hackathon-friendly
Language Python 3.10+ Rich AI ecosystem
Total Python code: ~500 lines across 3 files.
Total dependencies: 5 Python packages. 1 model. 0 cloud services.
🏆 Challenges We Ran Into
Making a 1B model useful.
The biggest challenge was getting a tiny model to give useful answers. Naive prompting produced generic, hand-wavy responses. The breakthrough was combining regex classification + vector-retrieved few-shots + a locked output format. Suddenly the 1B model started sounding like a 7B.Windows Application Control blocking pip.exe.
We hit Program 'pip.exe' failed to run: An Application Control policy has blocked this file — and had to work around it using python -m pip. This became error #3 in our own demo dataset, and nothing proved the tool's value more than using it to solve our own bugs.Relative paths breaking at runtime.
FileNotFoundError: 'Skills.md' haunted us until we anchored every path to file via pathlib.Path(file).resolve().parent. A painful but permanent fix.ChromaDB + FastAPI startup order.
Ensuring ChromaDB was seeded before the first request took some work — solved with @app.on_event("startup") and a lazy-init pattern.
✅ Accomplishments We're Proud Of
100% offline operation — no cloud calls, no API keys, no cost, verified with a network monitor
2–5 second response time on a mid-range CPU laptop, no GPU required
10 error families supported out of the box, extending to new languages is trivial
~500 lines of Python total — proving useful AI tooling doesn't require massive infrastructure
Self-validated — every bug we hit while building the app became a demo input proving the app works
Zero-cost forever — no subscriptions, no per-token billing, no rate limits
📚 What We Learned
Small models + smart prompting > large models + lazy prompting for narrow tasks.
Vector retrieval isn't just for chatbots — it's an accuracy multiplier for any constrained LLM task.
Privacy-first AI is a real, unmet need — enterprises, defense, and healthcare have been locked out of AI tooling for too long.
Anchoring file paths to file should be a law, not a suggestion.
Building in public forces clarity — using TermiSense to debug TermiSense was the single best product decision we made.
🔮 What's Next for TermiSense
VSCode extension — right-click any terminal error to explain in-place
Diff view — render suggested code patches side-by-side with the original
Voice input — "read me this error" via Web Speech API
History sidebar — persist past explanations in localStorage or SQLite
Streaming responses — tokens appear as they're generated
30+ error families — Go, Java, C++, Docker, Kubernetes, Terraform
Multi-model support — switch between Llama, Mistral, Phi, Qwen
Curated community error database — crowdsourced real-world error→fix pairs
CLI mode — termisense explain "$(cat error.log)"
🚀 Installation & Running
Prerequisites
Python 3.10+
Ollama installed and running
llama3.2:1b model pulled
Setup
bash
Clone the repo
git clone https://github.com/lighteningeditz-bot/Termisense.git
cd Termisense
Create and activate virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linux
Install dependencies
python -m pip install -r requirements.txt
Pull the model (one-time, ~800 MB)
ollama pull llama3.2:1b
Run the app
python main.py
Access
Open http://127.0.0.1:8000 in your browser.
You'll see the green "● Ollama ready" chip in the top-right when everything is working.
🧪 Try It With These Errors
Python:
text
Traceback (most recent call last):
File "app.py", line 3, in
import pandas_missing
ModuleNotFoundError: No module named 'pandas_missing'
Node:
text
Error: Cannot find module 'express'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
Rust:
text
error[E0502]: cannot borrow v as mutable because it is also borrowed as immutable
--> src/main.rs:5:5
Shell:
text
bash: ripgrep: command not found
🏗️ Built With
fastapi · uvicorn · ollama · llama-3.2-1b · chromadb · requests · python-multipart · tailwindcss · html5 · javascript · python
🙏 Acknowledgments
Meta AI for the open-weight Llama 3.2 model
The Ollama team for making local LLMs ridiculously easy
ChromaDB for the simplest vector store we've used
The FastAPI team for the cleanest Python web framework
Every developer who's ever stared at a red terminal and thought "what does this even mean?" — this one's for you
📄 License
MIT License — free to use, modify, and distribute.
來源:DEV Community · dev.to