Commit History
-
Fix: DynamicCache compatibility, dependencies, and Docker configuration
CRITICAL FIXES: - Fixed DynamicCache.seen_tokens AttributeError for Phi-3 models - Pinned transformers to compatible version (4.36.0-4.41.0) - Added multi-level fallback chain (Mistral -> Phi-3) - Fixed Docker user creation to prevent getpwuid errors - Enhanced error handling for model generation Changes: - src/local_model_loader.py: - Added DynamicCache compatibility fix for Phi-3 models - Automatic use_cache=False for Phi-3 to avoid seen_tokens error - Retry logic with cache disabled if DynamicCache error occurs - Better error messages and logging - src/llm_router.py: - Enhanced fallback chain to support fallback + fallback2 - Sequential fallback attempts (Mistral -> Phi-3) - Better error handling for multi-level fallbacks - src/models_config.py: - Updated fallback chain: Mistral (primary fallback) -> Phi-3 (secondary) - Mistral is non-gated and has no DynamicCache issues - Phi-3 as secondary fallback with DynamicCache workaround - requirements.txt: - Pinned…ea87e33 -
Fix: GPU tensor placement and Docker deployment configuration
CRITICAL FIXES: - Fixed tensor device placement errors (meta device issues) - Added explicit device placement for non-quantized models - Updated Dockerfile with cache directory setup - Created comprehensive deployment configuration guide Changes: - src/local_model_loader.py: - Use device_map='auto' only with quantization (prevents meta device errors) - Explicit .to(device) placement for non-quantized models - Better logging for model loading status - Dockerfile: - Create cache directories with proper permissions - Set HF_HOME and TRANSFORMERS_CACHE environment variables - Ensure /tmp directories are writable - DEPLOYMENT_CONFIG_GUIDE.md (NEW): - Comprehensive guide for all deployment issues - Cache directory permission fixes - HF_TOKEN configuration - GPU tensor placement solutions - Troubleshooting steps - Verification checklist Fixes: - Tensor on device meta errors → Explicit device placement - Permission denied /cache errors → Dockerfile creates /tmp/cach…67c580c -
Security Enhancements: Production WSGI, Rate Limiting, Security Headers, Secure Logging
- Added Gunicorn production WSGI server (replaces Flask dev server) - Implemented rate limiting with Flask-Limiter (10/min chat, 5/min initialize) - Added comprehensive security headers (10 headers including Phase 1 enhancements) - Implemented secure logging with file rotation and sensitive data sanitization - Added OMP_NUM_THREADS validation to prevent invalid environment variable errors - Added database indexes for performance optimization - Created production startup script with environment validation - Added security audit and check scripts - Updated Dockerfile for production deployment - Added security tools (Bandit, Safety) to requirements.txt - Created comprehensive security documentation and roadmap - Enhanced configuration management with secure defaults79ea999
-
Set DB_PATH environment variable in Dockerfile for explicit database location
1d056ab -
Fix database path issue for Docker/HF Spaces - use /tmp for writable directory
4e3f60e -
Initial commit: Research AI Assistant API
8f4d405