bep40 commited on
Commit
5743f66
·
verified ·
1 Parent(s): 315c11a

Update dropdown names with performance notes

Browse files
Files changed (1) hide show
  1. patch_frontend.py +21 -15
patch_frontend.py CHANGED
@@ -1,4 +1,4 @@
1
- """Patch frontend ChatInput.tsx: Fix model IDs in dropdown."""
2
 
3
  FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
4
 
@@ -9,21 +9,26 @@ with open(FILE, "r") as f:
9
  content = content.replace("moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V4-Pro")
10
  content = content.replace("moonshotai/kimi-k2.6", "deepseek-ai/DeepSeek-V4-Pro")
11
  content = content.replace("kimi-ai/kimi-2.6", "deepseek-ai/DeepSeek-V4-Pro")
12
- content = content.replace("Kimi K2.6", "DeepSeek V4 Pro")
13
- content = content.replace("Kimi 2.6", "DeepSeek V4 Pro")
14
 
15
  # === Fix STT 4: MiniMaxAI/... → deepseek-ai/DeepSeek-V4-Flash (HF Inference) ===
16
  content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
17
  content = content.replace("MiniMaxAI/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
18
  content = content.replace("minimax/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
19
- content = content.replace("MiniMax M2.7", "DeepSeek V4 Flash")
20
- content = content.replace("MiniMax M1", "DeepSeek V4 Flash")
21
 
22
  # === Fix STT 5: zai-org/GLM-5.1 → openai/deepseek/deepseek-v4-flash (OpenRouter) ===
23
  content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
24
  content = content.replace("THUDM/GLM-4", "openai/deepseek/deepseek-v4-flash")
25
- content = content.replace("GLM 5.1", "DeepSeek V4 Flash (OR)")
26
- content = content.replace("GLM-4", "DeepSeek V4 Flash (OR)")
 
 
 
 
 
27
 
28
  # === Add custom models at end of array ===
29
  idx_end = content.find("];", content.find("DEFAULT_MODEL_OPTIONS") if "DEFAULT_MODEL_OPTIONS" in content else 0)
@@ -33,8 +38,8 @@ if idx_end == -1:
33
  if idx_end > 0:
34
  new_models = """ {
35
  id: 'owl-alpha',
36
- name: 'Owl Alpha',
37
- description: 'OpenRouter · mạnh',
38
  modelPath: 'openrouter/owl-alpha',
39
  avatarUrl: 'https://huggingface.co/api/avatars/openrouter',
40
  recommended: true,
@@ -42,7 +47,7 @@ if idx_end > 0:
42
  {
43
  id: 'qwen3-coder-next',
44
  name: 'Qwen3 Coder Next',
45
- description: 'Code mạnh · HF Inference',
46
  modelPath: 'Qwen/Qwen3-Coder-Next',
47
  avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
48
  recommended: true,
@@ -50,7 +55,7 @@ if idx_end > 0:
50
  {
51
  id: 'gemini-2.0-flash',
52
  name: 'Gemini 2.0 Flash',
53
- description: 'OpenRouter · nhanh',
54
  modelPath: 'openai/google/gemini-2.0-flash-001',
55
  avatarUrl: 'https://huggingface.co/api/avatars/google',
56
  },
@@ -61,7 +66,8 @@ with open(FILE, "w") as f:
61
  f.write(content)
62
 
63
  print("✅ Frontend patched:")
64
- print(" STT1: moonshotai/Kimi-K2.6 → deepseek-ai/DeepSeek-V4-Pro (HF)")
65
- print(" STT4: MiniMaxAI/... deepseek-ai/DeepSeek-V4-Flash (HF)")
66
- print(" STT5: zai-org/GLM-5.1 openai/deepseek/deepseek-v4-flash (OR)")
67
- print(" Added: Owl Alpha, Qwen3 Coder Next, Gemini Flash")
 
 
1
+ """Patch frontend ChatInput.tsx: Fix model IDs and rename dropdown labels."""
2
 
3
  FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
4
 
 
9
  content = content.replace("moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V4-Pro")
10
  content = content.replace("moonshotai/kimi-k2.6", "deepseek-ai/DeepSeek-V4-Pro")
11
  content = content.replace("kimi-ai/kimi-2.6", "deepseek-ai/DeepSeek-V4-Pro")
12
+ content = content.replace("Kimi K2.6", "DeepSeek V4 Pro Inference")
13
+ content = content.replace("Kimi 2.6", "DeepSeek V4 Pro Inference")
14
 
15
  # === Fix STT 4: MiniMaxAI/... → deepseek-ai/DeepSeek-V4-Flash (HF Inference) ===
16
  content = content.replace("MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash")
17
  content = content.replace("MiniMaxAI/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
18
  content = content.replace("minimax/MiniMax-M1", "deepseek-ai/DeepSeek-V4-Flash")
19
+ content = content.replace("MiniMax M2.7", "DeepSeek V4 Flash Inference")
20
+ content = content.replace("MiniMax M1", "DeepSeek V4 Flash Inference")
21
 
22
  # === Fix STT 5: zai-org/GLM-5.1 → openai/deepseek/deepseek-v4-flash (OpenRouter) ===
23
  content = content.replace("zai-org/GLM-5.1", "openai/deepseek/deepseek-v4-flash")
24
  content = content.replace("THUDM/GLM-4", "openai/deepseek/deepseek-v4-flash")
25
+ content = content.replace("GLM 5.1", "DeepSeek V4 Flash Openrouter")
26
+ content = content.replace("GLM-4", "DeepSeek V4 Flash Openrouter")
27
+
28
+ # === Update descriptions for performance notes ===
29
+ # STT1 description
30
+ content = content.replace("'Best coding model'", "'⚡ Mạnh nhất · Code + Reasoning · Free HF Inference'")
31
+ content = content.replace("'Best all-around model'", "'⚡ Mạnh nhất · Code + Reasoning · Free HF Inference'")
32
 
33
  # === Add custom models at end of array ===
34
  idx_end = content.find("];", content.find("DEFAULT_MODEL_OPTIONS") if "DEFAULT_MODEL_OPTIONS" in content else 0)
 
38
  if idx_end > 0:
39
  new_models = """ {
40
  id: 'owl-alpha',
41
+ name: 'Owl Alpha Openrouter',
42
+ description: '🦉 Top reasoning · Nhanh · OpenRouter',
43
  modelPath: 'openrouter/owl-alpha',
44
  avatarUrl: 'https://huggingface.co/api/avatars/openrouter',
45
  recommended: true,
 
47
  {
48
  id: 'qwen3-coder-next',
49
  name: 'Qwen3 Coder Next',
50
+ description: '🔥 Code cực mạnh · Free HF Inference',
51
  modelPath: 'Qwen/Qwen3-Coder-Next',
52
  avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
53
  recommended: true,
 
55
  {
56
  id: 'gemini-2.0-flash',
57
  name: 'Gemini 2.0 Flash',
58
+ description: '💨 Siêu nhanh · Rẻ · OpenRouter',
59
  modelPath: 'openai/google/gemini-2.0-flash-001',
60
  avatarUrl: 'https://huggingface.co/api/avatars/google',
61
  },
 
66
  f.write(content)
67
 
68
  print("✅ Frontend patched:")
69
+ print(" 1. DeepSeek V4 Pro Inference (⚡ Mạnh nhất)")
70
+ print(" 2. Owl Alpha Openrouter (🦉 Top reasoning)")
71
+ print(" 4. DeepSeek V4 Flash Inference (Free HF)")
72
+ print(" 5. DeepSeek V4 Flash Openrouter (OR)")
73
+ print(" + Qwen3 Coder Next, Gemini Flash")