Spaces:
Running
Running
File size: 5,080 Bytes
c2b3623 4f0f41b c2b3623 3f78831 c2b3623 f69d4b0 579db2f f7c3e69 8e9e1ab a9b0137 c2b3623 78fc423 082d9d1 14fc3d6 082d9d1 14fc3d6 78fc423 14fc3d6 78fc423 14fc3d6 2872dcd 14fc3d6 2872dcd 14fc3d6 2872dcd 14fc3d6 2872dcd 78fc423 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 e2d3712 14fc3d6 78fc423 082d9d1 14fc3d6 082d9d1 14fc3d6 e287280 14fc3d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
---
title: Anycoder
emoji: π’
colorFrom: indigo
colorTo: indigo
sdk: gradio
sdk_version: 5.38.0
app_file: app.py
pinned: false
disable_embedding: true
hf_oauth: true
hf_oauth_scopes:
- manage-repos # Needed to create/upload/delete Spaces on behalf of the user
# Note: 'openid' and 'profile' are always included by default and should not be listed here.
---
# AnyCoder - AI Code Generator
AnyCoder 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 pure Gradio theming for a minimal, modern experience.
## Features
- **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
- **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
- **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
- **Code Generation**: Generate code in HTML, Python, JS, and more. Special support for transformers.js apps (outputs index.html, index.js, style.css)
- **Live Preview**: Instantly preview generated HTML in a sandboxed iframe
- **Modify Existing Code**: Use search/replace block format to update generated HTML
- **One-Click Deployment**: Deploy your app to Hugging Face Spaces (Gradio, Streamlit, Static HTML, or Transformers.js) with OAuth login
- **History & Examples**: Chat-like history of all interactions and quick example prompts for fast prototyping
- **Minimal, Modern UI**: Built with Gradio 5.x, using only built-in theming and styling (no custom CSS)
## Installation
1. Clone the repository:
```bash
git clone <repository-url>
cd anycoder
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Set up environment variables:
```bash
export HF_TOKEN="your_huggingface_token"
export TAVILY_API_KEY="your_tavily_api_key" # Optional, for web search feature
```
## Usage
1. Run the application:
```bash
python app.py
```
2. Open your browser and navigate to the provided URL
3. Describe your application in the text input field, or:
- Upload a UI design image (for ERNIE-4.5-VL or GLM-4.1V-9B-Thinking)
- Upload a reference file (PDF, TXT, MD, CSV, DOCX, or image)
- Enter a website URL for redesign (the app will extract and analyze the HTML and content)
- Enable web search for up-to-date information
- Choose a different AI model or code language
4. Click "Generate" to create your code
5. View the generated code in the Code tab or see it in action in the Preview tab
6. Use the History tab to review previous generations
7. **Deploy to Space**: Enter a title, select SDK, and click "π Deploy App" to publish your application (OAuth login required)
## Supported Models
- Moonshot Kimi-K2
- DeepSeek V3
- DeepSeek R1
- ERNIE-4.5-VL (multimodal)
- MiniMax M1
- Qwen3-235B-A22B
- SmolLM3-3B
- GLM-4.1V-9B-Thinking (multimodal)
## Input Options
- **Text Prompt**: Describe your app or code requirements
- **Image Upload**: For multimodal models, upload a UI design image to generate code from visuals
- **File Upload**: Provide a reference file (PDF, TXT, MD, CSV, DOCX, or image) for code generation or text extraction (OCR for images)
- **Website URL**: Enter a URL to extract and redesign the website (HTML and content are analyzed and modernized)
## Web Search Feature
- Enable the "Web search" toggle to use Tavily for real-time information (requires TAVILY_API_KEY)
- Uses advanced search depth for best results
## Code Generation & Modification
- Generates code in HTML, Python, JS, and more (selectable via dropdown)
- Special support for transformers.js apps (outputs index.html, index.js, style.css)
- For HTML, provides a live preview in a sandboxed iframe
- For modification requests, uses a search/replace block format to update existing HTML
## Deployment
- Deploy generated apps to Hugging Face Spaces directly from the UI
- Supported SDKs: Gradio (Python), Streamlit (Python), Static (HTML), Transformers.js
- OAuth login with Hugging Face is required for deployment to user-owned Spaces
## History & Examples
- Maintains a chat-like history of user/assistant interactions
- Quick example prompts are available in the sidebar for fast prototyping
## UI/UX
- Built with Gradio 5.x, using only Gradio's built-in theming and styling (no custom CSS)
- Minimal, uncluttered sidebar and interface
## Environment Variables
- `HF_TOKEN`: Your Hugging Face API token (required)
- `TAVILY_API_KEY`: Your Tavily API key (optional, for web search)
## Project Structure
```
anycoder/
βββ app.py # Main application (all logic and UI)
βββ requirements.txt
βββ README.md # This file
```
## License
[Add your license information here] |