Spaces:
Paused
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
srclayout 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 (recommended) or pip
Installation
Clone the repository:
git clone https://github.com/naked-insurance/naked-chat-poc.git cd naked-chat-pocSet up the environment:
# 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]"Configure environment variables:
cp .env.example .env # Edit .env with your API keys and configurationRun the application:
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 keyGOOGLE_API_KEY: Your Google Gemini API keyDEFAULT_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
# Run all tests
pytest
# Run with coverage
pytest --cov=naked_chat
Code Quality
# Linting and formatting with Ruff
ruff check .
ruff format .
# Type checking with mypy
mypy src/naked_chat
Development Workflow
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests and quality checks:
pytest && ruff check . && mypy src/naked_chat - Commit your changes:
git commit -m "Add your feature" - Push and create a pull request
π Project Structure Details
src/naked_chat/: Main application package following the src layoutapp.py: Chainlit application entry pointmodels/: LLM integration modulesutils/: Utility functions and helpers
tests/: Comprehensive test suite- Unit tests for core functionality
- Integration tests for LLM providers
.chainlit/: Chainlit configurationconfig.toml: Framework settings and customizations
public/: Static assetstheme.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.