update models
Browse filesFiles changed (6)
156 unmodified lines157158159160161162163156 unmodified linesk2_model_name_tag = "moonshotai/Kimi-K2-Thinking"# Default model selectionDEFAULT_MODEL_NAME = "MiniMax M2"DEFAULT_MODEL = Nonefor _m in AVAILABLE_MODELS:if _m.get("name") == DEFAULT_MODEL_NAME:156 unmodified lines157158159160161162163156 unmodified linesk2_model_name_tag = "moonshotai/Kimi-K2-Thinking"# Default model selectionDEFAULT_MODEL_NAME = "GLM-4.6"DEFAULT_MODEL = Nonefor _m in AVAILABLE_MODELS:if _m.get("name") == DEFAULT_MODEL_NAME:
178 unmodified lines17918018118218318418518619 unmodified lines20620720820921021121221311 unmodified lines225226227228229230231232178 unmodified linesbase_url="https://api.moonshot.ai/v1",)elif model_id == "moonshotai/Kimi-K2-Thinking":# Use HuggingFace InferenceClient with Novita provider for Kimi K2 Thinkingprovider = "novita"elif model_id == "stealth-model-1":# Use stealth model with generic configurationapi_key = os.getenv("STEALTH_MODEL_1_API_KEY")19 unmodified lineselif 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 availableprovider = "auto"return InferenceClient(provider=provider,api_key=HF_TOKEN,11 unmodified linesreturn real_model_idelif model_id == "zai-org/GLM-4.6":# GLM-4.6 requires provider suffix in model string for API callsreturn "zai-org/GLM-4.6:zai-org"return model_id# Type definitions178 unmodified lines17918018118218318418518619 unmodified lines20620720820921021121221311 unmodified lines225226227228229230231232233234235178 unmodified linesbase_url="https://api.moonshot.ai/v1",)elif model_id == "moonshotai/Kimi-K2-Thinking":# Use HuggingFace InferenceClient with Together AI provider for Kimi K2 Thinkingprovider = "together"elif model_id == "stealth-model-1":# Use stealth model with generic configurationapi_key = os.getenv("STEALTH_MODEL_1_API_KEY")19 unmodified lineselif model_id == "zai-org/GLM-4.5":provider = "fireworks-ai"elif model_id == "zai-org/GLM-4.6":# Use Cerebras provider for GLM-4.6 via HuggingFaceprovider = "cerebras"return InferenceClient(provider=provider,api_key=HF_TOKEN,11 unmodified linesreturn real_model_idelif model_id == "zai-org/GLM-4.6":# GLM-4.6 requires Cerebras provider suffix in model string for API callsreturn "zai-org/GLM-4.6:cerebras"elif model_id == "moonshotai/Kimi-K2-Thinking":# Kimi K2 Thinking needs Together AI providerreturn "moonshotai/Kimi-K2-Thinking:together"return model_id# Type definitions
98 unmodified lines9910010110210310498 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": "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"},]98 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 lines22722822923023123227 unmodified lines260261262263264265266267268269270271272273274275226 unmodified linesdefault_headers={"X-HF-Bill-To": "huggingface"})elif model_id == "stealth-model-1":# Use stealth model with generic configurationapi_key = os.getenv("STEALTH_MODEL_1_API_KEY")27 unmodified linesreturn real_model_idelif model_id == "zai-org/GLM-4.6":# GLM-4.6 requires provider suffix in model string for API callsreturn "zai-org/GLM-4.6:zai-org"elif model_id == "MiniMaxAI/MiniMax-M2":# MiniMax M2 needs Novita provider suffixreturn "MiniMaxAI/MiniMax-M2:novita"elif model_id == "moonshotai/Kimi-K2-Thinking":# Kimi K2 Thinking needs Novita providerreturn "moonshotai/Kimi-K2-Thinking:novita"elif model_id == "moonshotai/Kimi-K2-Instruct":# Kimi K2 Instruct needs Groq provider226 unmodified lines22722822923023123223323423523623723823924027 unmodified lines268269270271272273274275276277278279280281282283226 unmodified linesdefault_headers={"X-HF-Bill-To": "huggingface"})elif model_id.startswith("moonshotai/Kimi-K2"):# Kimi K2 models via HuggingFace Routerreturn 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 configurationapi_key = os.getenv("STEALTH_MODEL_1_API_KEY")27 unmodified linesreturn real_model_idelif model_id == "zai-org/GLM-4.6":# GLM-4.6 requires Cerebras provider suffix in model string for API callsreturn "zai-org/GLM-4.6:cerebras"elif model_id == "MiniMaxAI/MiniMax-M2":# MiniMax M2 needs Novita provider suffixreturn "MiniMaxAI/MiniMax-M2:novita"elif model_id == "moonshotai/Kimi-K2-Thinking":# Kimi K2 Thinking needs Together AI providerreturn "moonshotai/Kimi-K2-Thinking:together"elif model_id == "moonshotai/Kimi-K2-Instruct":# Kimi K2 Instruct needs Groq provider
16 unmodified lines1718192021222316 unmodified linesconst [generatedCode, setGeneratedCode] = useState('');const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');const [selectedModel, setSelectedModel] = useState('MiniMaxAI/MiniMax-M2');const [isGenerating, setIsGenerating] = useState(false);const [isAuthenticated, setIsAuthenticated] = useState(false);const [currentRepoId, setCurrentRepoId] = useState<string | null>(null); // Track imported/deployed space16 unmodified lines1718192021222316 unmodified linesconst [generatedCode, setGeneratedCode] = useState('');const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');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 space
25 unmodified lines2627282930313219 unmodified lines5253545556575883 unmodified lines142143144145146147148149150151152153154155156157158163 unmodified lines32232332432532632732814 unmodified lines34334434534634734834919 unmodified lines36937037137237337437516 unmodified lines3923933943953963973983994003 unmodified lines40440540640740840941041141241341441541641741841942042125 unmodified linesonStart,isAuthenticated,initialLanguage = 'html',initialModel = 'MiniMaxAI/MiniMax-M2',onAuthChange}: LandingPageProps) {const [prompt, setPrompt] = useState('');19 unmodified lines// Trending apps stateconst [trendingApps, setTrendingApps] = useState<any[]>([]);useEffect(() => {loadData();handleOAuthInit();loadTrendingApps();83 unmodified lines}, []);const loadData = async () => {setIsLoading(true);await Promise.all([loadModels(), loadLanguages()]);setIsLoading(false);};const loadModels = async () => {try {const modelsList = await apiClient.getModels();setModels(modelsList);} catch (error) {console.error('Failed to load models:', error);}};163 unmodified lines<div className="relative" ref={languageDropdownRef}><buttontype="button"onClick={() => {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="max-h-64 overflow-y-auto py-1">{languages.map((lang) => (<button19 unmodified lines<div className="relative" ref={modelDropdownRef}><buttontype="button"onClick={() => {setShowModelDropdown(!showModelDropdown);setShowLanguageDropdown(false);}}16 unmodified lines</svg></button>{/* 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="max-h-96 overflow-y-auto py-1">{models.map((model) => (<button3 unmodified linessetSelectedModel(model.id);setShowModelDropdown(false);}}className={`w-full px-4 py-2.5 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>25 unmodified lines2627282930313219 unmodified lines52535455565758596061626364656667686983 unmodified lines153154155156157158159160161162163164165166167168169170171172173174175176163 unmodified lines34034134234334434534634734814 unmodified lines36336436536636736836937037137219 unmodified lines39239339439539639739839940040140240340440516 unmodified lines4224234244254264274284294304314324334344354363 unmodified lines44044144244344444544644744844945045145225 unmodified linesonStart,isAuthenticated,initialLanguage = 'html',initialModel = 'zai-org/GLM-4.6',onAuthChange}: LandingPageProps) {const [prompt, setPrompt] = useState('');19 unmodified lines// Trending apps stateconst [trendingApps, setTrendingApps] = useState<any[]>([]);// Debug effect for dropdown stateuseEffect(() => {console.log('showModelDropdown state changed to:', showModelDropdown);}, [showModelDropdown]);// Debug effect for models stateuseEffect(() => {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}><buttontype="button"onClick={(e) => {e.preventDefault();e.stopPropagation();setShowLanguageDropdown(!showLanguageDropdown);setShowModelDropdown(false);}}14 unmodified lines{/* Language Dropdown Menu */}{showLanguageDropdown && !isLoading && languages.length > 0 && (<divclassName="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}><buttontype="button"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 && (<divclassName="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 linessetSelectedModel(model.id);setShowModelDropdown(false);}}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></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