chat-bot / README.md
surahj's picture
Merge remote changes and resolve README conflict
6a701b2

A newer version of the Gradio SDK is available: 6.6.0

Upgrade
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

  1. Fork this repository to your GitHub account

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

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