akhaliq HF Staff commited on
Commit
e6a4a9c
Β·
1 Parent(s): 228d4fe

feat: update default model to GLM-5.1 across backend and frontend configurations

Browse files
backend_api.py CHANGED
@@ -100,7 +100,8 @@ def get_cached_client(model_id: str, provider: str = "auto"):
100
 
101
  # Define models and languages here to avoid importing Gradio UI
102
  AVAILABLE_MODELS = [
103
- {"name": "Qwen3.5-397B πŸ€–", "id": "Qwen/Qwen3.5-397B-A17B", "description": "Qwen3.5-397B-A17B - Latest powerful model via HuggingFace Router (Default)", "supports_images": True},
 
104
  {"name": "MiniMax-M2.5 πŸ€–", "id": "MiniMaxAI/MiniMax-M2.5", "description": "MiniMax-M2.5 - Latest powerful coder model via HuggingFace Router with fastest provider", "supports_images": False},
105
  {"name": "GLM-5 🧠", "id": "zai-org/GLM-5", "description": "GLM-5 - New powerful reasoning model via HuggingFace Router", "supports_images": False},
106
  {"name": "Qwen3-Coder-Next πŸ€–", "id": "Qwen/Qwen3-Coder-Next", "description": "Qwen3-Coder-Next - Latest powerful coder model via HuggingFace Router with Novita provider", "supports_images": False},
@@ -200,7 +201,7 @@ async def startup_event():
200
  class CodeGenerationRequest(BaseModel):
201
  query: str
202
  language: str = "html"
203
- model_id: str = "Qwen/Qwen3.5-397B-A17B"
204
  provider: str = "auto"
205
  history: List[List[str]] = []
206
  agent_mode: bool = False
 
100
 
101
  # Define models and languages here to avoid importing Gradio UI
102
  AVAILABLE_MODELS = [
103
+ {"name": "GLM-5.1 πŸš€", "id": "zai-org/GLM-5.1", "description": "GLM-5.1 - Latest powerful model via HuggingFace Router with Novita provider (Default)", "supports_images": False},
104
+ {"name": "Qwen3.5-397B πŸ€–", "id": "Qwen/Qwen3.5-397B-A17B", "description": "Qwen3.5-397B-A17B - Latest powerful model via HuggingFace Router", "supports_images": True},
105
  {"name": "MiniMax-M2.5 πŸ€–", "id": "MiniMaxAI/MiniMax-M2.5", "description": "MiniMax-M2.5 - Latest powerful coder model via HuggingFace Router with fastest provider", "supports_images": False},
106
  {"name": "GLM-5 🧠", "id": "zai-org/GLM-5", "description": "GLM-5 - New powerful reasoning model via HuggingFace Router", "supports_images": False},
107
  {"name": "Qwen3-Coder-Next πŸ€–", "id": "Qwen/Qwen3-Coder-Next", "description": "Qwen3-Coder-Next - Latest powerful coder model via HuggingFace Router with Novita provider", "supports_images": False},
 
201
  class CodeGenerationRequest(BaseModel):
202
  query: str
203
  language: str = "html"
204
+ model_id: str = "zai-org/GLM-5.1"
205
  provider: str = "auto"
206
  history: List[List[str]] = []
207
  agent_mode: bool = False
backend_models.py CHANGED
@@ -127,6 +127,10 @@ def get_real_model_id(model_id: str) -> str:
127
  # GLM-5 via HuggingFace Router with Novita provider
128
  return "zai-org/GLM-5:novita"
129
 
 
 
 
 
130
  elif model_id == "moonshotai/Kimi-K2.5":
131
  # Kimi K2.5 needs Novita provider
132
  return "moonshotai/Kimi-K2.5:novita"
 
127
  # GLM-5 via HuggingFace Router with Novita provider
128
  return "zai-org/GLM-5:novita"
129
 
130
+ elif model_id == "zai-org/GLM-5.1":
131
+ # GLM-5.1 via HuggingFace Router with Novita provider
132
+ return "zai-org/GLM-5.1:novita"
133
+
134
  elif model_id == "moonshotai/Kimi-K2.5":
135
  # Kimi K2.5 needs Novita provider
136
  return "moonshotai/Kimi-K2.5:novita"
frontend/src/app/page.tsx CHANGED
@@ -17,7 +17,7 @@ export default function Home() {
17
 
18
  const [generatedCode, setGeneratedCode] = useState('');
19
  const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');
20
- const [selectedModel, setSelectedModel] = useState('Qwen/Qwen3.5-397B-A17B');
21
  const [models, setModels] = useState<Model[]>([]);
22
  const [isGenerating, setIsGenerating] = useState(false);
23
  const [isAuthenticated, setIsAuthenticated] = useState(false);
 
17
 
18
  const [generatedCode, setGeneratedCode] = useState('');
19
  const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');
20
+ const [selectedModel, setSelectedModel] = useState('zai-org/GLM-5.1');
21
  const [models, setModels] = useState<Model[]>([]);
22
  const [isGenerating, setIsGenerating] = useState(false);
23
  const [isAuthenticated, setIsAuthenticated] = useState(false);
frontend/src/components/ControlPanel.tsx CHANGED
@@ -89,6 +89,7 @@ export default function ControlPanel({
89
  };
90
 
91
  const formatModelName = (name: string, id: string) => {
 
92
  if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B πŸ€–';
93
  return name;
94
  };
@@ -200,7 +201,7 @@ export default function ControlPanel({
200
  >
201
  <div className="flex items-center justify-between gap-2">
202
  <span className="text-sm text-[#f5f5f7]">{formatModelName(model.name, model.id)}</span>
203
- {['Qwen/Qwen3.5-397B-A17B', 'MiniMaxAI/MiniMax-M2.5'].includes(model.id) && (
204
  <span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase flex-shrink-0">
205
  NEW
206
  </span>
 
89
  };
90
 
91
  const formatModelName = (name: string, id: string) => {
92
+ if (id === 'zai-org/GLM-5.1') return 'GLM-5.1 πŸš€';
93
  if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B πŸ€–';
94
  return name;
95
  };
 
201
  >
202
  <div className="flex items-center justify-between gap-2">
203
  <span className="text-sm text-[#f5f5f7]">{formatModelName(model.name, model.id)}</span>
204
+ {['zai-org/GLM-5.1', 'Qwen/Qwen3.5-397B-A17B', 'MiniMaxAI/MiniMax-M2.5'].includes(model.id) && (
205
  <span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase flex-shrink-0">
206
  NEW
207
  </span>
frontend/src/components/LandingPage.tsx CHANGED
@@ -31,7 +31,7 @@ export default function LandingPage({
31
  onImport,
32
  isAuthenticated,
33
  initialLanguage = 'html',
34
- initialModel = 'Qwen/Qwen3.5-397B-A17B',
35
  onAuthChange,
36
  setPendingPR,
37
  pendingPRRef
@@ -282,6 +282,7 @@ export default function LandingPage({
282
  };
283
 
284
  const formatModelName = (name: string, id: string) => {
 
285
  if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B πŸ€–';
286
  return name;
287
  };
@@ -519,8 +520,8 @@ ${isGradio ? '\n\nIMPORTANT: Only output app.py with the redesigned UI (themes,
519
  if (onStart) {
520
  // Pass duplicated space ID so auto-deploy updates it
521
  console.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);
522
- console.log('[Redesign] Using Qwen/Qwen3.5-397B-A17B for redesign');
523
- onStart(redesignPrompt, result.language || 'html', 'Qwen/Qwen3.5-397B-A17B', undefined, duplicatedRepoId);
524
  }
525
  }, 100);
526
 
@@ -564,8 +565,8 @@ Note: After generating the redesign, I will create a Pull Request on the origina
564
 
565
  if (onStart) {
566
  console.log('[Redesign] Will create PR - not passing repo ID');
567
- console.log('[Redesign] Using Qwen/Qwen3.5-397B-A17B for redesign');
568
- onStart(redesignPrompt, result.language || 'html', 'Qwen/Qwen3.5-397B-A17B', undefined, repoId, true); // Pass true for shouldCreatePR
569
  }
570
 
571
  console.log('[Redesign] Will create PR after code generation completes');
 
31
  onImport,
32
  isAuthenticated,
33
  initialLanguage = 'html',
34
+ initialModel = 'zai-org/GLM-5.1',
35
  onAuthChange,
36
  setPendingPR,
37
  pendingPRRef
 
282
  };
283
 
284
  const formatModelName = (name: string, id: string) => {
285
+ if (id === 'zai-org/GLM-5.1') return 'GLM-5.1 πŸš€';
286
  if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B πŸ€–';
287
  return name;
288
  };
 
520
  if (onStart) {
521
  // Pass duplicated space ID so auto-deploy updates it
522
  console.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);
523
+ console.log('[Redesign] Using zai-org/GLM-5.1 for redesign');
524
+ onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-5.1', undefined, duplicatedRepoId);
525
  }
526
  }, 100);
527
 
 
565
 
566
  if (onStart) {
567
  console.log('[Redesign] Will create PR - not passing repo ID');
568
+ console.log('[Redesign] Using zai-org/GLM-5.1 for redesign');
569
+ onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-5.1', undefined, repoId, true); // Pass true for shouldCreatePR
570
  }
571
 
572
  console.log('[Redesign] Will create PR after code generation completes');