add opus and remove some models and gradio 6 update
Browse filesFiles changed (5)
97 unmodified lines989910010110110210310410510610710810911010911011180 unmodified lines1921931941971951961971981084 unmodified lines1283128412851288128612871288128997 unmodified lines {"name": "MiniMax M2", "id": "MiniMaxAI/MiniMax-M2", "description": "MiniMax M2 model via HuggingFace InferenceClient with Novita provider"}, {"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-Opus-4.5", "id": "claude-opus-4.5", "description": "Anthropic Claude Opus 4.5 via Poe (OpenAI-compatible)"}, {"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"},]
# Cache model lookup for faster access (built after AVAILABLE_MODELS is defined)80 unmodified linesclass CodeGenerationRequest(BaseModel): query: str language: str = "html" model_id: str = "MiniMaxAI/MiniMax-M2" model_id: str = "claude-opus-4.5" provider: str = "auto" history: List[List[str]] = [] agent_mode: bool = False1084 unmodified lines query = data.get("query") language = data.get("language", "html") model_id = data.get("model_id", "MiniMaxAI/MiniMax-M2") model_id = data.get("model_id", "claude-opus-4.5") # Send acknowledgment await websocket.send_json({248 unmodified lines24925025125225225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329448 unmodified lines343344345307346347309310311312313348349350351352353354355356357358359360361362363248 unmodified lines docs_content = get_gradio_docs_content() # Base system prompt with anycoder-specific instructions base_prompt = """You are an expert Gradio developer. Create a complete, working Gradio application based on the user's request. Generate all necessary code to make the application functional and runnable. base_prompt = """🚨 CRITICAL: You are an expert Gradio 6 developer. You MUST use Gradio 6 syntax and API.
## Key Gradio 6 Changes (MUST FOLLOW):- Use `footer_links` parameter instead of removed `show_api` in gr.Blocks()- Use `api_visibility` instead of `api_name` in event listeners- Use modern Gradio 6 component syntax (check documentation below)- Gradio 6 has updated component APIs - always refer to the documentation below- DO NOT use deprecated Gradio 5 or older syntax
Create a complete, working Gradio 6 application based on the user's request. Generate all necessary code to make the application functional and runnable.
## Gradio 6 Example (Your Code Should Follow This Pattern):
```pythonimport gradio as gr
def process(text): return f"Processed: {text}"
# Gradio 6 Blocks with footer_links (NOT show_api)with gr.Blocks( title="My App", footer_links=[{"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"}]) as demo: with gr.Row(): input_text = gr.Textbox(label="Input") output_text = gr.Textbox(label="Output") btn = gr.Button("Process") # Gradio 6 events use api_visibility (NOT just api_name) btn.click( fn=process, inputs=[input_text], outputs=[output_text], api_visibility="public" # Gradio 6 syntax )
demo.launch()```
## Multi-File Application Structure
48 unmodified lines
---
## Final Instructions## 🚨 CRITICAL FINAL INSTRUCTIONS - GRADIO 6 ONLY
- Always use the exact function signatures and patterns from the Gradio 6 documentation above- Follow Gradio 6 migration guidelines if you're familiar with older versions- Use modern Gradio 6 API patterns (e.g., footer_links instead of show_api, api_visibility instead of show_api in events)- Generate production-ready code that follows all best practices- Always include the "Built with anycoder" attribution in the headerYOU MUST USE GRADIO 6 SYNTAX. This is MANDATORY:
1. **ONLY use Gradio 6 API** - Do NOT use Gradio 5 or older syntax2. **Reference the documentation above** - All function signatures and patterns are from Gradio 63. **Use modern Gradio 6 patterns:** - Use `footer_links` parameter in gr.Blocks() (NOT show_api) - Use `api_visibility` in event listeners (NOT api_name alone) - Use updated component syntax from Gradio 6 documentation4. **Follow Gradio 6 migration guide** if you see any deprecated patterns5. **Generate production-ready Gradio 6 code** that follows all best practices6. **Always include "Built with anycoder"** as clickable text in the header linking to https://huggingface.co/spaces/akhaliq/anycoder
REMINDER: You are writing Gradio 6 code. Double-check all syntax against the Gradio 6 documentation provided above.
""" 49 unmodified lines5051525354555657585953545543 unmodified lines991001011021031041051061071081091101118 unmodified lines12012112212312412512612712812912312412541 unmodified lines16716816917717817918018118218317017117249 unmodified lines base_url="https://dashscope.aliyuncs.com/compatible-mode/v1", ) elif model_id == "gpt-5": # Use Poe (OpenAI-compatible) client for GPT-5 model return OpenAI( api_key=os.getenv("POE_API_KEY"), base_url="https://api.poe.com/v1" ) elif model_id == "gpt-5.1": # Use Poe (OpenAI-compatible) client for GPT-5.1 model return OpenAI(43 unmodified lines base_url="https://api.poe.com/v1" ) elif model_id == "claude-opus-4.5": # Use Poe (OpenAI-compatible) client for Claude-Opus-4.5 return OpenAI( api_key=os.getenv("POE_API_KEY"), base_url="https://api.poe.com/v1" ) elif model_id == "claude-sonnet-4.5": # Use Poe (OpenAI-compatible) client for Claude-Sonnet-4.5 return OpenAI(8 unmodified lines base_url="https://api.poe.com/v1" ) elif model_id == "qwen3-max-preview": # Use DashScope International OpenAI client for Qwen3 Max Preview return OpenAI( api_key=os.getenv("DASHSCOPE_API_KEY"), base_url="https://dashscope.aliyuncs.com/compatible-mode/v1", ) elif model_id == "x-ai/grok-4.1-fast": # Use OpenRouter client for Grok 4.1 Fast model return OpenAI(41 unmodified lines base_url="https://generativelanguage.googleapis.com/v1beta/openai/", ) elif model_id == "gemini-flash-latest": # Use Google Gemini Flash Latest (OpenAI-compatible) client return OpenAI( api_key=os.getenv("GEMINI_API_KEY"), base_url="https://generativelanguage.googleapis.com/v1beta/openai/", ) elif model_id == "gemini-flash-lite-latest": # Use Google Gemini Flash Lite Latest (OpenAI-compatible) client return OpenAI(16 unmodified lines171819202021222316 unmodified lines const [generatedCode, setGeneratedCode] = useState(''); const [selectedLanguage, setSelectedLanguage] = useState<Language>('html'); const [selectedModel, setSelectedModel] = useState('zai-org/GLM-4.6'); const [selectedModel, setSelectedModel] = useState('claude-opus-4.5'); const [isGenerating, setIsGenerating] = useState(false); const [isAuthenticated, setIsAuthenticated] = useState(false); const [currentRepoId, setCurrentRepoId] = useState<string | null>(null); // Track imported/deployed space27 unmodified lines282930313132333427 unmodified lines onImport, isAuthenticated, initialLanguage = 'html', initialModel = 'zai-org/GLM-4.6', initialModel = 'claude-opus-4.5', onAuthChange}: LandingPageProps) { const [prompt, setPrompt] = useState('');backend_api.py+3-5
backend_docs_manager.py+54-7
backend_models.py+7-21
frontend/src/app/page.tsx+1-1
frontend/src/components/LandingPage.tsx+1-1