CypherWang / localAI

LocalLLM-0.5b
2 stars 0 forks source link

LocalAI Chat Application

This is a simple chat application built with Flask, simulating a ChatGPT-like interface. It uses a local language model API to generate responses and stores chat history in an SQLite database.

Project Structure

LocalAI/
├── app.py
├── static/
│   ├── images/
│   │   ├── user-avatar.png
│   │   └── assistant-avatar.png
│   ├── styles.css
│   ├── script.js
│   └── admin.js
├── templates/
│   ├── index.html
│   └── admin.html
├── chat.db

Features

Installation

  1. Clone the repository

    git clone https://github.com/CypherWang/localAI.git
    cd localAI
  2. Create a virtual environment and activate it

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the dependencies

    pip install -r requirements.txt
  4. Initialize the database

    python -c "from app import init_db; init_db()"

Usage

  1. Start the Flask server

    python app.py
  2. Access the application in your web browser

    • Chat interface: http://127.0.0.1:5000
    • Admin interface: http://127.0.0.1:5000/admin

API Endpoints

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Acknowledgments