veltrixcode commited on
Commit
ca03513
·
verified ·
1 Parent(s): 63dbfcd

Update src/rag_engine.py

Browse files
Files changed (1) hide show
  1. src/rag_engine.py +4 -0
src/rag_engine.py CHANGED
@@ -385,6 +385,10 @@ class LegalRAGEngine:
385
  # Stream via Groq if specified or as fallback
386
  if model_id.startswith("groq:") or not cf_token:
387
  clean_model = model_id.replace("groq:", "")
 
 
 
 
388
  groq_clients = self.get_groq_clients_in_rotation()
389
  streamed = False
390
  last_err = None
 
385
  # Stream via Groq if specified or as fallback
386
  if model_id.startswith("groq:") or not cf_token:
387
  clean_model = model_id.replace("groq:", "")
388
+ # Ensure model passed to Groq is a valid Groq model name, not a Cloudflare @cf/ path
389
+ if clean_model.startswith("@cf/") or clean_model not in ["qwen/qwen3.8-27b", "llama-3.3-70b-versatile", "llama-3.1-8b-instant", "mixtral-8x7b-32768"]:
390
+ clean_model = "qwen/qwen3.8-27b"
391
+
392
  groq_clients = self.get_groq_clients_in_rotation()
393
  streamed = False
394
  last_err = None