update models
Browse filesFiles changed (6)
156 unmodified lines157158159160160161162163156 unmodified linesk2_model_name_tag = "moonshotai/Kimi-K2-Thinking"
# Default model selectionDEFAULT_MODEL_NAME = "MiniMax M2"DEFAULT_MODEL_NAME = "GLM-4.6"DEFAULT_MODEL = Nonefor _m in AVAILABLE_MODELS: if _m.get("name") == DEFAULT_MODEL_NAME:178 unmodified lines17918018118218318218318418518619 unmodified lines20620720820921020921021121221311 unmodified lines225226227228229228229230231232233234235178 unmodified lines base_url="https://api.moonshot.ai/v1", ) elif model_id == "moonshotai/Kimi-K2-Thinking": # Use HuggingFace InferenceClient with Novita provider for Kimi K2 Thinking provider = "novita" # Use HuggingFace InferenceClient with Together AI provider for Kimi K2 Thinking provider = "together" elif model_id == "stealth-model-1": # Use stealth model with generic configuration api_key = os.getenv("STEALTH_MODEL_1_API_KEY")19 unmodified lines elif model_id == "zai-org/GLM-4.5": provider = "fireworks-ai" elif model_id == "zai-org/GLM-4.6": # Use auto provider for GLM-4.6, HuggingFace will select best available provider = "auto" # Use Cerebras provider for GLM-4.6 via HuggingFace provider = "cerebras" return InferenceClient( provider=provider, api_key=HF_TOKEN,11 unmodified lines return real_model_id elif model_id == "zai-org/GLM-4.6": # GLM-4.6 requires provider suffix in model string for API calls return "zai-org/GLM-4.6:zai-org" # GLM-4.6 requires Cerebras provider suffix in model string for API calls return "zai-org/GLM-4.6:cerebras" elif model_id == "moonshotai/Kimi-K2-Thinking": # Kimi K2 Thinking needs Together AI provider return "moonshotai/Kimi-K2-Thinking:together" return model_id
# Type definitions98 unmodified lines9910010110210310410510610710810911011198 unmodified lines {"name": "DeepSeek V3.2-Exp", "id": "deepseek-ai/DeepSeek-V3.2-Exp", "description": "DeepSeek V3.2 Experimental via HuggingFace"}, {"name": "DeepSeek R1", "id": "deepseek-ai/DeepSeek-R1-0528", "description": "DeepSeek R1 model for code generation"}, {"name": "GPT-5", "id": "gpt-5", "description": "OpenAI GPT-5 via OpenRouter"}, {"name": "GPT-5.1", "id": "gpt-5.1", "description": "OpenAI GPT-5.1 model via Poe for advanced code generation and general tasks"}, {"name": "GPT-5.1 Instant", "id": "gpt-5.1-instant", "description": "OpenAI GPT-5.1 Instant model via Poe for fast responses"}, {"name": "GPT-5.1 Codex", "id": "gpt-5.1-codex", "description": "OpenAI GPT-5.1 Codex model via Poe optimized for code generation"}, {"name": "Claude-Sonnet-4.5", "id": "claude-sonnet-4.5", "description": "Anthropic Claude Sonnet 4.5 via Poe (OpenAI-compatible)"}, {"name": "Claude-Haiku-4.5", "id": "claude-haiku-4.5", "description": "Anthropic Claude Haiku 4.5 via Poe (OpenAI-compatible)"}, {"name": "Kimi K2 Thinking", "id": "moonshotai/Kimi-K2-Thinking", "description": "Moonshot Kimi K2 Thinking model via HuggingFace with Together AI provider"}, {"name": "GLM-4.6", "id": "zai-org/GLM-4.6", "description": "GLM-4.6 model via HuggingFace with Cerebras provider"}, {"name": "Gemini Flash Latest", "id": "gemini-flash-latest", "description": "Google Gemini Flash via OpenRouter"}, {"name": "Qwen3 Max Preview", "id": "qwen3-max-preview", "description": "Qwen3 Max Preview via DashScope API"},]226 unmodified lines22722822923023123223323423523623723823924027 unmodified lines268269270263264271272273274275276277278271272279280281282283226 unmodified lines default_headers={"X-HF-Bill-To": "huggingface"} ) elif model_id.startswith("moonshotai/Kimi-K2"): # Kimi K2 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 == "stealth-model-1": # Use stealth model with generic configuration api_key = os.getenv("STEALTH_MODEL_1_API_KEY")27 unmodified lines return real_model_id elif model_id == "zai-org/GLM-4.6": # GLM-4.6 requires provider suffix in model string for API calls return "zai-org/GLM-4.6:zai-org" # GLM-4.6 requires Cerebras provider suffix in model string for API calls return "zai-org/GLM-4.6:cerebras" elif model_id == "MiniMaxAI/MiniMax-M2": # MiniMax M2 needs Novita provider suffix return "MiniMaxAI/MiniMax-M2:novita" elif model_id == "moonshotai/Kimi-K2-Thinking": # Kimi K2 Thinking needs Novita provider return "moonshotai/Kimi-K2-Thinking:novita" # Kimi K2 Thinking needs Together AI provider return "moonshotai/Kimi-K2-Thinking:together" elif model_id == "moonshotai/Kimi-K2-Instruct": # Kimi K2 Instruct needs Groq provider16 unmodified lines171819202021222316 unmodified lines const [generatedCode, setGeneratedCode] = useState(''); const [selectedLanguage, setSelectedLanguage] = useState<Language>('html'); const [selectedModel, setSelectedModel] = useState('MiniMaxAI/MiniMax-M2'); const [selectedModel, setSelectedModel] = useState('zai-org/GLM-4.6'); const [isGenerating, setIsGenerating] = useState(false); const [isAuthenticated, setIsAuthenticated] = useState(false); const [currentRepoId, setCurrentRepoId] = useState<string | null>(null); // Track imported/deployed space25 unmodified lines262728292930313219 unmodified lines52535455565758596061626364656667686983 unmodified lines153154155156157158159160161162163164165166167168169170171172173174175176163 unmodified lines34034134232534334434534634734814 unmodified lines36336436534636636736836937037137219 unmodified lines39239339437239539639739839940040140240340440516 unmodified lines4224234244254264274284293974304314324334344354363 unmodified lines44044144240744344444544644744844941441541641741845045145225 unmodified lines onStart, isAuthenticated, initialLanguage = 'html', initialModel = 'MiniMaxAI/MiniMax-M2', initialModel = 'zai-org/GLM-4.6', onAuthChange}: LandingPageProps) { const [prompt, setPrompt] = useState('');19 unmodified lines // Trending apps state const [trendingApps, setTrendingApps] = useState<any[]>([]);
// Debug effect for dropdown state useEffect(() => { console.log('showModelDropdown state changed to:', showModelDropdown); }, [showModelDropdown]);
// Debug effect for models state useEffect(() => { console.log('models state changed, length:', models.length, 'models:', models); }, [models]);
useEffect(() => { console.log('Component mounted, initial load starting...'); loadData(); handleOAuthInit(); loadTrendingApps();83 unmodified lines }, []);
const loadData = async () => { console.log('loadData called'); setIsLoading(true); await Promise.all([loadModels(), loadLanguages()]); setIsLoading(false); console.log('loadData completed'); };
const loadModels = async () => { try { console.log('Loading models...'); const modelsList = await apiClient.getModels(); console.log('Models loaded successfully:', modelsList); console.log('Number of models:', modelsList.length); setModels(modelsList); console.log('Models state updated'); } catch (error) { console.error('Failed to load models:', error); setModels([]); // Set empty array on error } };
163 unmodified lines <div className="relative" ref={languageDropdownRef}> <button type="button" onClick={() => { onClick={(e) => { e.preventDefault(); e.stopPropagation(); setShowLanguageDropdown(!showLanguageDropdown); setShowModelDropdown(false); }}14 unmodified lines {/* Language Dropdown Menu */} {showLanguageDropdown && !isLoading && languages.length > 0 && ( <div className="absolute bottom-full left-0 mb-2 w-48 bg-[#1d1d1f] border border-[#424245] rounded-xl shadow-2xl overflow-hidden backdrop-blur-xl"> <div className="absolute bottom-full left-0 mb-2 w-48 bg-[#1d1d1f] border border-[#424245] rounded-xl shadow-2xl overflow-hidden backdrop-blur-xl" onClick={(e) => e.stopPropagation()} > <div className="max-h-64 overflow-y-auto py-1"> {languages.map((lang) => ( <button19 unmodified lines <div className="relative" ref={modelDropdownRef}> <button type="button" onClick={() => { onClick={(e) => { e.preventDefault(); e.stopPropagation(); console.log('Model button clicked!'); console.log('Current showModelDropdown:', showModelDropdown); console.log('Models array:', models); console.log('Models length:', models.length); console.log('Selected model:', selectedModel); setShowModelDropdown(!showModelDropdown); setShowLanguageDropdown(false); }}16 unmodified lines </svg> </button> {/* Debug info */} {console.log('Dropdown render check - showModelDropdown:', showModelDropdown, 'models.length:', models.length)} {/* Model Dropdown Menu */} {showModelDropdown && models.length > 0 && ( <div className="absolute bottom-full left-0 mb-2 w-80 bg-[#1d1d1f] border border-[#424245] rounded-xl shadow-2xl overflow-hidden backdrop-blur-xl"> <div className="absolute top-full left-0 mt-2 w-56 bg-[#1d1d1f] border border-[#424245] rounded-xl shadow-2xl overflow-hidden backdrop-blur-xl z-50" onClick={(e) => e.stopPropagation()} > <div className="max-h-96 overflow-y-auto py-1"> {models.map((model) => ( <button3 unmodified lines setSelectedModel(model.id); setShowModelDropdown(false); }} className={`w-full px-4 py-2.5 text-left transition-colors ${ className={`w-full px-4 py-2 text-left transition-colors ${ selectedModel === model.id ? 'bg-[#2d2d2f]' : 'hover:bg-[#2d2d2f]' }`} > <div className="text-xs font-medium text-[#f5f5f7]">{model.name}</div> {model.description && ( <div className="text-[10px] text-[#86868b] mt-1 leading-relaxed"> {model.description} </div> )} </button> ))} </div>anycoder_app/config.py+1-1
anycoder_app/models.py+9-6
backend_api.py+7
backend_models.py+12-4
frontend/src/app/page.tsx+1-1
frontend/src/components/LandingPage.tsx+42-11