Fix dropdown names: row 4 Novita→HF Inference, row 6 name→nvidia/nemotron path
Browse files- patch_frontend.py +23 -28
patch_frontend.py
CHANGED
|
@@ -5,52 +5,46 @@ FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
|
|
| 5 |
with open(FILE, "r") as f:
|
| 6 |
content = f.read()
|
| 7 |
|
| 8 |
-
# ===
|
| 9 |
content = content.replace("'Claude Opus 4.6'", "'Owl Alpha'")
|
| 10 |
content = content.replace('"Claude Opus 4.6"', '"Owl Alpha"')
|
| 11 |
content = content.replace("'Claude Opus 4'", "'Owl Alpha'")
|
| 12 |
content = content.replace('"Claude Opus 4"', '"Owl Alpha"')
|
| 13 |
content = content.replace("'Claude Sonnet 4.5'", "'Owl Beta'")
|
| 14 |
content = content.replace('"Claude Sonnet 4.5"', '"Owl Beta"')
|
| 15 |
-
|
| 16 |
-
# Block API label override: always use patched name
|
| 17 |
content = content.replace("claude.label ?? option.name", "option.name")
|
| 18 |
content = content.replace("claude.label || option.name", "option.name")
|
| 19 |
-
|
| 20 |
-
# Rename Claude description
|
| 21 |
content = content.replace("description: 'Anthropic'", "description: '🦉 Top Reasoning'")
|
| 22 |
|
| 23 |
# === Row 1: Kimi K2.6 → DeepSeek V4 Pro (HF Inference) ===
|
| 24 |
content = content.replace("moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V4-Pro")
|
| 25 |
-
content = content.replace("moonshotai/kimi-k2.6", "deepseek-ai/DeepSeek-V4-Pro")
|
| 26 |
content = content.replace("'Kimi K2.6'", "'DeepSeek V4 Pro'")
|
| 27 |
content = content.replace('"Kimi K2.6"', '"DeepSeek V4 Pro"')
|
| 28 |
|
| 29 |
-
# === Row 4: MiniMax M2.7 → DeepSeek V4 Flash
|
| 30 |
content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
|
| 31 |
content = content.replace("'MiniMax M2.7'", "'DeepSeek V4 Flash'")
|
| 32 |
content = content.replace('"MiniMax M2.7"', '"DeepSeek V4 Flash"')
|
|
|
|
| 33 |
|
| 34 |
-
# === Row 5: GLM 5.1 → DeepSeek V4 Flash
|
| 35 |
content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
|
| 36 |
content = content.replace("'GLM 5.1'", "'DeepSeek V4 Flash'")
|
| 37 |
content = content.replace('"GLM 5.1"', '"DeepSeek V4 Flash"')
|
| 38 |
content = content.replace("description: 'Together'", "description: 'Openrouter'")
|
| 39 |
|
| 40 |
-
# === Row
|
| 41 |
-
content = content.replace("description: 'Novita'", "description: 'HF Inference'", 1)
|
| 42 |
-
|
| 43 |
-
# === Row 6: DeepSeek V4 Pro DeepInfra → nvidia/nemotron-3-super-120b-a12b:free ===
|
| 44 |
content = content.replace("deepseek-ai/DeepSeek-V4-Pro:deepinfra", "nvidia/nemotron-3-super-120b-a12b:free")
|
| 45 |
-
content = content.replace("'DeepSeek V4 Pro'", "'Nemotron 3 Super 120B'", 1) # only the DeepInfra one (last occurrence)
|
| 46 |
-
# Fix: need to target specifically row 6 which has :deepinfra
|
| 47 |
-
# The modelPath for row 6 was 'deepseek-ai/DeepSeek-V4-Pro:deepinfra' → now 'nvidia/nemotron-3-super-120b-a12b:free'
|
| 48 |
content = content.replace("description: 'DeepInfra'", "description: 'Openrouter Free'")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
# === Row
|
| 51 |
-
|
| 52 |
|
| 53 |
-
# === Update descriptions ===
|
| 54 |
content = content.replace("'Best coding model'", "'⚡ Mạnh nhất · Code + Reasoning'")
|
| 55 |
content = content.replace("'Best all-around model'", "'⚡ Mạnh nhất · Code + Reasoning'")
|
| 56 |
|
|
@@ -71,7 +65,7 @@ if idx_end > 0:
|
|
| 71 |
{
|
| 72 |
id: 'qwen3-coder-next',
|
| 73 |
name: 'Qwen3 Coder Next',
|
| 74 |
-
description: '
|
| 75 |
modelPath: 'Qwen/Qwen3-Coder-Next',
|
| 76 |
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
|
| 77 |
recommended: true,
|
|
@@ -79,7 +73,7 @@ if idx_end > 0:
|
|
| 79 |
{
|
| 80 |
id: 'gemini-2.0-flash',
|
| 81 |
name: 'Gemini 2.0 Flash',
|
| 82 |
-
description: '
|
| 83 |
modelPath: 'openai/google/gemini-2.0-flash-001',
|
| 84 |
avatarUrl: 'https://huggingface.co/api/avatars/google',
|
| 85 |
},
|
|
@@ -90,11 +84,12 @@ with open(FILE, "w") as f:
|
|
| 90 |
f.write(content)
|
| 91 |
|
| 92 |
print("✅ Frontend patched:")
|
| 93 |
-
print(" Row 1: DeepSeek V4 Pro
|
| 94 |
-
print(" Row 2: Owl Alpha
|
| 95 |
-
print(" Row 3: GPT-5.5
|
| 96 |
-
print(" Row 4: DeepSeek V4 Flash
|
| 97 |
-
print(" Row 5: DeepSeek V4 Flash
|
| 98 |
-
print(" Row 6:
|
| 99 |
-
print(" Row 7: Gemma 3 1B
|
| 100 |
-
print("
|
|
|
|
|
|
| 5 |
with open(FILE, "r") as f:
|
| 6 |
content = f.read()
|
| 7 |
|
| 8 |
+
# === Row 2: Claude Opus 4.6 → Owl Alpha ===
|
| 9 |
content = content.replace("'Claude Opus 4.6'", "'Owl Alpha'")
|
| 10 |
content = content.replace('"Claude Opus 4.6"', '"Owl Alpha"')
|
| 11 |
content = content.replace("'Claude Opus 4'", "'Owl Alpha'")
|
| 12 |
content = content.replace('"Claude Opus 4"', '"Owl Alpha"')
|
| 13 |
content = content.replace("'Claude Sonnet 4.5'", "'Owl Beta'")
|
| 14 |
content = content.replace('"Claude Sonnet 4.5"', '"Owl Beta"')
|
|
|
|
|
|
|
| 15 |
content = content.replace("claude.label ?? option.name", "option.name")
|
| 16 |
content = content.replace("claude.label || option.name", "option.name")
|
|
|
|
|
|
|
| 17 |
content = content.replace("description: 'Anthropic'", "description: '🦉 Top Reasoning'")
|
| 18 |
|
| 19 |
# === Row 1: Kimi K2.6 → DeepSeek V4 Pro (HF Inference) ===
|
| 20 |
content = content.replace("moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V4-Pro")
|
|
|
|
| 21 |
content = content.replace("'Kimi K2.6'", "'DeepSeek V4 Pro'")
|
| 22 |
content = content.replace('"Kimi K2.6"', '"DeepSeek V4 Pro"')
|
| 23 |
|
| 24 |
+
# === Row 4: MiniMax M2.7 → DeepSeek V4 Flash, Novita → HF Inference ===
|
| 25 |
content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
|
| 26 |
content = content.replace("'MiniMax M2.7'", "'DeepSeek V4 Flash'")
|
| 27 |
content = content.replace('"MiniMax M2.7"', '"DeepSeek V4 Flash"')
|
| 28 |
+
content = content.replace("description: 'Novita'", "description: 'HF Inference'", 1)
|
| 29 |
|
| 30 |
+
# === Row 5: GLM 5.1 → DeepSeek V4 Flash, Together → Openrouter ===
|
| 31 |
content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
|
| 32 |
content = content.replace("'GLM 5.1'", "'DeepSeek V4 Flash'")
|
| 33 |
content = content.replace('"GLM 5.1"', '"DeepSeek V4 Flash"')
|
| 34 |
content = content.replace("description: 'Together'", "description: 'Openrouter'")
|
| 35 |
|
| 36 |
+
# === Row 6: DeepSeek V4 Pro (DeepInfra) → nvidia/nemotron-3-super-120b-a12b:free ===
|
|
|
|
|
|
|
|
|
|
| 37 |
content = content.replace("deepseek-ai/DeepSeek-V4-Pro:deepinfra", "nvidia/nemotron-3-super-120b-a12b:free")
|
|
|
|
|
|
|
|
|
|
| 38 |
content = content.replace("description: 'DeepInfra'", "description: 'Openrouter Free'")
|
| 39 |
+
# Find the name for row 6 - it's the one with id 'deepseek-v4-pro'
|
| 40 |
+
# In source: id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro'
|
| 41 |
+
# We need to change name to show the nvidia model path
|
| 42 |
+
content = content.replace("id: 'deepseek-v4-pro',\n name: 'DeepSeek V4 Pro'", "id: 'nemotron-120b',\n name: 'nvidia/nemotron-3-super-120b-a12b:free'")
|
| 43 |
|
| 44 |
+
# === Row 1 description: second Novita (if any remains) ===
|
| 45 |
+
content = content.replace("description: 'Novita'", "description: 'HF Inference'")
|
| 46 |
|
| 47 |
+
# === Update generic descriptions ===
|
| 48 |
content = content.replace("'Best coding model'", "'⚡ Mạnh nhất · Code + Reasoning'")
|
| 49 |
content = content.replace("'Best all-around model'", "'⚡ Mạnh nhất · Code + Reasoning'")
|
| 50 |
|
|
|
|
| 65 |
{
|
| 66 |
id: 'qwen3-coder-next',
|
| 67 |
name: 'Qwen3 Coder Next',
|
| 68 |
+
description: 'HF Inference',
|
| 69 |
modelPath: 'Qwen/Qwen3-Coder-Next',
|
| 70 |
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
|
| 71 |
recommended: true,
|
|
|
|
| 73 |
{
|
| 74 |
id: 'gemini-2.0-flash',
|
| 75 |
name: 'Gemini 2.0 Flash',
|
| 76 |
+
description: 'Openrouter',
|
| 77 |
modelPath: 'openai/google/gemini-2.0-flash-001',
|
| 78 |
avatarUrl: 'https://huggingface.co/api/avatars/google',
|
| 79 |
},
|
|
|
|
| 84 |
f.write(content)
|
| 85 |
|
| 86 |
print("✅ Frontend patched:")
|
| 87 |
+
print(" Row 1: DeepSeek V4 Pro | HF Inference")
|
| 88 |
+
print(" Row 2: Owl Alpha | 🦉 Top Reasoning")
|
| 89 |
+
print(" Row 3: GPT-5.5 | OpenAI")
|
| 90 |
+
print(" Row 4: DeepSeek V4 Flash | HF Inference (was Novita)")
|
| 91 |
+
print(" Row 5: DeepSeek V4 Flash | Openrouter (was Together)")
|
| 92 |
+
print(" Row 6: nvidia/nemotron-3-super-120b-a12b:free | Openrouter Free")
|
| 93 |
+
print(" Row 7: Gemma 3 1B | HF Inference")
|
| 94 |
+
print(" Row 8: Qwen3 Coder Next | HF Inference")
|
| 95 |
+
print(" Row 9: Gemini 2.0 Flash | Openrouter")
|