Spaces:
Running
Running
Update all model IDs as requested
Browse files- patch_models.py +8 -10
patch_models.py
CHANGED
|
@@ -8,15 +8,16 @@ with open(AGENT_FILE, "r") as f:
|
|
| 8 |
# Add new models to AVAILABLE_MODELS
|
| 9 |
target = "AVAILABLE_MODELS = _available_models()\n"
|
| 10 |
patch = '''
|
| 11 |
-
# === PATCH: Add
|
| 12 |
import os as _os
|
| 13 |
AVAILABLE_MODELS.extend([
|
| 14 |
-
{"id": "openai/openrouter/owl-alpha", "label": "Owl Alpha
|
| 15 |
-
{"id": "openai/
|
|
|
|
| 16 |
{"id": "Qwen/Qwen3-Coder-Next", "label": "Qwen3 Coder Next", "provider": "huggingface", "tier": "free", "recommended": True},
|
| 17 |
-
{"id": "
|
| 18 |
-
{"id": "
|
| 19 |
-
{"id": "openai/google/gemini-2.0-flash-001", "label": "Gemini 2.0 Flash
|
| 20 |
])
|
| 21 |
PREMIUM_MODEL_IDS = set() # No premium gate
|
| 22 |
DEFAULT_FREE_MODEL_ID = "openai/openrouter/owl-alpha"
|
|
@@ -27,16 +28,14 @@ if target in content:
|
|
| 27 |
content = content.replace(target, target + patch)
|
| 28 |
print("✅ Added models to AVAILABLE_MODELS")
|
| 29 |
|
| 30 |
-
# Rename Claude
|
| 31 |
content = content.replace('"label": "Claude Opus 4.6"', '"label": "Owl Alpha (OpenRouter)"')
|
| 32 |
-
# Also change the Claude picker model ID to owl-alpha
|
| 33 |
content = content.replace('return session_manager.config.model_name', 'return "openai/openrouter/owl-alpha"')
|
| 34 |
print("✅ Renamed Claude → Owl Alpha")
|
| 35 |
|
| 36 |
# Fix title generation
|
| 37 |
old_patterns = [
|
| 38 |
'model="openai/openai/gpt-oss-120b:cerebras",\n api_base="https://router.huggingface.co/v1",\n api_key=api_key,',
|
| 39 |
-
'model="openrouter/openrouter/owl-alpha",\n api_key=_os.environ.get("OPENROUTER_API_KEY", api_key),',
|
| 40 |
'model="openai/openrouter/owl-alpha",\n api_base="https://openrouter.ai/api/v1",\n api_key=_os.environ.get("OPENROUTER_API_KEY", api_key),',
|
| 41 |
]
|
| 42 |
|
|
@@ -48,7 +47,6 @@ for old in old_patterns:
|
|
| 48 |
print(f"✅ Title generation patched")
|
| 49 |
break
|
| 50 |
|
| 51 |
-
# Remove reasoning_effort
|
| 52 |
content = content.replace(' reasoning_effort="low",\n', '')
|
| 53 |
|
| 54 |
import ast
|
|
|
|
| 8 |
# Add new models to AVAILABLE_MODELS
|
| 9 |
target = "AVAILABLE_MODELS = _available_models()\n"
|
| 10 |
patch = '''
|
| 11 |
+
# === PATCH: Add models ===
|
| 12 |
import os as _os
|
| 13 |
AVAILABLE_MODELS.extend([
|
| 14 |
+
{"id": "openai/openrouter/owl-alpha", "label": "Owl Alpha", "provider": "openrouter", "tier": "free", "recommended": True},
|
| 15 |
+
{"id": "openai/nvidia/nemotron-3-super-120b-a12b:free", "label": "Nemotron 3 Super 120B", "provider": "openrouter", "tier": "free", "recommended": True},
|
| 16 |
+
{"id": "openai/deepseek/deepseek-v4-pro", "label": "DeepSeek V4 Pro", "provider": "openrouter", "tier": "free", "recommended": True},
|
| 17 |
{"id": "Qwen/Qwen3-Coder-Next", "label": "Qwen3 Coder Next", "provider": "huggingface", "tier": "free", "recommended": True},
|
| 18 |
+
{"id": "openai/xiaomi/mimo-v2.5", "label": "Mimo V2.5", "provider": "openrouter", "tier": "free"},
|
| 19 |
+
{"id": "google/gemma-3-1b-it", "label": "Gemma 3 1B", "provider": "huggingface", "tier": "free"},
|
| 20 |
+
{"id": "openai/google/gemini-2.0-flash-001", "label": "Gemini 2.0 Flash", "provider": "openrouter", "tier": "free"},
|
| 21 |
])
|
| 22 |
PREMIUM_MODEL_IDS = set() # No premium gate
|
| 23 |
DEFAULT_FREE_MODEL_ID = "openai/openrouter/owl-alpha"
|
|
|
|
| 28 |
content = content.replace(target, target + patch)
|
| 29 |
print("✅ Added models to AVAILABLE_MODELS")
|
| 30 |
|
| 31 |
+
# Rename Claude → Owl Alpha
|
| 32 |
content = content.replace('"label": "Claude Opus 4.6"', '"label": "Owl Alpha (OpenRouter)"')
|
|
|
|
| 33 |
content = content.replace('return session_manager.config.model_name', 'return "openai/openrouter/owl-alpha"')
|
| 34 |
print("✅ Renamed Claude → Owl Alpha")
|
| 35 |
|
| 36 |
# Fix title generation
|
| 37 |
old_patterns = [
|
| 38 |
'model="openai/openai/gpt-oss-120b:cerebras",\n api_base="https://router.huggingface.co/v1",\n api_key=api_key,',
|
|
|
|
| 39 |
'model="openai/openrouter/owl-alpha",\n api_base="https://openrouter.ai/api/v1",\n api_key=_os.environ.get("OPENROUTER_API_KEY", api_key),',
|
| 40 |
]
|
| 41 |
|
|
|
|
| 47 |
print(f"✅ Title generation patched")
|
| 48 |
break
|
| 49 |
|
|
|
|
| 50 |
content = content.replace(' reasoning_effort="low",\n', '')
|
| 51 |
|
| 52 |
import ast
|