# Stack Doctor

- **Event:** [OpenEnv Hackathon SF](https://cerebralvalley.ai/e/openenv-hackathon-sf)
- **When:** Mar 7 at 9:00 AM – Mar 8 at 12:00 AM (PST)
- **Where:** Shack15, San Francisco, CA
- **Team:** [Blake Ledden](https://cerebralvalley.ai/u/ekalbbackwards)
- **GitHub:** https://github.com/bledden/stack-doctor
- **Website:** https://huggingface.co/spaces/bledden/stack-doctor https://github.com/bledden/stack-doctor/blob/main/training/train_stack_doctor.py https://colab.research.google.com/github/bledden/stack-doctor/blob/main/training/stack_doctor_grpo.ipynb
- **Demo video:** https://www.youtube.com/watch?v=q4EiBFUpFXg&list=RDq4EiBFUpFXg&start_radio=1
- **Hugging Face:** https://huggingface.co/spaces/bledden/stack-doctor
- **Gallery:** https://cerebralvalley.ai/e/openenv-hackathon-sf/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/openenv-hackathon-sf/hackathon/gallery/84

Stack Doctor is an RL environment (OpenEnv) that trains LLMs to diagnose GPU inference stack failures. 73 scenarios across vLLM, SGLang, FlashInfer, and TensorRT-LLM on NVIDIA H100/B200/SM121 and AMD MI300X/MI355X.

The agent gets an incident ticket, logs, and opinions from 4 specialist sub-agents — at least one deliberately lies per incident. The model must investigate (inspect logs, query specialists, apply fixes) and submit a justified diagnosis.                                                                           

Six reward functions shape behavior: valid JSON, environment interaction, investigation quality (penalizes blind guessing), partial credit for correct failure family, justification quality, and efficiency. Trained Qwen2.5-1.5B with GRPO via Unsloth + TRL on H100. The 9B base scored +19.5 (near-oracle) with zero training, proving environment quality. The 1.5B starts at -4.9 and learns to investigate before diagnosing.

---

Markdown version of https://cerebralvalley.ai/e/openenv-hackathon-sf/hackathon/gallery/84. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
