umairali64488/multi_llm_debugging_engine
1
1---2title: CodeDebug Multi-LLM Debugger3emoji: ⚡4colorFrom: blue5colorTo: purple6sdk: docker7app_port: 78608pinned: false9---10 11# ⚡ CodeDebug — Multi-LLM Debugging Engine (LangChain)12 13A code debugging assistant that queries **3 LLMs in parallel** using LangChain LCEL chains,14then uses **Qwen3 as a judge** to synthesize the best final answer.15 16## Architecture17 18```19Your query20 ├──▶ Trinity Large (arcee-ai) ─╮21 ├──▶ StepFun Flash (stepfun) ─┼──▶ Qwen3 Judge ──▶ Reasoning + Final Answer22 └──▶ Nemotron Nano (nvidia) ─╯23 24LangChain Stack:25 PANEL_PROMPT | ChatOpenAI | StrOutputParser × 3 (asyncio.gather)26 JUDGE_PROMPT | ChatOpenAI | StrOutputParser × 127```28 29## Setup on Hugging Face Spaces30 311. Fork this Space322. **Settings → Variables and secrets → New secret**33 - Name: `OPENROUTER_API_KEY`34 - Value: your key from [openrouter.ai](https://openrouter.ai)353. The Space rebuilds automatically (~2 min)36 37## Local development38 39```bash40# 1. Create .env41echo "OPENROUTER_API_KEY=sk-or-v1-..." > .env42 43# 2. Install44pip install -r requirements.txt45 46# 3. Run47uvicorn app.main:app --reload --port 786048```49 50Open http://localhost:786051 52## File structure53 54```55├── app/56│ ├── __init__.py57│ ├── config.py # pydantic-settings58│ ├── prompts.py # LangChain ChatPromptTemplates59│ ├── llm_factory.py # ChatOpenAI factory (OpenRouter)60│ ├── llm_chain.py # LCEL pipeline (panel + judge)61│ └── main.py # FastAPI routes62├── frontend/63│ └── index.html # Single-file UI64├── requirements.txt65├── Dockerfile66└── README.md67```68 69## API70 71`POST /api/v1/debug`72```json73{ "question": "Why does my Python function return None?", "temperature": 0.3 }74```75 76Response:77```json78{79 "question": "...",80 "panel": [81 { "model": "...", "label": "Trinity Large", "response": "...", "latency_ms": 1200, "error": null },82 ...83 ],84 "judge": {85 "reasoning": "...",86 "final_answer": "...",87 "latency_ms": 3100,88 "error": null89 },90 "total_ms": 430091}92```93 