{"id":29092400,"url":"https://github.com/parisneo/lollms_chat","last_synced_at":"2025-06-28T07:06:43.881Z","repository":{"id":292194112,"uuid":"979259256","full_name":"ParisNeo/lollms_chat","owner":"ParisNeo","description":"A simple Fast API based multi users backend/front end app to serve discussions using lollms_client library","archived":false,"fork":false,"pushed_at":"2025-06-28T00:25:59.000Z","size":8228,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T01:26:31.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParisNeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T08:35:17.000Z","updated_at":"2025-06-28T00:26:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4bccd6fc-db06-4451-8055-25c67a475593","html_url":"https://github.com/ParisNeo/lollms_chat","commit_stats":null,"previous_names":["parisneo/simplified_lollms","parisneo/lollms_chat"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ParisNeo/lollms_chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParisNeo","download_url":"https://codeload.github.com/ParisNeo/lollms_chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParisNeo%2Flollms_chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262389478,"owners_count":23303343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-28T07:06:42.024Z","updated_at":"2025-06-28T07:06:43.869Z","avatar_url":"https://github.com/ParisNeo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simplified LoLLMs Chat\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Python Version](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/downloads/)\n![Version](https://img.shields.io/badge/Version-1.6.0-brightgreen) \u003c!-- Updated Version --\u003e\n\u003c!-- Add build status badge if CI is set up --\u003e\n\u003c!-- [![Build Status](https://img.shields.io/your_ci_badge_url)](your_ci_link) --\u003e\n\nA multi-user FastAPI backend and responsive HTML/Tailwind CSS frontend application designed to provide a chat interface powered by the [`lollms-client`](https://github.com/ParisNeo/lollms-client) library. It features integrated Retrieval-Augmented Generation (RAG) using [`safe_store`](https://github.com/ParisNeo/safe_store), multimodal chat, user personalities, a friend system, direct messaging, and enhanced sharing capabilities.\n\n**Live Project:** [https://github.com/ParisNeo/simplified_lollms](https://github.com/ParisNeo/simplified_lollms)\n\n## Overview\n\nThis project aims to provide a self-hostable, user-friendly chat interface that can connect to various Large Language Models (LLMs) supported by `lollms-client`. It features multi-user support with basic authentication, persistent discussions, RAG functionality, multimodal chat (image input), customizable user personalities, a friend system with direct messaging, administrative user management, and sharing of datastores and personalities.\n\n## ✨ Features\n\n*   **Multi-User Support:** Secure login via Token based authentication. Each user has their own isolated data.\n*   **Persistent Discussions:** Chat histories are saved per user (YAML files) and can be revisited, renamed, starred, and deleted.\n*   **LLM Integration:** Uses `lollms-client` to interact with various LLM backends.\n*   **Streaming Responses:** AI responses are streamed for a real-time experience.\n*   **Multimodal Chat:** Upload images with text prompts for vision-capable models.\n*   **User Personalities (System Prompts):**\n    *   Create, edit, and delete custom personalities (system prompts with name, category, author, icon, etc.).\n    *   Select an active personality to guide LLM responses.\n    *   View and use public (system-provided) personalities.\n    *   Share (send a copy of) owned personalities with friends.\n*   **Retrieval-Augmented Generation (RAG):**\n    *   Multiple **DataStores** per user for organizing RAG documents.\n    *   Upload documents (`.txt`, `.pdf`, `.docx`, `.html`, etc.) to specific DataStores.\n    *   Toggle RAG usage per discussion, selecting a specific DataStore.\n    *   Manage DataStores (create, rename, delete) and their indexed documents.\n    *   **Share DataStores with friends** (read-only query access).\n*   **Friend System \u0026 Direct Messaging (DM):**\n    *   Send, accept, and reject friend requests.\n    *   View friends list and manage friendships (unfriend, block/unblock - *block/unblock WIP*).\n    *   **Send and receive direct messages** with accepted friends.\n    *   View conversation history with friends.\n*   **Configurable Settings:**\n    *   Users can set their default LLM model, RAG vectorizer, LLM generation parameters (temperature, top_k, etc.), RAG parameters, and personal profile information.\n*   **Admin Panel:**\n    *   Manage users (Add, List, Delete, Reset Password).\n    *   Initial superadmin user created from `config.toml`.\n*   **Data Export/Import:** Users can export/import their discussions, settings, and metadata.\n*   **Responsive UI:** Built with Tailwind CSS, including image previews, Markdown rendering with code highlighting (Highlight.js) and math (KaTeX).\n*   **Dark/Light Theme \u0026 Internationalization (i18n).**\n*   **SQLite Backend:** Central database for users, settings, personalities, friendships, DMs. SafeStore uses its own DBs per DataStore.\n\n## 🏗️ Architecture\n\n*   **Backend:** FastAPI (Python)\n*   **LLM Communication:** `lollms-client`\n*   **RAG/Vector Store:** `safe_store` (SQLite based per DataStore)\n*   **Main Database:** SQLAlchemy with SQLite (users, personalities, friendships, DMs, etc.)\n*   **Authentication:** HTTP Basic Auth + Passlib\n*   **Frontend:** HTML, Tailwind CSS, Vanilla JavaScript\n*   **Configuration:** TOML (`config.toml`)\n*   **Discussion Storage:** YAML files per user\n\n## 📸 Screenshots\n\n*(Add updated screenshots showing the new Friends \u0026 Messages modal, DM interface, personality editor, and sharing options)*\n\n**Login Screen:**\n`![Login Screen](placeholder_login.png)`\n\n**Main Chat UI (with Personality Selector \u0026 RAG):**\n`![Chat UI](placeholder_chat_main.png)`\n\n**Friends \u0026 Messages Modal:**\n`![Friends \u0026 Messages Modal](placeholder_friends_dm.png)`\n\n**Personality Editor Modal:**\n`![Personality Editor](placeholder_personality_editor.png)`\n\n**Settings Modal (User Profile, LLM/RAG Params):**\n`![Settings Modal](placeholder_settings_new.png)`\n\n**DataStore Management \u0026 Sharing:**\n`![DataStore Management](placeholder_datastore_manage.png)`\n\n**Admin Panel:**\n`![Admin Panel](placeholder_admin.png)`\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n*   Python 3.8+\n*   Git, Pip\n*   An LLM backend accessible via `lollms-client`.\n\n### Installation\n\n1.  **Clone:**\n    ```bash\n    git clone https://github.com/ParisNeo/simplified_lollms.git\n    cd simplified_lollms\n    ```\n2.  **Virtual Environment (Recommended):**\n    ```bash\n    python -m venv venv\n    # Windows: venv\\Scripts\\activate\n    # macOS/Linux: source venv/bin/activate\n    ```\n3.  **Install Dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n4.  **Configure `config.toml`:**\n    *   Copy `config_example.toml` to `config.toml`.\n    *   **Crucially:** Change `password` under `[initial_admin_user]`.\n    *   Set `binding_name` and `default_model_name` in `[lollms_client_defaults]`.\n    *   Review other settings.\n5.  **Run:**\n    ```bash\n    uvicorn main:app --host 0.0.0.0 --port 9642\n    ```\n\n### Usage\n\n1.  **Access UI:** `http://localhost:9642`\n2.  **Login:** Use initial admin or created user credentials.\n3.  **Chat:** Create/select discussions, use RAG, upload images.\n4.  **Personalities:** Manage and select active personalities via Settings.\n5.  **Friends \u0026 DMs:** Access via user menu to manage friends and send messages.\n6.  **DataStores:** Manage RAG DataStores and share them via user menu.\n7.  **Settings:** Configure user profile, LLM/RAG parameters, active personality.\n8.  **Admin Panel:** `/admin` for user management (admins only).\n\n## ⚙️ Configuration (`config.toml`)\n\n*   **`[app_settings]`**: `data_dir`, `database_url`.\n*   **`[initial_admin_user]`**: `username`, `password`, optional `first_name`, `email`.\n*   **`[lollms_client_defaults]`**: `binding_name`, `default_model_name`, LLM parameters, `put_thoughts_in_context`.\n*   **`[safe_store_defaults]`**: RAG chunking, `global_default_vectorizer`.\n*   **`[server]`**: `host`, `port`.\n\n## 📚 API Documentation\n\n*   **Swagger UI:** `http://localhost:9642/docs`\n*   **ReDoc:** `http://localhost:9642/redoc`\n\n## 📁 Folder Structure\n\n```text\n📁 simplified_lollms/\n├─ 📁 data/                  # User data, DBs (created automatically)\n│  ├─ 📄 app_main.db         # Central SQLite DB\n│  └─ 📁 \u003cusername\u003e/         # Per-user data\n│     ├─ 📁 discussions/\n│     ├─ 📁 discussion_assets/\n│     ├─ 📁 safestores/       # RAG DataStore DBs\n│     └─ 📁 temp_uploads/\n├─ 📁 locales/               # i18n JSON files\n├─ 📄 .gitignore\n├─ 📄 admin.html\n├─ 📄 config.toml\n├─ 📄 config_example.toml\n├─ 📄 database_setup.py      # SQLAlchemy models \u0026 DB init\n├─ 📄 index.html             # Main chat UI\n├─ 📄 LICENSE\n├─ 📄 main.js                # Frontend JavaScript\n├─ 📄 main.py                # FastAPI application\n├─ 📄 README.md              # This file\n├─ 📄 requirements.txt\n└─ 📄 style.css              # Custom CSS\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## 📜 License\n\nApache License 2.0. See [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Flollms_chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparisneo%2Flollms_chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparisneo%2Flollms_chat/lists"}