# Naked Insurance - LLM Chat Client POC This repository contains the Proof of Concept (POC) for a Large Language Model (LLM) powered chat client for internal use at Naked Insurance. The application is built using the Chainlit framework for both the frontend and backend. ## ๐ŸŽฏ Project Overview This POC demonstrates a modern, production-ready approach to building an LLM-powered chat interface that can integrate with multiple AI providers (OpenAI, Google Gemini) while maintaining a clean, maintainable codebase. ### Key Features - **Multi-Provider LLM Support**: Seamless integration with OpenAI GPT models (including flagship and reasoning models) and Google Gemini - **Latest AI Models**: Support for GPT-4.1, GPT-4o, o3 series reasoning models, and Gemini 2.5 Pro/Flash - **Modern Python Architecture**: Uses the `src` layout with proper packaging and dependency management - **Production-Ready Foundation**: Comprehensive tooling for linting, testing, and type checking - **Chainlit Framework**: Leverages Chainlit for rapid prototyping of chat interfaces - **Environment-Based Configuration**: Secure handling of API keys and configuration ## ๐Ÿ—๏ธ Architecture The project follows modern Python best practices with a clear separation of concerns: ``` naked-chat-poc/ โ”œโ”€โ”€ .chainlit/ # Chainlit-specific configurations โ”œโ”€โ”€ .github/ # GitHub templates and workflows โ”œโ”€โ”€ public/ # Static assets (themes, logos, etc.) โ”œโ”€โ”€ src/naked_chat/ # Main application package โ”œโ”€โ”€ tests/ # Test suite โ”œโ”€โ”€ pyproject.toml # Project configuration and dependencies โ””โ”€โ”€ README.md # This file ``` ## ๐Ÿš€ Quick Start ### Prerequisites - Python 3.9 or higher - [uv](https://github.com/astral-sh/uv) (recommended) or pip ### Installation 1. **Clone the repository**: ```bash git clone https://github.com/naked-insurance/naked-chat-poc.git cd naked-chat-poc ``` 2. **Set up the environment**: ```bash # Using uv (recommended) uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e ".[dev]" # Or using pip python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -e ".[dev]" ``` 3. **Configure environment variables**: ```bash cp .env.example .env # Edit .env with your API keys and configuration ``` 4. **Run the application**: ```bash chainlit run src/naked_chat/app.py ``` The application will be available at `http://localhost:8000`. ## โš™๏ธ Configuration ### Environment Variables Copy `.env.example` to `.env` and configure the following variables: - `OPENAI_API_KEY`: Your OpenAI API key - `GOOGLE_API_KEY`: Your Google Gemini API key - `DEFAULT_MODEL`: Default LLM model to use ### Chainlit Configuration The `.chainlit/config.toml` file contains Chainlit-specific settings for data persistence, file uploads, and UI customization. ## ๐Ÿงช Development ### Running Tests ```bash # Run all tests pytest # Run with coverage pytest --cov=naked_chat ``` ### Code Quality ```bash # Linting and formatting with Ruff ruff check . ruff format . # Type checking with mypy mypy src/naked_chat ``` ### Development Workflow 1. Create a feature branch: `git checkout -b feature/your-feature-name` 2. Make your changes 3. Run tests and quality checks: `pytest && ruff check . && mypy src/naked_chat` 4. Commit your changes: `git commit -m "Add your feature"` 5. Push and create a pull request ## ๐Ÿ“ Project Structure Details - **`src/naked_chat/`**: Main application package following the src layout - `app.py`: Chainlit application entry point - `models/`: LLM integration modules - `utils/`: Utility functions and helpers - **`tests/`**: Comprehensive test suite - Unit tests for core functionality - Integration tests for LLM providers - **`.chainlit/`**: Chainlit configuration - `config.toml`: Framework settings and customizations - **`public/`**: Static assets - `theme.json`: Custom branding and themes - Assets like logos, favicons, etc. ## ๐Ÿค Contributing This is an internal POC project. Please follow the established code style and ensure all tests pass before submitting changes. ## ๐Ÿ“„ License This project is proprietary to Naked Insurance. --- **Note**: This is a Proof of Concept intended for internal evaluation and demonstration purposes.