Alae65/anycoder
0
1---2title: Anycoder3emoji: ๐ข4colorFrom: indigo5colorTo: indigo6sdk: gradio7sdk_version: 5.47.28app_file: app.py9pinned: false10disable_embedding: true11hf_oauth: true12hf_oauth_scopes:13- manage-repos14---15 16# AnyCoder - AI Code Generator17 18AnyCoder is an AI-powered code generator that helps you create applications by describing them in plain English. It supports multiple AI models, multimodal input, website redesign, and one-click deployment to Hugging Face Spaces. The UI is built with Gradio theming for a minimal, modern experience.19 20## Features21 22- **Multi-Model Support**: Choose from Moonshot Kimi-K2, Kimi K2 Turbo (Preview), 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, GLM-4.1V-9B-Thinking, Gemini 2.5 Flash and Gemini 2.5 Pro (OpenAI-compatible)23 - Claude-Opus-4.1 (via Poe)24- **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 redesign25- **Web Search Integration**: Enable real-time web search (Tavily, with advanced search depth) to enhance code generation with up-to-date information and best practices26- **Code Generation**: Generate code in HTML, Python, JS, and more. Special support for transformers.js apps (outputs index.html, index.js, style.css)27- **Live Preview**: Instantly preview generated HTML in a sandboxed iframe28- **Modify Existing Code**: Use search/replace block format to update generated HTML29- **One-Click Deployment**: Deploy your app to Hugging Face Spaces (Gradio, Streamlit, Static HTML, or Transformers.js) with OAuth login30- **History & Examples**: Chat-like history of all interactions and quick example prompts for fast prototyping31- **Minimal, Modern UI**: Built with Gradio 5.x, using only built-in theming and styling (no custom CSS)32 33## Installation34 351. Clone the repository:36```bash37git clone <repository-url>38cd anycoder39```402. Install dependencies:41```bash42pip install -r requirements.txt43```443. Set up environment variables:45```bash46export HF_TOKEN="your_huggingface_token"47export DASHSCOPE_API_KEY="your_dashscope_api_key" # Required for Qwen3-30B models via DashScope48export POE_API_KEY="your_poe_api_key" # Required for GPT-5, Grok-4, and Grok-Code-Fast-1 via Poe49export GEMINI_API_KEY="your_gemini_api_key" # Required for Gemini models50export MOONSHOT_API_KEY="your_moonshot_api_key" # Required for Kimi models51```52 53## Usage54 551. Run the application:56```bash57python app.py58```592. Open your browser and navigate to the provided URL603. Describe your application in the text input field, or:61 - Upload a UI design image (for ERNIE-4.5-VL or GLM-4.1V-9B-Thinking)62 - Upload a reference file (PDF, TXT, MD, CSV, DOCX, or image)63 - Enter a website URL for redesign (the app will extract and analyze the HTML and content)64 - Enable web search for up-to-date information65 - Choose a different AI model or code language664. Click "Generate" to create your code675. View the generated code in the Code tab or see it in action in the Preview tab686. Use the History tab to review previous generations697. **Deploy to Space**: Enter a title and click "๐ Deploy App" to publish your application (OAuth login required) - the SDK is automatically matched to your selected code language70 71## Supported Models72 73- Moonshot Kimi-K274- Kimi K2 Turbo (Preview)75- DeepSeek V376- DeepSeek V3.177- DeepSeek V3.1 Terminus78- DeepSeek V3.2-Exp79- DeepSeek R180- ERNIE-4.5-VL (multimodal)81- MiniMax M182- Qwen3-235B-A22B83- Qwen3-4B-Instruct-250784- Qwen3-4B-Thinking-250785- Qwen3-30B-A3B-Instruct-2507 (via DashScope)86- Qwen3-30B-A3B-Thinking-2507 (via DashScope)87- SmolLM3-3B88- GLM-4.1V-9B-Thinking (multimodal)89- GPT-5 (via Poe)90- Grok-4 (via Poe)91 - Claude-Opus-4.1 (via Poe)92 - Gemini 2.5 Flash (OpenAI-compatible)93 - Gemini 2.5 Pro (OpenAI-compatible)94 95## Input Options96 97- **Text Prompt**: Describe your app or code requirements98- **Image Upload**: For multimodal models, upload a UI design image to generate code from visuals99- **File Upload**: Provide a reference file (PDF, TXT, MD, CSV, DOCX, or image) for code generation or text extraction (OCR for images)100- **Website URL**: Enter a URL to extract and redesign the website (HTML and content are analyzed and modernized)101 102## Code Generation & Modification103 104- Generates code in HTML, Python, JS, and more (selectable via dropdown)105- Special support for transformers.js apps (outputs index.html, index.js, style.css)106- Svelte apps107- For HTML, provides a live preview in a sandboxed iframe108- For modification requests, uses a search/replace block format to update existing HTML109 110## Deployment111 112- Deploy generated apps to Hugging Face Spaces directly from the UI113- Supported SDKs: Gradio (Python), Streamlit (Python), Static (HTML), Transformers.js114- OAuth login with Hugging Face is required for deployment to user-owned Spaces115 116## History & Examples117 118- Maintains a chat-like history of user/assistant interactions119- Quick example prompts are available in the sidebar for fast prototyping120 121## UI/UX122 123- Built with Gradio 5.x, using only Gradio's built-in theming and styling (no custom CSS)124- Minimal, uncluttered sidebar and interface125 126## Environment Variables127 128- `HF_TOKEN`: Your Hugging Face API token (required)129 - `GEMINI_API_KEY`: Your Google Gemini API key (required to use Gemini models)130- `MOONSHOT_API_KEY`: Your Moonshot AI API key (required to use Kimi models)131 132## Project Structure133 134```135anycoder/136โโโ app.py # Main application (all logic and UI)137โโโ requirements.txt138โโโ README.md # This file139```140 141## License142 143[Add your license information here]