| | --- |
| | title: LLM Chat Interface |
| | emoji: π€ |
| | colorFrom: blue |
| | colorTo: purple |
| | sdk: gradio |
| | sdk_version: 4.44.1 |
| | app_file: app.py |
| | pinned: false |
| | --- |
| | |
| | # LLM Chat Interface |
| |
|
| | A beautiful web-based chat interface for local LLM models built with Gradio. |
| |
|
| | ## Features |
| |
|
| | - π€ Chat with local LLM models |
| | - π¨ Beautiful, modern UI with dark theme |
| | - βοΈ Adjustable model parameters (temperature, top-p, max tokens) |
| | - π¬ System message support |
| | - π± Responsive design |
| | - π Real-time chat history |
| |
|
| | ## Deployment on Hugging Face Spaces |
| |
|
| | This project is configured for easy deployment on Hugging Face Spaces. |
| |
|
| | ### Quick Deploy |
| |
|
| | 1. **Fork this repository** to your GitHub account |
| | 2. **Create a new Space** on Hugging Face: |
| |
|
| | - Go to [huggingface.co/spaces](https://huggingface.co/spaces) |
| | - Click "Create new Space" |
| | - Choose "Gradio" as the SDK |
| | - Select your forked repository |
| | - Choose hardware (CPU is sufficient for basic usage) |
| |
|
| | 3. **Configure the Space**: |
| | - The Space will automatically use `app.py` as the entry point |
| | - Model files should be placed in the `models/` directory |
| | - Environment variables can be set in the Space settings |
| |
|
| | ### Model Setup |
| |
|
| | To use your own model: |
| |
|
| | 1. **Add model files** to the `models/` directory |
| | 2. **Update the model path** in `app/llm_manager.py` |
| | 3. **Push changes** to your repository |
| |
|
| | ### Environment Variables |
| |
|
| | Set these in your HF Space settings if needed: |
| |
|
| | - `MODEL_PATH`: Path to your model file |
| | - `MODEL_TYPE`: Type of model (llama, phi, etc.) |
| |
|
| | ## Local Development |
| |
|
| | ```bash |
| | # Install dependencies |
| | pip install -r requirements.txt |
| | |
| | # Run the interface |
| | python app.py |
| | ``` |
| |
|
| | ## Project Structure |
| |
|
| | ``` |
| | βββ app/ |
| | β βββ __init__.py |
| | β βββ gradio_interface.py # Main Gradio interface |
| | β βββ llm_manager.py # LLM model management |
| | β βββ api_models.py # API data models |
| | βββ models/ # Model files directory |
| | βββ tests/ # Test files |
| | βββ app.py # HF Spaces entry point |
| | βββ requirements.txt # Python dependencies |
| | βββ README.md # This file |
| | ``` |
| |
|
| | ## Contributing |
| |
|
| | 1. Fork the repository |
| | 2. Create a feature branch |
| | 3. Make your changes |
| | 4. Add tests if applicable |
| | 5. Submit a pull request |
| |
|
| | ## License |
| |
|
| | MIT License - see LICENSE file for details. |
| |
|