bep40 commited on
Commit
25c9526
·
verified ·
1 Parent(s): df06783

Fix dropdown: rename providers + change model IDs for rows 4,5,6,7

Browse files
Files changed (1) hide show
  1. patch_frontend.py +40 -30
patch_frontend.py CHANGED
@@ -13,40 +13,46 @@ 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: change `claude.label ?? option.name` to always use option.name
17
  content = content.replace("claude.label ?? option.name", "option.name")
18
  content = content.replace("claude.label || option.name", "option.name")
19
 
20
- # Also rename description from 'Anthropic' to custom
21
  content = content.replace("description: 'Anthropic'", "description: '🦉 Top Reasoning'")
22
 
23
- # === Fix STT 1: moonshotai/Kimi-K2.6 → deepseek-ai/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-ai/kimi-2.6", "deepseek-ai/DeepSeek-V4-Pro")
27
- content = content.replace("'Kimi K2.6'", "'DeepSeek V4 Pro Inference'")
28
- content = content.replace('"Kimi K2.6"', '"DeepSeek V4 Pro Inference"')
29
- content = content.replace("'Kimi 2.6'", "'DeepSeek V4 Pro Inference'")
30
 
31
- # === Fix STT 4: MiniMaxAI/... → deepseek-ai/DeepSeek-V4-Flash (HF Inference) ===
32
  content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
33
- content = content.replace("MiniMaxAI/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
34
- content = content.replace("minimax/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
35
- content = content.replace("'MiniMax M2.7'", "'DeepSeek V4 Flash Inference'")
36
- content = content.replace('"MiniMax M2.7"', '"DeepSeek V4 Flash Inference"')
37
- content = content.replace("'MiniMax M1'", "'DeepSeek V4 Flash Inference'")
38
 
39
- # === Fix STT 5: zai-org/GLM-5.1 → openai/deepseek/deepseek-v4-flash (OpenRouter) ===
40
  content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
41
- content = content.replace("THUDM/GLM-4", "openai/deepseek/deepseek-v4-flash")
42
- content = content.replace("'GLM 5.1'", "'DeepSeek V4 Flash Openrouter'")
43
- content = content.replace('"GLM 5.1"', '"DeepSeek V4 Flash Openrouter"')
44
- content = content.replace("'GLM-4'", "'DeepSeek V4 Flash Openrouter'")
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  # === Update descriptions ===
47
  content = content.replace("'Best coding model'", "'⚡ Mạnh nhất · Code + Reasoning'")
48
  content = content.replace("'Best all-around model'", "'⚡ Mạnh nhất · Code + Reasoning'")
49
- content = content.replace("description: 'Novita'", "description: '⚡ Free HF Inference'", 1)
50
 
51
  # === Add custom models at end of array ===
52
  idx_end = content.find("];", content.find("DEFAULT_MODEL_OPTIONS") if "DEFAULT_MODEL_OPTIONS" in content else 0)
@@ -55,17 +61,17 @@ if idx_end == -1:
55
 
56
  if idx_end > 0:
57
  new_models = """ {
58
- id: 'owl-alpha',
59
- name: 'Owl Alpha Openrouter',
60
- description: '🦉 Top reasoning · Nhanh · OpenRouter',
61
- modelPath: 'openrouter/owl-alpha',
62
- avatarUrl: 'https://huggingface.co/api/avatars/openrouter',
63
  recommended: true,
64
  },
65
  {
66
  id: 'qwen3-coder-next',
67
  name: 'Qwen3 Coder Next',
68
- description: '🔥 Code cực mạnh · Free HF Inference',
69
  modelPath: 'Qwen/Qwen3-Coder-Next',
70
  avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
71
  recommended: true,
@@ -73,7 +79,7 @@ if idx_end > 0:
73
  {
74
  id: 'gemini-2.0-flash',
75
  name: 'Gemini 2.0 Flash',
76
- description: '💨 Siêu nhanh · Rẻ · OpenRouter',
77
  modelPath: 'openai/google/gemini-2.0-flash-001',
78
  avatarUrl: 'https://huggingface.co/api/avatars/google',
79
  },
@@ -84,7 +90,11 @@ with open(FILE, "w") as f:
84
  f.write(content)
85
 
86
  print("✅ Frontend patched:")
87
- print(" - 'Claude Opus 4.6' → 'Owl Alpha' (both quote styles)")
88
- print(" - 'Claude Sonnet 4.5' → 'Owl Beta'")
89
- print(" - Blocked API label override (always use patched name)")
90
- print(" - DeepSeek V4 Pro/Flash, Owl Alpha OR, Qwen3 Coder, Gemini Flash")
 
 
 
 
 
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 (HF Inference) - change Novita to HF Inference ===
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 (OpenRouter) - change Together to Openrouter ===
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 4 description: Novita → HF Inference (first occurrence only) ===
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 7 (added model): Owl Alpha Openrouter → google/gemma-3-1b-it HF Inference ===
51
+ # This is in the new_models section we add below, so we handle it there
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
 
57
  # === Add custom models at end of array ===
58
  idx_end = content.find("];", content.find("DEFAULT_MODEL_OPTIONS") if "DEFAULT_MODEL_OPTIONS" in content else 0)
 
61
 
62
  if idx_end > 0:
63
  new_models = """ {
64
+ id: 'gemma-3-1b',
65
+ name: 'Gemma 3 1B',
66
+ description: 'HF Inference',
67
+ modelPath: 'google/gemma-3-1b-it',
68
+ avatarUrl: 'https://huggingface.co/api/avatars/google',
69
  recommended: true,
70
  },
71
  {
72
  id: 'qwen3-coder-next',
73
  name: 'Qwen3 Coder Next',
74
+ description: '🔥 Code · Free HF Inference',
75
  modelPath: 'Qwen/Qwen3-Coder-Next',
76
  avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
77
  recommended: true,
 
79
  {
80
  id: 'gemini-2.0-flash',
81
  name: 'Gemini 2.0 Flash',
82
+ description: '💨 Siêu nhanh · Openrouter',
83
  modelPath: 'openai/google/gemini-2.0-flash-001',
84
  avatarUrl: 'https://huggingface.co/api/avatars/google',
85
  },
 
90
  f.write(content)
91
 
92
  print("✅ Frontend patched:")
93
+ print(" Row 1: DeepSeek V4 Pro (HF Inference)")
94
+ print(" Row 2: Owl Alpha (Top Reasoning) - was Claude Opus 4.6")
95
+ print(" Row 3: GPT-5.5 (OpenAI)")
96
+ print(" Row 4: DeepSeek V4 Flash (HF Inference) - was MiniMax/Novita")
97
+ print(" Row 5: DeepSeek V4 Flash (Openrouter) - was GLM/Together")
98
+ print(" Row 6: Nemotron 3 Super 120B (Openrouter Free) - was DeepSeek/DeepInfra")
99
+ print(" Row 7: Gemma 3 1B (HF Inference) - was Owl Alpha OR")
100
+ print(" + Qwen3 Coder Next, Gemini Flash")