Spaces:
Paused
Paused
Fix backend: litellm openrouter/openrouter/owl-alpha + set as default
Browse files- patch_models.py +4 -4
patch_models.py
CHANGED
|
@@ -11,15 +11,15 @@ patch = '''
|
|
| 11 |
# === PATCH: Add HF Inference + OpenRouter models ===
|
| 12 |
import os as _os
|
| 13 |
AVAILABLE_MODELS.extend([
|
|
|
|
| 14 |
{"id": "deepseek-ai/DeepSeek-V4-Pro", "label": "DeepSeek V4 Pro", "provider": "huggingface", "tier": "free", "recommended": True},
|
| 15 |
{"id": "Qwen/Qwen3-Coder-Next", "label": "Qwen3 Coder Next", "provider": "huggingface", "tier": "free", "recommended": True},
|
| 16 |
-
{"id": "openai/openrouter/owl-alpha", "label": "Owl Alpha Openrouter", "provider": "openrouter", "tier": "free", "recommended": True},
|
| 17 |
{"id": "MiniMaxAI/MiniMax-M2.7", "label": "MiniMax M2.7", "provider": "huggingface", "tier": "free"},
|
| 18 |
{"id": "zai-org/GLM-5.1", "label": "GLM 5.1", "provider": "huggingface", "tier": "free"},
|
| 19 |
-
{"id": "
|
| 20 |
])
|
| 21 |
PREMIUM_MODEL_IDS = set() # No premium gate
|
| 22 |
-
DEFAULT_FREE_MODEL_ID = "
|
| 23 |
# === END PATCH ===
|
| 24 |
'''
|
| 25 |
|
|
@@ -29,7 +29,7 @@ if target in content:
|
|
| 29 |
|
| 30 |
# Fix title generation
|
| 31 |
old_title = 'model="openai/openai/gpt-oss-120b:cerebras",\n api_base="https://router.huggingface.co/v1",\n api_key=api_key,'
|
| 32 |
-
new_title = 'model="
|
| 33 |
if old_title in content:
|
| 34 |
content = content.replace(old_title, new_title)
|
| 35 |
content = content.replace(' reasoning_effort="low",\n', '')
|
|
|
|
| 11 |
# === PATCH: Add HF Inference + OpenRouter models ===
|
| 12 |
import os as _os
|
| 13 |
AVAILABLE_MODELS.extend([
|
| 14 |
+
{"id": "openrouter/openrouter/owl-alpha", "label": "Owl Alpha Openrouter", "provider": "openrouter", "tier": "free", "recommended": True},
|
| 15 |
{"id": "deepseek-ai/DeepSeek-V4-Pro", "label": "DeepSeek V4 Pro", "provider": "huggingface", "tier": "free", "recommended": True},
|
| 16 |
{"id": "Qwen/Qwen3-Coder-Next", "label": "Qwen3 Coder Next", "provider": "huggingface", "tier": "free", "recommended": True},
|
|
|
|
| 17 |
{"id": "MiniMaxAI/MiniMax-M2.7", "label": "MiniMax M2.7", "provider": "huggingface", "tier": "free"},
|
| 18 |
{"id": "zai-org/GLM-5.1", "label": "GLM 5.1", "provider": "huggingface", "tier": "free"},
|
| 19 |
+
{"id": "openrouter/google/gemini-2.0-flash-001", "label": "Gemini 2.0 Flash", "provider": "openrouter", "tier": "free"},
|
| 20 |
])
|
| 21 |
PREMIUM_MODEL_IDS = set() # No premium gate
|
| 22 |
+
DEFAULT_FREE_MODEL_ID = "openrouter/openrouter/owl-alpha"
|
| 23 |
# === END PATCH ===
|
| 24 |
'''
|
| 25 |
|
|
|
|
| 29 |
|
| 30 |
# Fix title generation
|
| 31 |
old_title = 'model="openai/openai/gpt-oss-120b:cerebras",\n api_base="https://router.huggingface.co/v1",\n api_key=api_key,'
|
| 32 |
+
new_title = 'model="openrouter/openrouter/owl-alpha",\n api_base=_os.environ.get("OPENAI_API_BASE", "https://openrouter.ai/api/v1"),\n api_key=_os.environ.get("OPENAI_API_KEY", api_key),'
|
| 33 |
if old_title in content:
|
| 34 |
content = content.replace(old_title, new_title)
|
| 35 |
content = content.replace(' reasoning_effort="low",\n', '')
|