File size: 4,434 Bytes
fea82a5 62ab37d 5203fb1 df06783 dfa5975 25c9526 fea82a5 25c9526 4b77e8d 5203fb1 fea82a5 25c9526 5203fb1 fea82a5 5203fb1 fea82a5 25c9526 5203fb1 25c9526 5203fb1 25c9526 5203fb1 dceca0a 5203fb1 df06783 fea82a5 25c9526 e06f11b 34932a2 5203fb1 34932a2 5203fb1 dceca0a 34932a2 fea82a5 34932a2 62ab37d fea82a5 5203fb1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | """Patch frontend ChatInput.tsx: Fix model IDs and rename dropdown labels."""
FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
with open(FILE, "r") as f:
content = f.read()
# === Row 2: Claude Opus 4.6 → Owl Alpha ===
content = content.replace("'Claude Opus 4.6'", "'Owl Alpha'")
content = content.replace('"Claude Opus 4.6"', '"Owl Alpha"')
content = content.replace("'Claude Opus 4'", "'Owl Alpha'")
content = content.replace('"Claude Opus 4"', '"Owl Alpha"')
content = content.replace("'Claude Sonnet 4.5'", "'Owl Beta'")
content = content.replace('"Claude Sonnet 4.5"', '"Owl Beta"')
content = content.replace("claude.label ?? option.name", "option.name")
content = content.replace("claude.label || option.name", "option.name")
content = content.replace("description: 'Anthropic'", "description: '🦉 Top Reasoning'")
# === Row 1: Kimi K2.6 → DeepSeek V4 Pro (HF Inference) ===
content = content.replace("moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V4-Pro")
content = content.replace("'Kimi K2.6'", "'DeepSeek V4 Pro'")
content = content.replace('"Kimi K2.6"', '"DeepSeek V4 Pro"')
# === Row 4: MiniMax M2.7 → DeepSeek V4 Flash, Novita → HF Inference ===
content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
content = content.replace("'MiniMax M2.7'", "'DeepSeek V4 Flash'")
content = content.replace('"MiniMax M2.7"', '"DeepSeek V4 Flash"')
content = content.replace("description: 'Novita'", "description: 'HF Inference'", 1)
# === Row 5: GLM 5.1 → DeepSeek V4 Flash, Together → Openrouter ===
content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
content = content.replace("'GLM 5.1'", "'DeepSeek V4 Flash'")
content = content.replace('"GLM 5.1"', '"DeepSeek V4 Flash"')
content = content.replace("description: 'Together'", "description: 'Openrouter'")
# === Row 6: DeepSeek V4 Pro (DeepInfra) → nvidia/nemotron-3-super-120b-a12b:free ===
content = content.replace("deepseek-ai/DeepSeek-V4-Pro:deepinfra", "nvidia/nemotron-3-super-120b-a12b:free")
content = content.replace("description: 'DeepInfra'", "description: 'Openrouter Free'")
# Find the name for row 6 - it's the one with id 'deepseek-v4-pro'
# In source: id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro'
# We need to change name to show the nvidia model path
content = content.replace("id: 'deepseek-v4-pro',\n name: 'DeepSeek V4 Pro'", "id: 'nemotron-120b',\n name: 'nvidia/nemotron-3-super-120b-a12b:free'")
# === Row 1 description: second Novita (if any remains) ===
content = content.replace("description: 'Novita'", "description: 'HF Inference'")
# === Update generic descriptions ===
content = content.replace("'Best coding model'", "'⚡ Mạnh nhất · Code + Reasoning'")
content = content.replace("'Best all-around model'", "'⚡ Mạnh nhất · Code + Reasoning'")
# === Add custom models at end of array ===
idx_end = content.find("];", content.find("DEFAULT_MODEL_OPTIONS") if "DEFAULT_MODEL_OPTIONS" in content else 0)
if idx_end == -1:
idx_end = content.rfind("];", 0, content.find("export") if "export" in content else len(content))
if idx_end > 0:
new_models = """ {
id: 'gemma-3-1b',
name: 'Gemma 3 1B',
description: 'HF Inference',
modelPath: 'google/gemma-3-1b-it',
avatarUrl: 'https://huggingface.co/api/avatars/google',
recommended: true,
},
{
id: 'qwen3-coder-next',
name: 'Qwen3 Coder Next',
description: 'HF Inference',
modelPath: 'Qwen/Qwen3-Coder-Next',
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
recommended: true,
},
{
id: 'gemini-2.0-flash',
name: 'Gemini 2.0 Flash',
description: 'Openrouter',
modelPath: 'openai/google/gemini-2.0-flash-001',
avatarUrl: 'https://huggingface.co/api/avatars/google',
},
"""
content = content[:idx_end] + new_models + content[idx_end:]
with open(FILE, "w") as f:
f.write(content)
print("✅ Frontend patched:")
print(" Row 1: DeepSeek V4 Pro | HF Inference")
print(" Row 2: Owl Alpha | 🦉 Top Reasoning")
print(" Row 3: GPT-5.5 | OpenAI")
print(" Row 4: DeepSeek V4 Flash | HF Inference (was Novita)")
print(" Row 5: DeepSeek V4 Flash | Openrouter (was Together)")
print(" Row 6: nvidia/nemotron-3-super-120b-a12b:free | Openrouter Free")
print(" Row 7: Gemma 3 1B | HF Inference")
print(" Row 8: Qwen3 Coder Next | HF Inference")
print(" Row 9: Gemini 2.0 Flash | Openrouter")
|