Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	add new qwen model thinking
Browse files
    	
        README.md
    CHANGED
    
    | @@ -19,7 +19,7 @@ AnyCoder is an AI-powered code generator that helps you create applications by d | |
| 19 |  | 
| 20 | 
             
            ## Features
         | 
| 21 |  | 
| 22 | 
            -
            - **Multi-Model Support**: Choose from Moonshot Kimi-K2, DeepSeek V3, DeepSeek R1, ERNIE-4.5-VL, MiniMax M1, Qwen3-235B-A22B, SmolLM3-3B, and GLM-4.1V-9B-Thinking
         | 
| 23 | 
             
            - **Flexible Input**: Describe your app in text, upload a UI design image (for multimodal models), provide a reference file (PDF, TXT, MD, CSV, DOCX, or image), or enter a website URL for redesign
         | 
| 24 | 
             
            - **Web Search Integration**: Enable real-time web search (Tavily, with advanced search depth) to enhance code generation with up-to-date information and best practices
         | 
| 25 | 
             
            - **Code Generation**: Generate code in HTML, Python, JS, and more. Special support for transformers.js apps (outputs index.html, index.js, style.css)
         | 
| @@ -44,6 +44,7 @@ pip install -r requirements.txt | |
| 44 | 
             
            ```bash
         | 
| 45 | 
             
            export HF_TOKEN="your_huggingface_token"
         | 
| 46 | 
             
            export TAVILY_API_KEY="your_tavily_api_key"  # Optional, for web search feature
         | 
|  | |
| 47 | 
             
            ```
         | 
| 48 |  | 
| 49 | 
             
            ## Usage
         | 
| @@ -72,6 +73,8 @@ python app.py | |
| 72 | 
             
            - ERNIE-4.5-VL (multimodal)
         | 
| 73 | 
             
            - MiniMax M1
         | 
| 74 | 
             
            - Qwen3-235B-A22B
         | 
|  | |
|  | |
| 75 | 
             
            - SmolLM3-3B
         | 
| 76 | 
             
            - GLM-4.1V-9B-Thinking (multimodal)
         | 
| 77 |  | 
|  | |
| 19 |  | 
| 20 | 
             
            ## Features
         | 
| 21 |  | 
| 22 | 
            +
            - **Multi-Model Support**: Choose from Moonshot Kimi-K2, DeepSeek V3, DeepSeek R1, ERNIE-4.5-VL, MiniMax M1, Qwen3-235B-A22B, Qwen3-30B-A3B-Instruct-2507, Qwen3-30B-A3B-Thinking-2507, SmolLM3-3B, and GLM-4.1V-9B-Thinking
         | 
| 23 | 
             
            - **Flexible Input**: Describe your app in text, upload a UI design image (for multimodal models), provide a reference file (PDF, TXT, MD, CSV, DOCX, or image), or enter a website URL for redesign
         | 
| 24 | 
             
            - **Web Search Integration**: Enable real-time web search (Tavily, with advanced search depth) to enhance code generation with up-to-date information and best practices
         | 
| 25 | 
             
            - **Code Generation**: Generate code in HTML, Python, JS, and more. Special support for transformers.js apps (outputs index.html, index.js, style.css)
         | 
|  | |
| 44 | 
             
            ```bash
         | 
| 45 | 
             
            export HF_TOKEN="your_huggingface_token"
         | 
| 46 | 
             
            export TAVILY_API_KEY="your_tavily_api_key"  # Optional, for web search feature
         | 
| 47 | 
            +
            export DASHSCOPE_API_KEY="your_dashscope_api_key"  # Required for Qwen3-30B models via DashScope
         | 
| 48 | 
             
            ```
         | 
| 49 |  | 
| 50 | 
             
            ## Usage
         | 
|  | |
| 73 | 
             
            - ERNIE-4.5-VL (multimodal)
         | 
| 74 | 
             
            - MiniMax M1
         | 
| 75 | 
             
            - Qwen3-235B-A22B
         | 
| 76 | 
            +
            - Qwen3-30B-A3B-Instruct-2507 (via DashScope)
         | 
| 77 | 
            +
            - Qwen3-30B-A3B-Thinking-2507 (via DashScope)
         | 
| 78 | 
             
            - SmolLM3-3B
         | 
| 79 | 
             
            - GLM-4.1V-9B-Thinking (multimodal)
         | 
| 80 |  | 
    	
        app.py
    CHANGED
    
    | @@ -395,6 +395,11 @@ AVAILABLE_MODELS = [ | |
| 395 | 
             
                    "name": "Qwen3-30B-A3B-Instruct-2507",
         | 
| 396 | 
             
                    "id": "qwen3-30b-a3b-instruct-2507",
         | 
| 397 | 
             
                    "description": "Qwen3-30B-A3B-Instruct model via Alibaba Cloud DashScope API"
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
| 398 | 
             
                }
         | 
| 399 | 
             
            ]
         | 
| 400 |  | 
| @@ -474,6 +479,12 @@ def get_inference_client(model_id, provider="auto"): | |
| 474 | 
             
                        api_key=os.getenv("DASHSCOPE_API_KEY"),
         | 
| 475 | 
             
                        base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
         | 
| 476 | 
             
                    )
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 477 | 
             
                elif model_id == "moonshotai/Kimi-K2-Instruct":
         | 
| 478 | 
             
                    provider = "groq"
         | 
| 479 | 
             
                elif model_id == "Qwen/Qwen3-235B-A22B":
         | 
|  | |
| 395 | 
             
                    "name": "Qwen3-30B-A3B-Instruct-2507",
         | 
| 396 | 
             
                    "id": "qwen3-30b-a3b-instruct-2507",
         | 
| 397 | 
             
                    "description": "Qwen3-30B-A3B-Instruct model via Alibaba Cloud DashScope API"
         | 
| 398 | 
            +
                },
         | 
| 399 | 
            +
                {
         | 
| 400 | 
            +
                    "name": "Qwen3-30B-A3B-Thinking-2507",
         | 
| 401 | 
            +
                    "id": "qwen3-30b-a3b-thinking-2507",
         | 
| 402 | 
            +
                    "description": "Qwen3-30B-A3B-Thinking model with advanced reasoning via Alibaba Cloud DashScope API"
         | 
| 403 | 
             
                }
         | 
| 404 | 
             
            ]
         | 
| 405 |  | 
|  | |
| 479 | 
             
                        api_key=os.getenv("DASHSCOPE_API_KEY"),
         | 
| 480 | 
             
                        base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
         | 
| 481 | 
             
                    )
         | 
| 482 | 
            +
                elif model_id == "qwen3-30b-a3b-thinking-2507":
         | 
| 483 | 
            +
                    # Use DashScope OpenAI client for Thinking model
         | 
| 484 | 
            +
                    return OpenAI(
         | 
| 485 | 
            +
                        api_key=os.getenv("DASHSCOPE_API_KEY"),
         | 
| 486 | 
            +
                        base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
         | 
| 487 | 
            +
                    )
         | 
| 488 | 
             
                elif model_id == "moonshotai/Kimi-K2-Instruct":
         | 
| 489 | 
             
                    provider = "groq"
         | 
| 490 | 
             
                elif model_id == "Qwen/Qwen3-235B-A22B":
         | 
