Spaces:
Sleeping
Sleeping
feat: set google/gemma-4-31B-it as the default model and add support for it in the backend and frontend
Browse filesFiles changed (5)
99 unmodified lines10010110210310310410510610794 unmodified lines20220320420420520620720899 unmodified lines
# Define models and languages here to avoid importing Gradio UIAVAILABLE_MODELS = [ {"name": "Gemma-4-31B β¨", "id": "google/gemma-4-31B-it", "description": "Gemma-4-31B-it - Latest powerful model via HuggingFace Router with fastest provider (Default)", "supports_images": True}, {"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}, {"name": "GLM-5.1 π", "id": "zai-org/GLM-5.1", "description": "GLM-5.1 - Powerful model via HuggingFace Router with Novita provider", "supports_images": False}, {"name": "Qwen3.5-397B π€", "id": "Qwen/Qwen3.5-397B-A17B", "description": "Qwen3.5-397B-A17B - Latest powerful model via HuggingFace Router", "supports_images": True}, {"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}, {"name": "GLM-5 π§ ", "id": "zai-org/GLM-5", "description": "GLM-5 - New powerful reasoning model via HuggingFace Router", "supports_images": False},94 unmodified linesclass CodeGenerationRequest(BaseModel): query: str language: str = "html" model_id: str = "zai-org/GLM-5.1" model_id: str = "google/gemma-4-31B-it" provider: str = "auto" history: List[List[str]] = [] agent_mode: bool = False68 unmodified lines697071727374757677787980818264 unmodified lines14714814915015115215315415568 unmodified lines default_headers={"X-HF-Bill-To": "huggingface"} ) elif model_id.startswith("google/gemma"): # Gemma models via HuggingFace Router return OpenAI( base_url="https://router.huggingface.co/v1", api_key=os.getenv("HF_TOKEN"), default_headers={"X-HF-Bill-To": "huggingface"} ) elif model_id.startswith("Qwen/Qwen3.5"): # Qwen 3.5 models via HuggingFace Router return OpenAI(64 unmodified lines # Qwen3-Coder-Next needs Novita provider return "Qwen/Qwen3-Coder-Next:novita" elif model_id == "google/gemma-4-31B-it": return "google/gemma-4-31B-it:fastest" elif model_id == "Qwen/Qwen3.5-397B-A17B": # Qwen3.5-397B-A17B needs fastest provider return "Qwen/Qwen3.5-397B-A17B:fastest"16 unmodified lines171819202021222316 unmodified lines
const [generatedCode, setGeneratedCode] = useState(''); const [selectedLanguage, setSelectedLanguage] = useState<Language>('html'); const [selectedModel, setSelectedModel] = useState('zai-org/GLM-5.1'); const [selectedModel, setSelectedModel] = useState('google/gemma-4-31B-it'); const [models, setModels] = useState<Model[]>([]); const [isGenerating, setIsGenerating] = useState(false); const [isAuthenticated, setIsAuthenticated] = useState(false);88 unmodified lines89909192939495106 unmodified lines20220320420420520620720888 unmodified lines };
const formatModelName = (name: string, id: string) => { if (id === 'google/gemma-4-31B-it') return 'Gemma-4-31B β¨'; if (id === 'zai-org/GLM-5.1') return 'GLM-5.1 π'; if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B π€'; return name;106 unmodified lines > <div className="flex items-center justify-between gap-2"> <span className="text-sm text-[#f5f5f7]">{formatModelName(model.name, model.id)}</span> {['zai-org/GLM-5.1', 'Qwen/Qwen3.5-397B-A17B', 'MiniMaxAI/MiniMax-M2.5'].includes(model.id) && ( {['google/gemma-4-31B-it', 'zai-org/GLM-5.1', 'Qwen/Qwen3.5-397B-A17B', 'MiniMaxAI/MiniMax-M2.5'].includes(model.id) && ( <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"> NEW </span>30 unmodified lines3132333434353637244 unmodified lines282283284285286287288232 unmodified lines52152252352352452452552652752837 unmodified lines56656756856856956957057157257330 unmodified lines onImport, isAuthenticated, initialLanguage = 'html', initialModel = 'zai-org/GLM-5.1', initialModel = 'google/gemma-4-31B-it', onAuthChange, setPendingPR, pendingPRRef244 unmodified lines };
const formatModelName = (name: string, id: string) => { if (id === 'google/gemma-4-31B-it') return 'Gemma-4-31B β¨'; if (id === 'zai-org/GLM-5.1') return 'GLM-5.1 π'; if (id === 'Qwen/Qwen3.5-397B-A17B') return 'Qwen3.5-397B-A17B π€'; return name;232 unmodified lines if (onStart) { // Pass duplicated space ID so auto-deploy updates it console.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId); console.log('[Redesign] Using zai-org/GLM-5.1 for redesign'); onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-5.1', undefined, duplicatedRepoId); console.log('[Redesign] Using google/gemma-4-31B-it for redesign'); onStart(redesignPrompt, result.language || 'html', 'google/gemma-4-31B-it', undefined, duplicatedRepoId); } }, 100);
37 unmodified lines
if (onStart) { console.log('[Redesign] Will create PR - not passing repo ID'); console.log('[Redesign] Using zai-org/GLM-5.1 for redesign'); onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-5.1', undefined, repoId, true); // Pass true for shouldCreatePR console.log('[Redesign] Using google/gemma-4-31B-it for redesign'); onStart(redesignPrompt, result.language || 'html', 'google/gemma-4-31B-it', undefined, repoId, true); // Pass true for shouldCreatePR }
console.log('[Redesign] Will create PR after code generation completes');backend_api.py+3-2
backend_models.py+11
frontend/src/app/page.tsx+1-1
frontend/src/components/ControlPanel.tsx+2-1
frontend/src/components/LandingPage.tsx+6-5