Spaces:
Paused
Paused
File size: 4,474 Bytes
971a10e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | # 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.
|