k8s-rca-qwen3.5-4b
Local AI Troubleshooter for Kubernetes Pod Failures
2 min read
A LoRA adapter (a lightweight add-on for a base model) built on Qwen/Qwen3.5-4B by Sandeshparjanya for root-cause analysis of Kubernetes pod crashes. It takes a diagnostic bundle containing pod status, events, and kubectl logs, and returns strict JSON with one of 15 failure categories, a brief log-backed explanation, and a suggested fix. Compared to the base Qwen3.5-4B, it enforces a reliable output schema and boosts classification accuracy on complex scenarios from 84.2% to 100%. The setup is compact and runs entirely locally, so cluster logs never have to leave your environment for external cloud APIs. Useful for SREs, DevOps engineers, and students doing initial incident triage.
Key features
- Classifies errors into 15 exact categories, including
oom_killed,image_not_found,liveness_probe_failure, andephemeral_storage_eviction. - Hits 100% accuracy across two test suites (150 and 57 real cases from a k3s lab cluster) with 100% valid JSON output.
- Includes a ready-to-use 2.7 GB Q4_K_M quantized GGUF build for running in Ollama and llama.cpp.
- Trained on 1,667 examples (284 real failure dumps from k3s and 1,383 synthetic scenarios labeled with
gemma-4-31b-it). - Ships alongside a lighter
Qwen3.5-2Bvariant and a ready-to-use CLI tool,tools/k8s_rca.py.
What you can do
- Hook it up to the author's CLI utility to diagnose a crashed pod straight from your terminal via
kubectl. - Run the GGUF build locally in Ollama or llama.cpp to investigate incidents in air-gapped environments without leaking logs.
- Plug it into local first-line incident triage scripts to get quick suggestions for YAML manifests or recovery commands.
Example
huggingface-cli download Sandeshparjanya/k8s-rca-qwen3.5-4b-GGUF --local-dir k8s-rca-gguf
cd k8s-rca-gguf && ollama create k8s-rca -f Modelfile
python3 tools/k8s_rca.py my-pod -n prod --backend ollama --model k8s-rca
Read more
DetailsBenchmarks: On exam v1 (150 cases) and the harder exam v2 (57 cases), it scores 100% accuracy (F1 1.000) versus 92.0% and 84.2% for base Qwen3.5-4B; the 2.7 GB GGUF Q4_K_M build hits 98.7% and 96.5%.
Setup: In
transformers, you need to disable thinking mode (enable_thinking=False) and use the system prompt from scripts/prompt.py.Limitations: Works only with English logs, identifies a single root cause per individual pod, and was trained on a single-node k3s lab cluster.
Safety: Never pass the suggested
fix field directly into kubectl or CI pipelines without human review.









Comments