Update frontend: Claude→DeepSeek V3, add Qwen3-235B HF Inference
Browse files- patch_frontend.py +34 -14
patch_frontend.py
CHANGED
|
@@ -1,24 +1,37 @@
|
|
| 1 |
-
"""Patch frontend ChatInput.tsx:
|
| 2 |
|
| 3 |
FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
|
| 4 |
|
| 5 |
with open(FILE, "r") as f:
|
| 6 |
content = f.read()
|
| 7 |
|
| 8 |
-
# Remove Kimi K2.6 entry
|
| 9 |
import re
|
| 10 |
-
content = re.sub(r" \{\s*id: 'kimi-k2\.6'.*?\},\n", "", content, flags=re.DOTALL)
|
| 11 |
-
print("✅ Removed Kimi K2.6")
|
| 12 |
|
| 13 |
-
# Remove
|
|
|
|
|
|
|
| 14 |
content = re.sub(r" \{\s*id: 'minimax-m2\.7'.*?\},\n", "", content, flags=re.DOTALL)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
# Remove GLM entry
|
| 18 |
content = re.sub(r" \{\s*id: 'glm-5\.1'.*?\},\n", "", content, flags=re.DOTALL)
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
new_models = """ {
|
| 23 |
id: 'gemini-2.0-flash',
|
| 24 |
name: 'Gemini 2.0 Flash',
|
|
@@ -34,6 +47,13 @@ new_models = """ {
|
|
| 34 |
modelPath: 'openai/qwen/qwen3-30b-a3b',
|
| 35 |
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
|
| 36 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
"""
|
| 38 |
|
| 39 |
target = " },\n];\n\nconst findModelByPath"
|
|
@@ -41,9 +61,8 @@ replacement = " },\n" + new_models + "];\n\nconst findModelByPath"
|
|
| 41 |
|
| 42 |
if target in content:
|
| 43 |
content = content.replace(target, replacement)
|
| 44 |
-
print("✅ Added Gemini 2.0 Flash
|
| 45 |
else:
|
| 46 |
-
# Try finding the array end differently
|
| 47 |
idx = content.rfind("},\n];", 0, content.find("findModelByPath"))
|
| 48 |
if idx > 0:
|
| 49 |
content = content[:idx+3] + "\n" + new_models + content[idx+3:]
|
|
@@ -55,10 +74,11 @@ else:
|
|
| 55 |
with open(FILE, "w") as f:
|
| 56 |
f.write(content)
|
| 57 |
|
|
|
|
| 58 |
assert "gemini-2.0-flash" in content
|
| 59 |
assert "qwen3-30b" in content
|
|
|
|
| 60 |
assert "kimi-k2.6" not in content
|
| 61 |
assert "minimax-m2.7" not in content
|
| 62 |
assert "glm-5.1" not in content
|
| 63 |
-
print("\n✅
|
| 64 |
-
print(" Dropdown: DeepSeek V3, Claude, GPT-5.5, DeepSeek V4, Gemini 2.0 Flash, Qwen3 30B")
|
|
|
|
| 1 |
+
"""Patch frontend ChatInput.tsx: Remove Kimi/MiniMax/GLM, Claude→DeepSeek V3, add Gemini+Qwen3+Qwen235B."""
|
| 2 |
|
| 3 |
FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
|
| 4 |
|
| 5 |
with open(FILE, "r") as f:
|
| 6 |
content = f.read()
|
| 7 |
|
|
|
|
| 8 |
import re
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
# Remove Kimi K2.6
|
| 11 |
+
content = re.sub(r" \{\s*id: 'kimi-k2\.6'.*?\},\n", "", content, flags=re.DOTALL)
|
| 12 |
+
# Remove MiniMax
|
| 13 |
content = re.sub(r" \{\s*id: 'minimax-m2\.7'.*?\},\n", "", content, flags=re.DOTALL)
|
| 14 |
+
# Remove GLM
|
|
|
|
|
|
|
| 15 |
content = re.sub(r" \{\s*id: 'glm-5\.1'.*?\},\n", "", content, flags=re.DOTALL)
|
| 16 |
+
# Remove DeepSeek V4 Pro (redundant with V3)
|
| 17 |
+
content = re.sub(r" \{\s*id: 'deepseek-v4-pro'.*?\},\n", "", content, flags=re.DOTALL)
|
| 18 |
+
print("✅ Removed Kimi, MiniMax, GLM, DeepSeek V4")
|
| 19 |
|
| 20 |
+
# Replace Claude Opus entry with DeepSeek V3
|
| 21 |
+
claude_pattern = r" \{\s*id: 'claude-opus'.*?\},\n"
|
| 22 |
+
deepseek_v3 = """ {
|
| 23 |
+
id: 'deepseek-v3',
|
| 24 |
+
name: 'DeepSeek V3',
|
| 25 |
+
description: 'OpenRouter',
|
| 26 |
+
modelPath: 'openai/deepseek/deepseek-chat-v3-0324',
|
| 27 |
+
avatarUrl: 'https://huggingface.co/api/avatars/deepseek-ai',
|
| 28 |
+
recommended: true,
|
| 29 |
+
},
|
| 30 |
+
"""
|
| 31 |
+
content = re.sub(claude_pattern, deepseek_v3, content, flags=re.DOTALL)
|
| 32 |
+
print("✅ Replaced Claude Opus with DeepSeek V3")
|
| 33 |
+
|
| 34 |
+
# Add Gemini + Qwen3 30B + Qwen3 235B before closing "];"
|
| 35 |
new_models = """ {
|
| 36 |
id: 'gemini-2.0-flash',
|
| 37 |
name: 'Gemini 2.0 Flash',
|
|
|
|
| 47 |
modelPath: 'openai/qwen/qwen3-30b-a3b',
|
| 48 |
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
|
| 49 |
},
|
| 50 |
+
{
|
| 51 |
+
id: 'qwen3-235b',
|
| 52 |
+
name: 'Qwen3 235B',
|
| 53 |
+
description: 'HF Inference',
|
| 54 |
+
modelPath: 'Qwen/Qwen3-235B-A22B',
|
| 55 |
+
avatarUrl: 'https://huggingface.co/api/avatars/Qwen',
|
| 56 |
+
},
|
| 57 |
"""
|
| 58 |
|
| 59 |
target = " },\n];\n\nconst findModelByPath"
|
|
|
|
| 61 |
|
| 62 |
if target in content:
|
| 63 |
content = content.replace(target, replacement)
|
| 64 |
+
print("✅ Added Gemini 2.0 Flash, Qwen3 30B, Qwen3 235B")
|
| 65 |
else:
|
|
|
|
| 66 |
idx = content.rfind("},\n];", 0, content.find("findModelByPath"))
|
| 67 |
if idx > 0:
|
| 68 |
content = content[:idx+3] + "\n" + new_models + content[idx+3:]
|
|
|
|
| 74 |
with open(FILE, "w") as f:
|
| 75 |
f.write(content)
|
| 76 |
|
| 77 |
+
assert "deepseek-v3" in content
|
| 78 |
assert "gemini-2.0-flash" in content
|
| 79 |
assert "qwen3-30b" in content
|
| 80 |
+
assert "qwen3-235b" in content
|
| 81 |
assert "kimi-k2.6" not in content
|
| 82 |
assert "minimax-m2.7" not in content
|
| 83 |
assert "glm-5.1" not in content
|
| 84 |
+
print("\n✅ Dropdown: DeepSeek V3, GPT-5.5, Gemini 2.0 Flash, Qwen3 30B, Qwen3 235B (HF)")
|
|
|