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
-
Switch NVIDIA fallback default to mistral-medium (fast, non-reasoning)
Donne120 +1: Claude Opus 4.8DeepSeek V4 Flash is a reasoning model — its think-chains took >75s and blew the request timeout. mistralai/mistral-medium-3.5-128b is a fast instruct model, usable as a fallback. Still overridable via NVIDIA_MODEL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>8695d3a -
Add NVIDIA NIM as the primary fallback (stronger free model than Groq)
Donne120 +1: Claude Opus 4.8When Claude is unavailable, try NVIDIA NIM (OpenAI-compatible, free tier, DeepSeek by default) BEFORE Groq, which stays as a final backstop. The richer model follows the grounded prompt better than Llama-3.3-70B, so fallback answers are closer to Claude quality. - nvidia_fallback.py: OpenAI-compatible client, same grounded system prompt and signature as groq_fallback; strips any leaked <think> reasoning block; model via NVIDIA_MODEL env (default deepseek-ai/deepseek-v4-flash). - app.py (/api/chat/claude) and main.py (/api/chat): try NVIDIA first, then Groq. Surfaced in /api/services/status. - requirements: openai>=1.0.0. Config: set NVIDIA_API_KEY (nvapi-...) as an HF Space secret. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a017e41