A newer version of the Gradio SDK is available:
6.6.0
metadata
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
Fork this repository to your GitHub account
Create a new Space on Hugging Face:
- Go to huggingface.co/spaces
- Click "Create new Space"
- Choose "Gradio" as the SDK
- Select your forked repository
- Choose hardware (CPU is sufficient for basic usage)
Configure the Space:
- The Space will automatically use
app.pyas the entry point - Model files should be placed in the
models/directory - Environment variables can be set in the Space settings
- The Space will automatically use
Model Setup
To use your own model:
- Add model files to the
models/directory - Update the model path in
app/llm_manager.py - Push changes to your repository
Environment Variables
Set these in your HF Space settings if needed:
MODEL_PATH: Path to your model fileMODEL_TYPE: Type of model (llama, phi, etc.)
Local Development
# 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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.