Fix HF routing: use router for third-party models, not model-specific endpoint
Browse filesOnly RayMelius/ finetuned models need the direct inference endpoint.
All other org/model format models (e.g. mistralai/Mistral-7B-Instruct-v0.3)
must go through router.huggingface.co which supports chat completions for them.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ai_analyst/ai_analyst.py +1 -1
ai_analyst/ai_analyst.py
CHANGED
|
@@ -90,7 +90,7 @@ def call_llm(prompt: str) -> str | None:
|
|
| 90 |
if not HF_TOKEN:
|
| 91 |
return None
|
| 92 |
m = model or HF_MODEL
|
| 93 |
-
if m.startswith("RayMelius/")
|
| 94 |
url = f"https://api-inference.huggingface.co/models/{m}/v1/chat/completions"
|
| 95 |
else:
|
| 96 |
url = "https://router.huggingface.co/v1/chat/completions"
|
|
|
|
| 90 |
if not HF_TOKEN:
|
| 91 |
return None
|
| 92 |
m = model or HF_MODEL
|
| 93 |
+
if m.startswith("RayMelius/"):
|
| 94 |
url = f"https://api-inference.huggingface.co/models/{m}/v1/chat/completions"
|
| 95 |
else:
|
| 96 |
url = "https://router.huggingface.co/v1/chat/completions"
|