Kappa-shan 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.
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
Clone the repository:
bash
1git clone <repository-url>2cd kappa-shan
Install dependencies:
pip install -r requirements.txt
Set up environment variables:
bash
1exportHF_TOKEN="your_huggingface_token"2exportTAVILY_API_KEY="your_tavily_api_key"# Optional, for web search feature
Usage
Run the application:
python app.py
Open your browser and navigate to the provided URL
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
Click "Generate" to create your code
View the generated code in the Code tab or see it in action in the Preview tab
Use the History tab to review previous generations
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)
Svelte apps
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