Spaces:
Running
Running
Commit History
-
Use verified model ids and order candidates from live evidence
Donne120 +1: Claude Opus 5NVIDIA: the previous list was written from memory and two ids were wrong — "mistralai/mistral-medium-3.5-128b" is not in NVIDIA's supported-models list at all, and mixtral's id is "-v01", not "-v0.1". Replaced with ids checked against NVIDIA's documentation. A wrong id is indistinguishable from a dead key at runtime, which is the failure mode this whole mechanism exists for. Groq: reordered from what actually happened in production tonight. Both llama-3.3-70b-versatile and llama-3.1-8b-instant returned 404 (retired), and openai/gpt-oss-120b served the request. Putting the known-good model first removes two failed round trips on the first question after every restart. The retired ids stay in the list — no single id should be load-bearing, and they may come back. Also loosened a test that asserted a literal model id as the first attempt. It was pinning list order rather than behaviour; the ordering is tuned from evidence and will change again, but "a retired preferred model must not st…37d6467 -
Fix generation outage: retired Groq model and anthropic SDK signature
Donne120 +1: Claude Opus 5Two separate production failures, neither an expired key, both surfacing to students as "the AI service is unavailable": Groq 404 - The model `llama-3.3-70b-versatile` does not exist Claude Messages.create() got an unexpected keyword argument 'temperature' The Groq id was hardcoded in five places, so a retirement broke chat and the email briefing at once. From outside, a 404 on a retired model is indistinguishable from a bad key, which is what made this expensive to find. The Claude break came from `anthropic>=0.39.0` having no upper bound: the Space rebuilt, pip resolved a build with a different signature, and every call failed. The code never changed. Changes: - model_discovery.py: shared model-resolution helper. Walks a candidate list on model errors only, adopts what works, and remembers it so later requests do not re-probe dead models. Auth/quota/rate-limit errors stop after one attempt — walking the list there would multiply latency on a request that is already …107a904
-
Fix poor Groq fallback answers: ground them like Claude
Donne120 +1: Claude Opus 4.8The fallback gave weak/nonsensical answers because it (1) saw only the first retrieved doc truncated to 500 chars, (2) had no anti-hallucination rules and hardcoded possibly-stale facts (tuition/programs), and (3) got no conversation history. - groq_fallback: grounded system prompt mirroring the Claude engine's "answer only from context, never invent fees/dates/faculty" discipline; drop hardcoded tuition/program facts; accept history; temperature 0.7->0.4; max_tokens 500->1024. - app.py /api/chat/claude fallback: pass the SAME formatted context Claude got (all docs, titles/urls) + history, not one truncated doc. - main.py /api/chat fallback: pass all retrieved docs (labeled) + history instead of context_docs[0][:500]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>bbec9ec
-
Improve: Make responses more concise, reduce emoji spam, better prompts
dbbfc0c -
Fix: Update Groq model from llama-3.1-70b to llama-3.3-70b (decommissioned model fix)
96d8924 -
Add FREE Groq fallback integration - NO BREAKING CHANGES
Features: - FREE Groq API (14,400 requests/day) for non-ALU questions - Smart fallback: ALU KB first, Groq only for weak matches (score < 50) - Completely optional - system works without it - Added groq_fallback.py module - Updated main.py with fallback logic - Added ENV_SETUP.md and GROQ_SETUP_INSTRUCTIONS.md How it works: 1. ALU questions -> ALU Knowledge Base (primary) 2. Weak matches (score < 50) -> Groq fallback 3. Non-ALU questions -> Groq handles No breaking changes - existing functionality preserved!010c963