Spaces:
Running
Running
milwright
commited on
Commit
Β·
a51de86
1
Parent(s):
72c7aa2
update README.md with current project details
Browse files
README.md
CHANGED
|
@@ -1,61 +1,150 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
|
|
|
| 7 |
app_file: app.py
|
| 8 |
pinned: true
|
| 9 |
-
thumbnail: >-
|
| 10 |
-
https://cdn-uploads.huggingface.co/production/uploads/65a0caa15dfd8b9b1f3aa3d3/8cruZmIioPrYoTN8o-wcE.png
|
| 11 |
-
short_description: Configure, download, and deploy a simple chat interface
|
| 12 |
license: gpl-3.0
|
| 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 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
pip install -r requirements.txt
|
|
|
|
|
|
|
| 39 |
python app.py
|
| 40 |
```
|
| 41 |
|
| 42 |
-
###
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
##
|
| 48 |
|
| 49 |
-
|
| 50 |
-
- **
|
| 51 |
-
-
|
| 52 |
-
-
|
| 53 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
## Architecture
|
| 56 |
|
| 57 |
-
|
| 58 |
-
- **
|
| 59 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
title: ChatUI Helper
|
| 3 |
+
emoji: π¬
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.37.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
|
|
|
|
|
|
|
|
|
| 10 |
license: gpl-3.0
|
| 11 |
+
short_description: Create AI chat interfaces for HuggingFace Spaces
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# ChatUI Helper
|
| 15 |
+
|
| 16 |
+
A comprehensive tool for creating, configuring, and deploying customizable AI chat interfaces on HuggingFace Spaces. Designed for educators and developers to quickly generate pedagogically-focused AI assistants.
|
| 17 |
|
| 18 |
+
## π― Key Features
|
| 19 |
|
| 20 |
+
### Configuration & Templates
|
| 21 |
+
- **Academic Templates**: Pre-configured templates for educational use cases
|
| 22 |
+
- Socratic Research Chat
|
| 23 |
+
- STEM Adventure Games
|
| 24 |
+
- Course Assistant Example
|
| 25 |
+
- Language Learning Partner
|
| 26 |
+
- **Custom Configuration**: Build from scratch with full control
|
| 27 |
+
- **Multi-Language Support**: Configure assistants to respond in any language
|
| 28 |
+
- **Theme Selection**: Choose from Gradio themes (Default, Soft, Glass, Monochrome, Base)
|
| 29 |
|
| 30 |
+
### URL Grounding & Context
|
| 31 |
+
- **Grounding URLs**: Add up to 10 reference URLs for contextual responses
|
| 32 |
+
- Primary sources (URLs 1-2): 8000 character limit
|
| 33 |
+
- Secondary sources (URLs 3+): 2500 character limit
|
| 34 |
+
- **Dynamic URL Extraction**: Automatically fetch content from URLs in user messages
|
| 35 |
+
- **Smart Content Processing**: HTML parsing with BeautifulSoup
|
| 36 |
|
| 37 |
+
### Security & Access Control
|
| 38 |
+
- **Access Codes**: Password-protect your Space for controlled access
|
| 39 |
+
- **API Key Management**: Secure handling of OpenRouter API keys
|
| 40 |
+
- **HuggingFace Token Integration**: Enable configuration updates without redeployment
|
| 41 |
|
| 42 |
+
### Preview & Testing
|
| 43 |
+
- **Live Preview**: Test your assistant before deployment
|
| 44 |
+
- **Real-time Configuration**: See changes instantly
|
| 45 |
+
- **File Upload Support**: Test document processing capabilities
|
| 46 |
+
- **Conversation Export**: Download chat history as markdown
|
| 47 |
|
| 48 |
+
## π Quick Start
|
| 49 |
+
|
| 50 |
+
### Local Development
|
| 51 |
```bash
|
| 52 |
+
# Clone the repository
|
| 53 |
+
git clone https://huggingface.co/spaces/milwright/chatui-helper
|
| 54 |
+
|
| 55 |
+
# Install dependencies
|
| 56 |
pip install -r requirements.txt
|
| 57 |
+
|
| 58 |
+
# Run the application
|
| 59 |
python app.py
|
| 60 |
```
|
| 61 |
|
| 62 |
+
### Environment Variables (Optional)
|
| 63 |
+
```bash
|
| 64 |
+
# For preview functionality
|
| 65 |
+
API_KEY=sk-or-your-openrouter-key
|
| 66 |
+
|
| 67 |
+
# For HuggingFace integration
|
| 68 |
+
HF_TOKEN=your-huggingface-token
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## π¦ Generated Space Contents
|
| 72 |
+
|
| 73 |
+
Each generated package includes:
|
| 74 |
+
- **app.py**: Complete Gradio 5.x application
|
| 75 |
+
- **requirements.txt**: All necessary dependencies
|
| 76 |
+
- **config.json**: Your configuration settings
|
| 77 |
+
- **README.md**: Deployment instructions
|
| 78 |
+
|
| 79 |
+
### Supported Models
|
| 80 |
+
Through OpenRouter integration:
|
| 81 |
+
- Google Gemini (Flash, Pro)
|
| 82 |
+
- OpenAI GPT-4, GPT-3.5
|
| 83 |
+
- Anthropic Claude 3 series
|
| 84 |
+
- Meta Llama 3 models
|
| 85 |
+
- Mistral/Mixtral models
|
| 86 |
+
- DeepSeek reasoning models
|
| 87 |
+
- Nvidia Llama optimizations
|
| 88 |
+
- Qwen multilingual models
|
| 89 |
|
| 90 |
+
## π Documentation
|
| 91 |
|
| 92 |
+
The application includes comprehensive built-in documentation:
|
| 93 |
+
- **Step 1**: Configure & Preview Your Space
|
| 94 |
+
- Templates & Identity
|
| 95 |
+
- System Configuration
|
| 96 |
+
- Example Prompts
|
| 97 |
+
- URL Grounding
|
| 98 |
+
- API Configuration
|
| 99 |
+
- Upload Configuration
|
| 100 |
+
- Preview Testing
|
| 101 |
+
- **Step 2**: Generate & Deploy
|
| 102 |
+
- Package Generation
|
| 103 |
+
- Space Creation
|
| 104 |
+
- File Upload
|
| 105 |
+
- Secret Configuration
|
| 106 |
+
- Verification & Iteration
|
| 107 |
+
- **Troubleshooting**: Common issues and solutions
|
| 108 |
+
- **Additional Resources**: Links to relevant documentation
|
| 109 |
|
| 110 |
+
## ποΈ Architecture
|
| 111 |
|
| 112 |
+
### Core Components
|
| 113 |
+
- **SpaceGenerator**: Handles configuration and package generation
|
| 114 |
+
- **ConfigurationManager**: Manages settings with automatic backups
|
| 115 |
+
- **Support Documentation**: Nested accordion interface for easy navigation
|
| 116 |
+
- **Template System**: String-based templating for code generation
|
| 117 |
+
|
| 118 |
+
### File Structure
|
| 119 |
+
```
|
| 120 |
+
chatui-helper/
|
| 121 |
+
βββ app.py # Main application
|
| 122 |
+
βββ space_template.py # Template for generated spaces
|
| 123 |
+
βββ utils.py # Shared utilities
|
| 124 |
+
βββ support_docs.py # Documentation interface
|
| 125 |
+
βββ academic_templates.json # Pre-configured templates
|
| 126 |
+
βββ requirements.txt # Dependencies
|
| 127 |
+
βββ CLAUDE.md # Development guidance
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
## π€ Contributing
|
| 131 |
+
|
| 132 |
+
This project is designed for educational use. Contributions that enhance pedagogical value are welcome:
|
| 133 |
+
- New academic templates
|
| 134 |
+
- Improved documentation
|
| 135 |
+
- Bug fixes and optimizations
|
| 136 |
+
- Accessibility improvements
|
| 137 |
+
|
| 138 |
+
## π License
|
| 139 |
+
|
| 140 |
+
GPL-3.0 - See LICENSE file for details
|
| 141 |
+
|
| 142 |
+
## π Links
|
| 143 |
+
|
| 144 |
+
- [HuggingFace Spaces Documentation](https://huggingface.co/docs/hub/spaces-overview)
|
| 145 |
+
- [Gradio Documentation](https://gradio.app/docs/)
|
| 146 |
+
- [OpenRouter API](https://openrouter.ai/)
|
| 147 |
+
|
| 148 |
+
---
|
| 149 |
|
| 150 |
+
Built with β€οΈ for educators and learners
|