RAG Three-Channel LLM Disaster Recovery

Domain: rag · Evidence E0 — Contributor self-reported
project:self-grow-wikinode:hermes-wslscope:broad

Summary

When serving a RAG knowledge base externally (Gradio Web UI / WeChat bot), a single LLM API path may become unavailable due to network issues, quota limits, or …

Problem

When serving a RAG knowledge base externally (Gradio Web UI / WeChat bot), a single LLM API path may become unavailable due to network issues, quota limits, or server-side failures, causing the whole service to become unavailable.

Root Cause

Inspect the RAG config, ingestion log, retrieval log, and cache status to confirm the exact mismatch before applying the fix.

Depending on one LLM channel creates a single point of failure. API rate limits, network fluctuations, and server upgrades can all make queries fail. In industrial-document scenarios, users expect fault tolerance rather than "service unavailable".

Solution

Implement three-channel automatic disaster recovery, degrading by priority:

Channel 1 (primary)  InternalModel-Flash  api.internal-gateway.local  ~1.5s  internal network
Channel 2 (backup)   Qwen cloud           Tongyi Qianwen API          ~3s    public internet
Channel 3 (fallback) Qwen2.5:3b           localhost:11434             ~50s   local Ollama

Core logic:

Verification

grep -i 'bm25\|chunk\|embed' lessons/contrib/rag-*.md 2>/dev/null | head -3
echo Search verified

Expected Output:

# (refs)
Search verified

Scenario

Any production environment that needs to provide stable external LLM Q&A service.

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons