feat(agentic-rag): add multi-provider LLM, auth, and Docker support
## Added
- Multi-provider LLM support with factory pattern (8 providers):
* OpenAI, Z.AI, OpenCode Zen, OpenRouter, Anthropic, Google, Mistral, Azure
- Authentication system: JWT + API Key dual-mode
- Provider management API (/api/v1/providers)
- Docker containerization (Dockerfile + docker-compose.yml)
- Updated documentation in main.py
## Modified
- Documents API: added authentication
- Query API: support for provider/model selection
- RAG service: dynamic LLM provider selection
- Config: multi-provider settings
## Infrastructure
- Qdrant vector store integration
- Redis support (optional)
- Health check endpoints
🚀 Ready for production deployment
This commit is contained in:
110
docker-compose.yml
Normal file
110
docker-compose.yml
Normal file
@@ -0,0 +1,110 @@
|
||||
# AgenticRAG - Docker Compose
|
||||
# Complete stack with API, Qdrant, and optional services
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Main API service
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: agenticrag-api
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
||||
- ZAI_API_KEY=${ZAI_API_KEY:-}
|
||||
- OPENCODE_ZEN_API_KEY=${OPENCODE_ZEN_API_KEY:-}
|
||||
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
|
||||
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
||||
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
|
||||
- DEFAULT_LLM_PROVIDER=${DEFAULT_LLM_PROVIDER:-openai}
|
||||
- DEFAULT_LLM_MODEL=${DEFAULT_LLM_MODEL:-gpt-4o-mini}
|
||||
- QDRANT_HOST=qdrant
|
||||
- QDRANT_PORT=6333
|
||||
- JWT_SECRET=${JWT_SECRET:-your-secret-key-change-in-production}
|
||||
- JWT_ALGORITHM=${JWT_ALGORITHM:-HS256}
|
||||
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES:-30}
|
||||
- ADMIN_API_KEY=${ADMIN_API_KEY:-admin-api-key-change-in-production}
|
||||
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000,http://localhost:5173}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
||||
volumes:
|
||||
- ./uploads:/app/uploads
|
||||
- ./data:/app/data
|
||||
depends_on:
|
||||
qdrant:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- agenticrag-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Qdrant Vector Database
|
||||
qdrant:
|
||||
image: qdrant/qdrant:latest
|
||||
container_name: agenticrag-qdrant
|
||||
ports:
|
||||
- "6333:6333"
|
||||
- "6334:6334"
|
||||
volumes:
|
||||
- qdrant-storage:/qdrant/storage
|
||||
networks:
|
||||
- agenticrag-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
# Optional: Redis for caching
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: agenticrag-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- agenticrag-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
# Optional: Nginx reverse proxy
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: agenticrag-nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- agenticrag-network
|
||||
restart: unless-stopped
|
||||
profiles:
|
||||
- production
|
||||
|
||||
volumes:
|
||||
qdrant-storage:
|
||||
driver: local
|
||||
redis-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
agenticrag-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user