I built shadow-debugger: non-blocking AI error diagnosis for Python & FastAPI (works offline with Ollama)
说明与用途
shadow-debugger 通过本地或云端 LLM 实现 Python 应用的非阻塞错误诊断,生成 Markdown 报告且不影响响应延迟。
问题
When a Python app or FastAPI endpoint raises an exception or HTTP 500, the normal response is delayed while error context is sent to an LLM for analysis.
结果
shadow-debugger enables non-blocking AI-driven error diagnosis, producing detailed Markdown reports offline or via cloud LLMs while keeping the original request latency unchanged.
工作流
- Install shadow-debugger via pip
- Initialize shadow-debugger with provider and model
- Add middleware or decorator to the web framework
- Trigger an error in the application
- shadow-debugger captures context and sends to LLM
- LLM generates a Markdown report
- Report is written to ./shadow_reports/
证据
When an exception or HTTP 500 happens, shadow-debugger captures the stack frame from your code, strips secrets from local variables and request data, and sends the context to an LLM in a background worker thread.
Your app returns its normal response right away; a few seconds later you get a Markdown postmortem in ./shadow_reports/.
It works offline with Ollama (zero external dependencies) or with Gemini, OpenAI (including OpenAI-compatible endpoints like Groq, vLLM, LM Studio), and Anthropic.
- 记录日期: 2026-10-18T10:56:04.166Z