chore: cleanup — remove docker-compose.yml (use compose.yml), delete dead files
This commit is contained in:
@@ -1,89 +0,0 @@
|
||||
# GEMINI.md
|
||||
|
||||
This file provides guidance to Gemini when working with code in this repository.
|
||||
|
||||
## Development Commands
|
||||
|
||||
### Installation
|
||||
- `make install-dev` - Install core development dependencies
|
||||
- `make install-proxy-dev` - Install proxy development dependencies with full feature set
|
||||
- `make install-test-deps` - Install all test dependencies
|
||||
|
||||
### Testing
|
||||
- `make test` - Run all tests
|
||||
- `make test-unit` - Run unit tests (tests/test_litellm) with 4 parallel workers
|
||||
- `make test-integration` - Run integration tests (excludes unit tests)
|
||||
- `pytest tests/` - Direct pytest execution
|
||||
|
||||
### Code Quality
|
||||
- `make lint` - Run all linting (Ruff, MyPy, Black, circular imports, import safety)
|
||||
- `make format` - Apply Black code formatting
|
||||
- `make lint-ruff` - Run Ruff linting only
|
||||
- `make lint-mypy` - Run MyPy type checking only
|
||||
|
||||
### Single Test Files
|
||||
- `poetry run pytest tests/path/to/test_file.py -v` - Run specific test file
|
||||
- `poetry run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
LiteLLM is a unified interface for 100+ LLM providers with two main components:
|
||||
|
||||
### Core Library (`litellm/`)
|
||||
- **Main entry point**: `litellm/main.py` - Contains core completion() function
|
||||
- **Provider implementations**: `litellm/llms/` - Each provider has its own subdirectory
|
||||
- **Router system**: `litellm/router.py` + `litellm/router_utils/` - Load balancing and fallback logic
|
||||
- **Type definitions**: `litellm/types/` - Pydantic models and type hints
|
||||
- **Integrations**: `litellm/integrations/` - Third-party observability, caching, logging
|
||||
- **Caching**: `litellm/caching/` - Multiple cache backends (Redis, in-memory, S3, etc.)
|
||||
|
||||
### Proxy Server (`litellm/proxy/`)
|
||||
- **Main server**: `proxy_server.py` - FastAPI application
|
||||
- **Authentication**: `auth/` - API key management, JWT, OAuth2
|
||||
- **Database**: `db/` - Prisma ORM with PostgreSQL/SQLite support
|
||||
- **Management endpoints**: `management_endpoints/` - Admin APIs for keys, teams, models
|
||||
- **Pass-through endpoints**: `pass_through_endpoints/` - Provider-specific API forwarding
|
||||
- **Guardrails**: `guardrails/` - Safety and content filtering hooks
|
||||
- **UI Dashboard**: Served from `_experimental/out/` (Next.js build)
|
||||
|
||||
## Key Patterns
|
||||
|
||||
### Provider Implementation
|
||||
- Providers inherit from base classes in `litellm/llms/base.py`
|
||||
- Each provider has transformation functions for input/output formatting
|
||||
- Support both sync and async operations
|
||||
- Handle streaming responses and function calling
|
||||
|
||||
### Error Handling
|
||||
- Provider-specific exceptions mapped to OpenAI-compatible errors
|
||||
- Fallback logic handled by Router system
|
||||
- Comprehensive logging through `litellm/_logging.py`
|
||||
|
||||
### Configuration
|
||||
- YAML config files for proxy server (see `proxy/example_config_yaml/`)
|
||||
- Environment variables for API keys and settings
|
||||
- Database schema managed via Prisma (`proxy/schema.prisma`)
|
||||
|
||||
## Development Notes
|
||||
|
||||
### Code Style
|
||||
- Uses Black formatter, Ruff linter, MyPy type checker
|
||||
- Pydantic v2 for data validation
|
||||
- Async/await patterns throughout
|
||||
- Type hints required for all public APIs
|
||||
|
||||
### Testing Strategy
|
||||
- Unit tests in `tests/test_litellm/`
|
||||
- Integration tests for each provider in `tests/llm_translation/`
|
||||
- Proxy tests in `tests/proxy_unit_tests/`
|
||||
- Load tests in `tests/load_tests/`
|
||||
|
||||
### Database Migrations
|
||||
- Prisma handles schema migrations
|
||||
- Migration files auto-generated with `prisma migrate dev`
|
||||
- Always test migrations against both PostgreSQL and SQLite
|
||||
|
||||
### Enterprise Features
|
||||
- Enterprise-specific code in `enterprise/` directory
|
||||
- Optional features enabled via environment variables
|
||||
- Separate licensing and authentication for enterprise features
|
||||
+66
-105
@@ -1,111 +1,72 @@
|
||||
# Hanzo AI Chat - Base Configuration
|
||||
# Use directly for local development with pre-built images
|
||||
# Override with compose.dev.yml for mounted volumes
|
||||
# Override with compose.prod.yml for production deployment
|
||||
# Do not edit this file directly. Use a ‘docker-compose.override.yaml’ file if you can.
|
||||
# Refer to `docker-compose.override.yaml.example’ for some sample configurations.
|
||||
|
||||
services:
|
||||
# MongoDB for Chat History
|
||||
mongodb:
|
||||
image: mongo:7-jammy
|
||||
container_name: hanzo-mongodb
|
||||
api:
|
||||
container_name: HanzoChat
|
||||
ports:
|
||||
- "27017:27017"
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME:-hanzo}
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-hanzo123}
|
||||
MONGO_INITDB_DATABASE: HanzoChat
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
networks:
|
||||
- hanzo-network
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Meilisearch for Full-Text Search
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:v1.8
|
||||
container_name: hanzo-meilisearch
|
||||
environment:
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-hanzo-search-key}
|
||||
MEILI_ENV: ${MEILI_ENV:-development}
|
||||
volumes:
|
||||
- meilisearch_data:/meili_data
|
||||
networks:
|
||||
- hanzo-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://127.0.0.1:7700/health"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
|
||||
# Hanzo Chat UI
|
||||
chat:
|
||||
image: ghcr.io/hanzoai/chat:latest
|
||||
container_name: hanzo-chat
|
||||
ports:
|
||||
- "3081:3080"
|
||||
environment:
|
||||
# Domain (override for production: https://hanzo.chat)
|
||||
DOMAIN_CLIENT: ${DOMAIN_CLIENT:-http://localhost:3081}
|
||||
DOMAIN_SERVER: ${DOMAIN_SERVER:-http://localhost:3081}
|
||||
|
||||
# Database
|
||||
MONGO_URI: mongodb://${MONGO_USERNAME:-hanzo}:${MONGO_PASSWORD:-hanzo123}@mongodb:27017/HanzoChat?authSource=admin
|
||||
|
||||
# Search
|
||||
MEILI_HOST: http://meilisearch:7700
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-hanzo-search-key}
|
||||
|
||||
# Auth
|
||||
ALLOW_REGISTRATION: ${ALLOW_REGISTRATION:-true}
|
||||
ALLOW_SOCIAL_LOGIN: ${ALLOW_SOCIAL_LOGIN:-true}
|
||||
ALLOW_SOCIAL_REGISTRATION: ${ALLOW_SOCIAL_REGISTRATION:-true}
|
||||
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt}
|
||||
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-your-super-secret-jwt-refresh}
|
||||
# Hanzo IAM OpenID Connect
|
||||
OPENID_CLIENT_ID: ${OPENID_CLIENT_ID:-}
|
||||
OPENID_CLIENT_SECRET: ${OPENID_CLIENT_SECRET:-}
|
||||
OPENID_ISSUER: ${OPENID_ISSUER:-}
|
||||
OPENID_SESSION_SECRET: ${OPENID_SESSION_SECRET:-}
|
||||
OPENID_SCOPE: ${OPENID_SCOPE:-openid profile email}
|
||||
OPENID_CALLBACK_URL: ${OPENID_CALLBACK_URL:-/oauth/openid/callback}
|
||||
OPENID_BUTTON_LABEL: ${OPENID_BUTTON_LABEL:-Log in with Hanzo}
|
||||
OPENID_IMAGE_URL: ${OPENID_IMAGE_URL:-}
|
||||
OPENID_USERNAME_CLAIM: ${OPENID_USERNAME_CLAIM:-name}
|
||||
OPENID_NAME_CLAIM: ${OPENID_NAME_CLAIM:-name}
|
||||
OPENID_USE_PKCE: ${OPENID_USE_PKCE:-true}
|
||||
|
||||
# AI Provider - All requests go through Hanzo API gateway
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY:-sk-hanzo-your-key}
|
||||
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-https://api.hanzo.ai/v1}
|
||||
|
||||
# Features
|
||||
MCP_ENABLED: ${MCP_ENABLED:-true}
|
||||
|
||||
# Branding
|
||||
APP_TITLE: ${APP_TITLE:-Hanzo AI Chat}
|
||||
CUSTOM_FOOTER: ${CUSTOM_FOOTER:-Powered by Hanzo AI}
|
||||
- "${PORT}:${PORT}"
|
||||
depends_on:
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
meilisearch:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- hanzo-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3080/api/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
- mongodb
|
||||
- rag_api
|
||||
image: ghcr.io/hanzoai/chat:latest
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- MONGO_URI=mongodb://mongodb:27017/HanzoChat
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- RAG_PORT=${RAG_PORT:-8000}
|
||||
- RAG_API_URL=http://rag_api:${RAG_PORT:-8000}
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./.env
|
||||
target: /app/.env
|
||||
- ./images:/app/client/public/images
|
||||
- ./uploads:/app/uploads
|
||||
- ./logs:/app/logs
|
||||
mongodb:
|
||||
container_name: chat-mongodb
|
||||
image: mongo:8.0.17
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
volumes:
|
||||
- ./data-node:/data/db
|
||||
command: mongod --noauth
|
||||
meilisearch:
|
||||
container_name: chat-meilisearch
|
||||
image: getmeili/meilisearch:v1.35.1
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
environment:
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- MEILI_NO_ANALYTICS=true
|
||||
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
|
||||
volumes:
|
||||
- ./meili_data_v1.35.1:/meili_data
|
||||
vectordb:
|
||||
container_name: vectordb
|
||||
image: pgvector/pgvector:0.8.0-pg15-trixie
|
||||
environment:
|
||||
POSTGRES_DB: mydatabase
|
||||
POSTGRES_USER: myuser
|
||||
POSTGRES_PASSWORD: mypassword
|
||||
restart: always
|
||||
volumes:
|
||||
- pgdata2:/var/lib/postgresql/data
|
||||
rag_api:
|
||||
container_name: rag_api
|
||||
image: ghcr.io/hanzoai/chat-rag-api:latest
|
||||
environment:
|
||||
- DB_HOST=vectordb
|
||||
- RAG_PORT=${RAG_PORT:-8000}
|
||||
restart: always
|
||||
depends_on:
|
||||
- vectordb
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
mongodb_data:
|
||||
meilisearch_data:
|
||||
|
||||
networks:
|
||||
hanzo-network:
|
||||
driver: bridge
|
||||
pgdata2:
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
# Do not edit this file directly. Use a ‘docker-compose.override.yaml’ file if you can.
|
||||
# Refer to `docker-compose.override.yaml.example’ for some sample configurations.
|
||||
|
||||
services:
|
||||
api:
|
||||
container_name: HanzoChat
|
||||
ports:
|
||||
- "${PORT}:${PORT}"
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rag_api
|
||||
image: ghcr.io/hanzoai/chat:latest
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- MONGO_URI=mongodb://mongodb:27017/HanzoChat
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- RAG_PORT=${RAG_PORT:-8000}
|
||||
- RAG_API_URL=http://rag_api:${RAG_PORT:-8000}
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./.env
|
||||
target: /app/.env
|
||||
- ./images:/app/client/public/images
|
||||
- ./uploads:/app/uploads
|
||||
- ./logs:/app/logs
|
||||
mongodb:
|
||||
container_name: chat-mongodb
|
||||
image: mongo:8.0.17
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
volumes:
|
||||
- ./data-node:/data/db
|
||||
command: mongod --noauth
|
||||
meilisearch:
|
||||
container_name: chat-meilisearch
|
||||
image: getmeili/meilisearch:v1.35.1
|
||||
restart: always
|
||||
user: "${UID}:${GID}"
|
||||
environment:
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- MEILI_NO_ANALYTICS=true
|
||||
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
|
||||
volumes:
|
||||
- ./meili_data_v1.35.1:/meili_data
|
||||
vectordb:
|
||||
container_name: vectordb
|
||||
image: pgvector/pgvector:0.8.0-pg15-trixie
|
||||
environment:
|
||||
POSTGRES_DB: mydatabase
|
||||
POSTGRES_USER: myuser
|
||||
POSTGRES_PASSWORD: mypassword
|
||||
restart: always
|
||||
volumes:
|
||||
- pgdata2:/var/lib/postgresql/data
|
||||
rag_api:
|
||||
container_name: rag_api
|
||||
image: ghcr.io/hanzoai/chat-rag-api:latest
|
||||
environment:
|
||||
- DB_HOST=vectordb
|
||||
- RAG_PORT=${RAG_PORT:-8000}
|
||||
restart: always
|
||||
depends_on:
|
||||
- vectordb
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
pgdata2:
|
||||
@@ -1,128 +0,0 @@
|
||||
# Hanzo AI Chat - Clean Deployment
|
||||
# Uses external Hanzo API at api.hanzo.ai
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# MongoDB for Chat History
|
||||
mongodb:
|
||||
image: mongo:7-jammy
|
||||
container_name: hanzo-mongodb
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: hanzo
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-hanzo123}
|
||||
MONGO_INITDB_DATABASE: HanzoChat
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Meilisearch for Full-Text Search
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:v1.9
|
||||
container_name: hanzo-meilisearch
|
||||
environment:
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-HanzoMeiliMasterKey}
|
||||
MEILI_ENV: production
|
||||
ports:
|
||||
- "7700:7700"
|
||||
volumes:
|
||||
- meilisearch_data:/meili_data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Hanzo Chat
|
||||
chat:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: runtime
|
||||
image: hanzo/chat:latest
|
||||
container_name: hanzo-chat
|
||||
ports:
|
||||
- "3081:3080"
|
||||
depends_on:
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
meilisearch:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Server Configuration
|
||||
HOST: 0.0.0.0
|
||||
PORT: 3080
|
||||
|
||||
# Database
|
||||
MONGO_URI: mongodb://hanzo:${MONGO_PASSWORD:-hanzo123}@mongodb:27017/HanzoChat?authSource=admin
|
||||
|
||||
# Domain
|
||||
DOMAIN_CLIENT: ${DOMAIN_CLIENT:-http://localhost:3081}
|
||||
DOMAIN_SERVER: ${DOMAIN_SERVER:-http://localhost:3081}
|
||||
|
||||
# Branding
|
||||
APP_TITLE: "Hanzo AI Chat"
|
||||
CUSTOM_FOOTER: "Powered by Hanzo AI"
|
||||
|
||||
# Hanzo API Configuration
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY:-sk-hanzo-master-key}
|
||||
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-https://api.hanzo.ai/v1}
|
||||
|
||||
# Runtime Execution API
|
||||
CODE_EXECUTION_ENDPOINT: ${CODE_EXECUTION_ENDPOINT:-https://api.hanzo.ai/v1/execute}
|
||||
|
||||
# Auth & Security
|
||||
JWT_SECRET: ${JWT_SECRET:-hanzo-jwt-secret-change-in-production}
|
||||
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-hanzo-refresh-secret-change-in-production}
|
||||
CREDS_KEY: ${CREDS_KEY:-hanzo-creds-key-change-in-production}
|
||||
CREDS_IV: ${CREDS_IV:-hanzo-creds-iv-change}
|
||||
|
||||
# Features
|
||||
ALLOW_REGISTRATION: ${ALLOW_REGISTRATION:-true}
|
||||
ALLOW_UNVERIFIED_EMAIL_LOGIN: ${ALLOW_UNVERIFIED_EMAIL_LOGIN:-false}
|
||||
|
||||
# Search
|
||||
MEILI_HOST: http://meilisearch:7700
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-HanzoMeiliMasterKey}
|
||||
|
||||
# MCP Integration
|
||||
MCP_ENABLED: true
|
||||
|
||||
# Demo Mode (for localhost)
|
||||
SHOW_DEMO_CREDENTIALS: ${SHOW_DEMO_CREDENTIALS:-true}
|
||||
DEMO_EMAIL: ${DEMO_EMAIL:-demo@hanzo.ai}
|
||||
DEMO_INFO: "Register at http://localhost:3081 to get started"
|
||||
|
||||
# Logging
|
||||
DEBUG_LOGGING: ${DEBUG:-false}
|
||||
volumes:
|
||||
- ./client/dist/assets:/app/client/dist/assets:ro
|
||||
- chat_uploads:/app/uploads
|
||||
- chat_logs:/app/logs
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3080/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
volumes:
|
||||
mongodb_data:
|
||||
meilisearch_data:
|
||||
chat_uploads:
|
||||
chat_logs:
|
||||
|
||||
networks:
|
||||
hanzo-network:
|
||||
driver: bridge
|
||||
@@ -1,225 +0,0 @@
|
||||
# Hanzo AI Chat Stack - Full Deployment
|
||||
# Usage: docker compose -f docker-compose.hanzo.yml up -d
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# PostgreSQL Database
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: hanzo-postgres
|
||||
environment:
|
||||
POSTGRES_USER: hanzo
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hanzo123}
|
||||
POSTGRES_DB: hanzo_chat
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U hanzo"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Redis Cache
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: hanzo-redis
|
||||
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-hanzosecret}
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-hanzosecret}", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# MongoDB for Chat History
|
||||
mongodb:
|
||||
image: mongo:7-jammy
|
||||
container_name: hanzo-mongodb
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: hanzo
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-hanzo123}
|
||||
MONGO_INITDB_DATABASE: HanzoChat
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Meilisearch for Full-Text Search
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:v1.9
|
||||
container_name: hanzo-meilisearch
|
||||
environment:
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-HanzoMeiliMasterKey}
|
||||
MEILI_ENV: production
|
||||
ports:
|
||||
- "7700:7700"
|
||||
volumes:
|
||||
- meilisearch_data:/meili_data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Hanzo Router (Unified LLM Gateway)
|
||||
router:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: hanzo/router:latest
|
||||
container_name: hanzo-router
|
||||
ports:
|
||||
- "4000:4000"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Database
|
||||
DATABASE_URL: postgresql://hanzo:${POSTGRES_PASSWORD:-hanzo123}@postgres:5432/hanzo_chat
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD:-hanzosecret}@redis:6379
|
||||
|
||||
# Hanzo Router Configuration
|
||||
ROUTER_MASTER_KEY: ${ROUTER_MASTER_KEY:-sk-hanzo-master-key}
|
||||
LITELLM_MASTER_KEY: ${ROUTER_MASTER_KEY:-sk-hanzo-master-key} # For compatibility
|
||||
|
||||
# LLM API Keys
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
||||
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
|
||||
TOGETHER_API_KEY: ${TOGETHER_API_KEY}
|
||||
|
||||
# Logging
|
||||
ROUTER_LOG_LEVEL: INFO
|
||||
DEBUG: ${DEBUG:-false}
|
||||
volumes:
|
||||
- ./hanzo-config.yaml:/app/config.yaml:ro
|
||||
- ./litellm/proxy/_experimental/out:/app/ui:ro
|
||||
command: ["--config", "/app/config.yaml", "--port", "4000", "--num_workers", "${ROUTER_WORKERS:-4}"]
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Hanzo Chat Frontend
|
||||
chat:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: runtime
|
||||
image: hanzo/chat:latest
|
||||
container_name: hanzo-chat
|
||||
ports:
|
||||
- "3081:3080"
|
||||
depends_on:
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
meilisearch:
|
||||
condition: service_healthy
|
||||
router:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Server Configuration
|
||||
HOST: 0.0.0.0
|
||||
PORT: 3080
|
||||
|
||||
# Database
|
||||
MONGO_URI: mongodb://hanzo:${MONGO_PASSWORD:-hanzo123}@mongodb:27017/HanzoChat?authSource=admin
|
||||
|
||||
# Domain
|
||||
DOMAIN_CLIENT: ${DOMAIN_CLIENT:-http://localhost:3081}
|
||||
DOMAIN_SERVER: ${DOMAIN_SERVER:-http://localhost:3081}
|
||||
|
||||
# Branding
|
||||
APP_TITLE: "Hanzo AI Chat"
|
||||
CUSTOM_FOOTER: "Powered by Hanzo AI"
|
||||
|
||||
# Hanzo Router Gateway
|
||||
OPENAI_API_KEY: proxy
|
||||
OPENAI_BASE_URL: http://router:4000/v1
|
||||
|
||||
# Auth & Security
|
||||
JWT_SECRET: ${JWT_SECRET:-hanzo-jwt-secret-change-in-production}
|
||||
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-hanzo-refresh-secret-change-in-production}
|
||||
CREDS_KEY: ${CREDS_KEY:-hanzo-creds-key-change-in-production}
|
||||
CREDS_IV: ${CREDS_IV:-hanzo-creds-iv-change}
|
||||
|
||||
# Features
|
||||
ALLOW_REGISTRATION: ${ALLOW_REGISTRATION:-true}
|
||||
ALLOW_UNVERIFIED_EMAIL_LOGIN: ${ALLOW_UNVERIFIED_EMAIL_LOGIN:-false}
|
||||
|
||||
# Search
|
||||
MEILI_HOST: http://meilisearch:7700
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-HanzoMeiliMasterKey}
|
||||
|
||||
# MCP Integration
|
||||
MCP_ENABLED: true
|
||||
|
||||
# Logging
|
||||
DEBUG_LOGGING: ${DEBUG:-false}
|
||||
volumes:
|
||||
- ./client/dist/assets:/app/client/dist/assets:ro
|
||||
- chat_uploads:/app/uploads
|
||||
- chat_logs:/app/logs
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3080/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
# Nginx Reverse Proxy
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: hanzo-nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
depends_on:
|
||||
- chat
|
||||
- router
|
||||
volumes:
|
||||
- ./nginx.hanzo.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./ssl:/etc/nginx/ssl:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- hanzo-network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
mongodb_data:
|
||||
meilisearch_data:
|
||||
chat_uploads:
|
||||
chat_logs:
|
||||
|
||||
networks:
|
||||
hanzo-network:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,80 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var typescript = require('rollup-plugin-typescript2');
|
||||
var resolve = require('@rollup/plugin-node-resolve');
|
||||
var pkg = require('./package.json');
|
||||
var peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
||||
var commonjs = require('@rollup/plugin-commonjs');
|
||||
var replace = require('@rollup/plugin-replace');
|
||||
var terser = require('@rollup/plugin-terser');
|
||||
|
||||
const plugins = [
|
||||
peerDepsExternal(),
|
||||
resolve(),
|
||||
replace({
|
||||
__IS_DEV__: process.env.NODE_ENV === 'development',
|
||||
}),
|
||||
commonjs(),
|
||||
typescript({
|
||||
tsconfig: './tsconfig.json',
|
||||
useTsconfigDeclarationDir: true,
|
||||
}),
|
||||
terser(),
|
||||
];
|
||||
|
||||
var rollup_config = [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
output: [
|
||||
{
|
||||
file: pkg.main,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
},
|
||||
{
|
||||
file: pkg.module,
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
},
|
||||
],
|
||||
...{
|
||||
external: [
|
||||
...Object.keys(pkg.dependencies || {}),
|
||||
...Object.keys(pkg.devDependencies || {}),
|
||||
...Object.keys(pkg.peerDependencies || {}),
|
||||
'react',
|
||||
'react-dom',
|
||||
],
|
||||
preserveSymlinks: true,
|
||||
plugins,
|
||||
},
|
||||
},
|
||||
// Separate bundle for react-query related part
|
||||
{
|
||||
input: 'src/react-query/index.ts',
|
||||
output: [
|
||||
{
|
||||
file: 'dist/react-query/index.es.js',
|
||||
format: 'esm',
|
||||
exports: 'named',
|
||||
sourcemap: true,
|
||||
},
|
||||
],
|
||||
external: [
|
||||
...Object.keys(pkg.dependencies || {}),
|
||||
...Object.keys(pkg.devDependencies || {}),
|
||||
...Object.keys(pkg.peerDependencies || {}),
|
||||
'react',
|
||||
'react-dom',
|
||||
// 'librechat-data-provider', // Marking main part as external
|
||||
],
|
||||
preserveSymlinks: true,
|
||||
plugins,
|
||||
},
|
||||
];
|
||||
|
||||
exports.default = rollup_config;
|
||||
Reference in New Issue
Block a user