--- 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.