Shanthemach commited on
Commit
eb1a712
·
verified ·
1 Parent(s): acdc53f
Files changed (6) hide show
  1. README.md +130 -3
  2. app.py +0 -0
  3. gitattributes +1 -0
  4. gitignore +81 -0
  5. packages.txt +1 -0
  6. requirements.txt +12 -0
README.md CHANGED
@@ -1,3 +1,130 @@
1
- ---
2
- license: lgpl-2.1
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Anycoder
3
+ emoji: 🏢
4
+ colorFrom: indigo
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: 5.38.2
8
+ app_file: app.py
9
+ pinned: false
10
+ disable_embedding: true
11
+ hf_oauth: true
12
+ hf_oauth_scopes:
13
+ - manage-repos
14
+ ---
15
+
16
+ # AnyCoder - AI Code Generator
17
+
18
+ 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 Gradio theming for a minimal, modern experience.
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)
26
+ - **Live Preview**: Instantly preview generated HTML in a sandboxed iframe
27
+ - **Modify Existing Code**: Use search/replace block format to update generated HTML
28
+ - **One-Click Deployment**: Deploy your app to Hugging Face Spaces (Gradio, Streamlit, Static HTML, or Transformers.js) with OAuth login
29
+ - **History & Examples**: Chat-like history of all interactions and quick example prompts for fast prototyping
30
+ - **Minimal, Modern UI**: Built with Gradio 5.x, using only built-in theming and styling (no custom CSS)
31
+
32
+ ## Installation
33
+
34
+ 1. Clone the repository:
35
+ ```bash
36
+ git clone <repository-url>
37
+ cd anycoder
38
+ ```
39
+ 2. Install dependencies:
40
+ ```bash
41
+ pip install -r requirements.txt
42
+ ```
43
+ 3. Set up environment variables:
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
50
+
51
+ 1. Run the application:
52
+ ```bash
53
+ python app.py
54
+ ```
55
+ 2. Open your browser and navigate to the provided URL
56
+ 3. Describe your application in the text input field, or:
57
+ - Upload a UI design image (for ERNIE-4.5-VL or GLM-4.1V-9B-Thinking)
58
+ - Upload a reference file (PDF, TXT, MD, CSV, DOCX, or image)
59
+ - Enter a website URL for redesign (the app will extract and analyze the HTML and content)
60
+ - Enable web search for up-to-date information
61
+ - Choose a different AI model or code language
62
+ 4. Click "Generate" to create your code
63
+ 5. View the generated code in the Code tab or see it in action in the Preview tab
64
+ 6. Use the History tab to review previous generations
65
+ 7. **Deploy to Space**: Enter a title, select SDK, and click "🚀 Deploy App" to publish your application (OAuth login required)
66
+
67
+ ## Supported Models
68
+
69
+ - Moonshot Kimi-K2
70
+ - DeepSeek V3
71
+ - DeepSeek R1
72
+ - ERNIE-4.5-VL (multimodal)
73
+ - MiniMax M1
74
+ - Qwen3-235B-A22B
75
+ - SmolLM3-3B
76
+ - GLM-4.1V-9B-Thinking (multimodal)
77
+
78
+ ## Input Options
79
+
80
+ - **Text Prompt**: Describe your app or code requirements
81
+ - **Image Upload**: For multimodal models, upload a UI design image to generate code from visuals
82
+ - **File Upload**: Provide a reference file (PDF, TXT, MD, CSV, DOCX, or image) for code generation or text extraction (OCR for images)
83
+ - **Website URL**: Enter a URL to extract and redesign the website (HTML and content are analyzed and modernized)
84
+
85
+ ## Web Search Feature
86
+
87
+ - Enable the "Web search" toggle to use Tavily for real-time information (requires TAVILY_API_KEY)
88
+ - Uses advanced search depth for best results
89
+
90
+ ## Code Generation & Modification
91
+
92
+ - Generates code in HTML, Python, JS, and more (selectable via dropdown)
93
+ - Special support for transformers.js apps (outputs index.html, index.js, style.css)
94
+ - Svelte apps
95
+ - For HTML, provides a live preview in a sandboxed iframe
96
+ - For modification requests, uses a search/replace block format to update existing HTML
97
+
98
+ ## Deployment
99
+
100
+ - Deploy generated apps to Hugging Face Spaces directly from the UI
101
+ - Supported SDKs: Gradio (Python), Streamlit (Python), Static (HTML), Transformers.js
102
+ - OAuth login with Hugging Face is required for deployment to user-owned Spaces
103
+
104
+ ## History & Examples
105
+
106
+ - Maintains a chat-like history of user/assistant interactions
107
+ - Quick example prompts are available in the sidebar for fast prototyping
108
+
109
+ ## UI/UX
110
+
111
+ - Built with Gradio 5.x, using only Gradio's built-in theming and styling (no custom CSS)
112
+ - Minimal, uncluttered sidebar and interface
113
+
114
+ ## Environment Variables
115
+
116
+ - `HF_TOKEN`: Your Hugging Face API token (required)
117
+ - `TAVILY_API_KEY`: Your Tavily API key (optional, for web search)
118
+
119
+ ## Project Structure
120
+
121
+ ```
122
+ anycoder/
123
+ ├── app.py # Main application (all logic and UI)
124
+ ├── requirements.txt
125
+ ├── README.md # This file
126
+ ```
127
+
128
+ ## License
129
+
130
+ [Add your license information here]
app.py ADDED
The diff for this file is too large to render. See raw diff
 
gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ Animated_Logo_Video_Ready.gif filter=lfs diff=lfs merge=lfs -text
gitignore ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # Virtual environments
28
+ venv/
29
+ env/
30
+ ENV/
31
+ .venv/
32
+
33
+ # PyInstaller
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Jupyter Notebook
55
+ .ipynb_checkpoints
56
+
57
+ # pyenv
58
+ .python-version
59
+
60
+ # mypy
61
+ .mypy_cache/
62
+ .dmypy.json
63
+
64
+ # Pyre type checker
65
+ .pyre/
66
+
67
+ # Gradio cache
68
+ log/
69
+ logs/
70
+
71
+ # System files
72
+ .DS_Store
73
+ Thumbs.db
74
+
75
+ # Lock files
76
+ uv.lock
77
+ poetry.lock
78
+ Pipfile.lock
79
+
80
+ # VSCode
81
+ .vscode/
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ tesseract-ocr
requirements.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ git+https://github.com/huggingface/huggingface_hub.git
2
+ gradio[oauth]
3
+ tavily-python
4
+ PyPDF2
5
+ python-docx
6
+ pytesseract
7
+ Pillow
8
+ opencv-python
9
+ requests
10
+ beautifulsoup4
11
+ html2text
12
+ openai