Switch HF default model to zephyr-7b-beta (ungated, no license needed)
Browse filesQwen/Qwen2.5-7B-Instruct had no visible license gate for the user.
HuggingFaceH4/zephyr-7b-beta is fully open with no access restrictions.
HF_MODEL env var can still override to any other model.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/soci/api/routes.py +1 -1
- src/soci/engine/llm.py +3 -2
src/soci/api/routes.py
CHANGED
|
@@ -278,7 +278,7 @@ async def get_llm_providers():
|
|
| 278 |
providers.append({"id": "groq", "label": "Groq (Llama 8B)", "icon": "⚡"})
|
| 279 |
if os.environ.get("GEMINI_API_KEY"):
|
| 280 |
providers.append({"id": "gemini", "label": "Gemini 2.0 Flash", "icon": "✦"})
|
| 281 |
-
providers.append( {"id": "hf", "label": "HF
|
| 282 |
providers.append( {"id": "ollama", "label": "Ollama (local)", "icon": "🦙"})
|
| 283 |
return {"current": current, "providers": providers}
|
| 284 |
|
|
|
|
| 278 |
providers.append({"id": "groq", "label": "Groq (Llama 8B)", "icon": "⚡"})
|
| 279 |
if os.environ.get("GEMINI_API_KEY"):
|
| 280 |
providers.append({"id": "gemini", "label": "Gemini 2.0 Flash", "icon": "✦"})
|
| 281 |
+
providers.append( {"id": "hf", "label": "HF Zephyr 7B", "icon": "🤗"})
|
| 282 |
providers.append( {"id": "ollama", "label": "Ollama (local)", "icon": "🦙"})
|
| 283 |
return {"current": current, "providers": providers}
|
| 284 |
|
src/soci/engine/llm.py
CHANGED
|
@@ -42,6 +42,7 @@ MODEL_GEMINI_FLASH = "gemini-2.0-flash"
|
|
| 42 |
MODEL_GEMINI_PRO = "gemini-1.5-pro"
|
| 43 |
|
| 44 |
# Hugging Face Serverless Inference model IDs (free, no credit card)
|
|
|
|
| 45 |
MODEL_HF_LLAMA = "meta-llama/Llama-3.2-3B-Instruct"
|
| 46 |
MODEL_HF_QWEN = "Qwen/Qwen2.5-7B-Instruct"
|
| 47 |
MODEL_HF_MISTRAL = "mistralai/Mistral-7B-Instruct-v0.3"
|
|
@@ -821,7 +822,7 @@ class HFInferenceClient:
|
|
| 821 |
def __init__(
|
| 822 |
self,
|
| 823 |
api_key: Optional[str] = None,
|
| 824 |
-
default_model: str =
|
| 825 |
max_retries: int = 3,
|
| 826 |
) -> None:
|
| 827 |
self.api_key = api_key or os.environ.get("HF_TOKEN", "")
|
|
@@ -1017,7 +1018,7 @@ def create_llm_client(
|
|
| 1017 |
default_model = model or os.environ.get("GEMINI_MODEL", MODEL_GEMINI_FLASH)
|
| 1018 |
return GeminiClient(default_model=default_model)
|
| 1019 |
elif provider == PROVIDER_HF:
|
| 1020 |
-
default_model = model or os.environ.get("HF_MODEL",
|
| 1021 |
return HFInferenceClient(default_model=default_model)
|
| 1022 |
elif provider == PROVIDER_OLLAMA:
|
| 1023 |
default_model = model or os.environ.get("OLLAMA_MODEL", MODEL_LLAMA)
|
|
|
|
| 42 |
MODEL_GEMINI_PRO = "gemini-1.5-pro"
|
| 43 |
|
| 44 |
# Hugging Face Serverless Inference model IDs (free, no credit card)
|
| 45 |
+
MODEL_HF_ZEPHYR = "HuggingFaceH4/zephyr-7b-beta" # default — ungated, no license needed
|
| 46 |
MODEL_HF_LLAMA = "meta-llama/Llama-3.2-3B-Instruct"
|
| 47 |
MODEL_HF_QWEN = "Qwen/Qwen2.5-7B-Instruct"
|
| 48 |
MODEL_HF_MISTRAL = "mistralai/Mistral-7B-Instruct-v0.3"
|
|
|
|
| 822 |
def __init__(
|
| 823 |
self,
|
| 824 |
api_key: Optional[str] = None,
|
| 825 |
+
default_model: str = MODEL_HF_ZEPHYR,
|
| 826 |
max_retries: int = 3,
|
| 827 |
) -> None:
|
| 828 |
self.api_key = api_key or os.environ.get("HF_TOKEN", "")
|
|
|
|
| 1018 |
default_model = model or os.environ.get("GEMINI_MODEL", MODEL_GEMINI_FLASH)
|
| 1019 |
return GeminiClient(default_model=default_model)
|
| 1020 |
elif provider == PROVIDER_HF:
|
| 1021 |
+
default_model = model or os.environ.get("HF_MODEL", MODEL_HF_ZEPHYR)
|
| 1022 |
return HFInferenceClient(default_model=default_model)
|
| 1023 |
elif provider == PROVIDER_OLLAMA:
|
| 1024 |
default_model = model or os.environ.get("OLLAMA_MODEL", MODEL_LLAMA)
|