akhaliq HF Staff commited on
Commit
064802b
·
1 Parent(s): faf8431

update provider to cerebras

Browse files
backend_api.py CHANGED
@@ -98,8 +98,8 @@ def get_cached_client(model_id: str, provider: str = "auto"):
98
 
99
  # Define models and languages here to avoid importing Gradio UI
100
  AVAILABLE_MODELS = [
101
- {"name": "MiniMax M2.1", "id": "MiniMaxAI/MiniMax-M2.1", "description": "MiniMax M2.1 - Enhanced model via HuggingFace Router (Default)", "supports_images": False},
102
- {"name": "GLM-4.7", "id": "zai-org/GLM-4.7", "description": "GLM-4.7 - Latest GLM model via HuggingFace Router with Novita provider", "supports_images": False},
103
  {"name": "GLM-4.6", "id": "zai-org/GLM-4.6", "description": "GLM-4.6 model via HuggingFace with Cerebras provider", "supports_images": False},
104
  {"name": "GLM-4.6V 👁️", "id": "zai-org/GLM-4.6V:zai-org", "description": "GLM-4.6V vision model - supports image uploads for visual understanding", "supports_images": True},
105
  {"name": "DeepSeek V3", "id": "deepseek-ai/DeepSeek-V3", "description": "DeepSeek V3 - Fast model for code generation via HuggingFace Router with Novita provider", "supports_images": False},
@@ -192,7 +192,7 @@ async def startup_event():
192
  class CodeGenerationRequest(BaseModel):
193
  query: str
194
  language: str = "html"
195
- model_id: str = "MiniMaxAI/MiniMax-M2.1"
196
  provider: str = "auto"
197
  history: List[List[str]] = []
198
  agent_mode: bool = False
 
98
 
99
  # Define models and languages here to avoid importing Gradio UI
100
  AVAILABLE_MODELS = [
101
+ {"name": "GLM-4.7", "id": "zai-org/GLM-4.7", "description": "GLM-4.7 - Latest GLM model via HuggingFace Router with Cerebras provider (Default)", "supports_images": False},
102
+ {"name": "MiniMax M2.1", "id": "MiniMaxAI/MiniMax-M2.1", "description": "MiniMax M2.1 - Enhanced model via HuggingFace Router", "supports_images": False},
103
  {"name": "GLM-4.6", "id": "zai-org/GLM-4.6", "description": "GLM-4.6 model via HuggingFace with Cerebras provider", "supports_images": False},
104
  {"name": "GLM-4.6V 👁️", "id": "zai-org/GLM-4.6V:zai-org", "description": "GLM-4.6V vision model - supports image uploads for visual understanding", "supports_images": True},
105
  {"name": "DeepSeek V3", "id": "deepseek-ai/DeepSeek-V3", "description": "DeepSeek V3 - Fast model for code generation via HuggingFace Router with Novita provider", "supports_images": False},
 
192
  class CodeGenerationRequest(BaseModel):
193
  query: str
194
  language: str = "html"
195
+ model_id: str = "zai-org/GLM-4.7"
196
  provider: str = "auto"
197
  history: List[List[str]] = []
198
  agent_mode: bool = False
backend_models.py CHANGED
@@ -96,8 +96,8 @@ def get_real_model_id(model_id: str) -> str:
96
  return "zai-org/GLM-4.5:fireworks-ai"
97
 
98
  elif model_id == "zai-org/GLM-4.7":
99
- # GLM-4.7 needs novita provider suffix
100
- return "zai-org/GLM-4.7:novita"
101
 
102
  return model_id
103
 
 
96
  return "zai-org/GLM-4.5:fireworks-ai"
97
 
98
  elif model_id == "zai-org/GLM-4.7":
99
+ # GLM-4.7 needs cerebras provider suffix
100
+ return "zai-org/GLM-4.7:cerebras"
101
 
102
  return model_id
103
 
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('MiniMaxAI/MiniMax-M2.1');
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-4.7');
21
  const [models, setModels] = useState<Model[]>([]);
22
  const [isGenerating, setIsGenerating] = useState(false);
23
  const [isAuthenticated, setIsAuthenticated] = useState(false);
frontend/src/components/ControlPanel.tsx CHANGED
@@ -196,7 +196,7 @@ export default function ControlPanel({
196
  >
197
  <div className="flex items-center justify-between gap-2">
198
  <span className="text-sm text-[#f5f5f7]">{model.name}</span>
199
- {(model.id === 'zai-org/GLM-4.7' || model.id === 'MiniMaxAI/MiniMax-M2.1') && (
200
  <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">
201
  NEW
202
  </span>
 
196
  >
197
  <div className="flex items-center justify-between gap-2">
198
  <span className="text-sm text-[#f5f5f7]">{model.name}</span>
199
+ {model.id === 'zai-org/GLM-4.7' && (
200
  <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">
201
  NEW
202
  </span>
frontend/src/components/LandingPage.tsx CHANGED
@@ -31,7 +31,7 @@ export default function LandingPage({
31
  onImport,
32
  isAuthenticated,
33
  initialLanguage = 'html',
34
- initialModel = 'MiniMaxAI/MiniMax-M2.1',
35
  onAuthChange,
36
  setPendingPR,
37
  pendingPRRef
@@ -513,8 +513,8 @@ ${isGradio ? '\n\nIMPORTANT: Only output app.py with the redesigned UI (themes,
513
  if (onStart) {
514
  // Pass duplicated space ID so auto-deploy updates it
515
  console.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);
516
- console.log('[Redesign] Using MiniMax M2.1 for redesign');
517
- onStart(redesignPrompt, result.language || 'html', 'MiniMaxAI/MiniMax-M2.1', undefined, duplicatedRepoId);
518
  }
519
  }, 100);
520
 
@@ -558,8 +558,8 @@ Note: After generating the redesign, I will create a Pull Request on the origina
558
 
559
  if (onStart) {
560
  console.log('[Redesign] Will create PR - not passing repo ID');
561
- console.log('[Redesign] Using MiniMax M2.1 for redesign');
562
- onStart(redesignPrompt, result.language || 'html', 'MiniMaxAI/MiniMax-M2.1', undefined, repoId, true); // Pass true for shouldCreatePR
563
  }
564
 
565
  console.log('[Redesign] Will create PR after code generation completes');
@@ -833,7 +833,7 @@ Note: After generating the redesign, I will create a Pull Request on the origina
833
  >
834
  <div className="flex items-center justify-between gap-2">
835
  <span className="text-xs font-medium text-[#f5f5f7]">{model.name}</span>
836
- {(model.id === 'zai-org/GLM-4.7' || model.id === 'MiniMaxAI/MiniMax-M2.1') && (
837
  <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">
838
  NEW
839
  </span>
 
31
  onImport,
32
  isAuthenticated,
33
  initialLanguage = 'html',
34
+ initialModel = 'zai-org/GLM-4.7',
35
  onAuthChange,
36
  setPendingPR,
37
  pendingPRRef
 
513
  if (onStart) {
514
  // Pass duplicated space ID so auto-deploy updates it
515
  console.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);
516
+ console.log('[Redesign] Using GLM-4.7 for redesign');
517
+ onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.7', undefined, duplicatedRepoId);
518
  }
519
  }, 100);
520
 
 
558
 
559
  if (onStart) {
560
  console.log('[Redesign] Will create PR - not passing repo ID');
561
+ console.log('[Redesign] Using GLM-4.7 for redesign');
562
+ onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.7', undefined, repoId, true); // Pass true for shouldCreatePR
563
  }
564
 
565
  console.log('[Redesign] Will create PR after code generation completes');
 
833
  >
834
  <div className="flex items-center justify-between gap-2">
835
  <span className="text-xs font-medium text-[#f5f5f7]">{model.name}</span>
836
+ {model.id === 'zai-org/GLM-4.7' && (
837
  <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">
838
  NEW
839
  </span>