Add offline mode support for Docker with pre-cached models#34
Add offline mode support for Docker with pre-cached models#34aponcedeleonch merged 2 commits intomainfrom
Conversation
- Added tiktoken and fastembed offline support to Dockerfile - Pre-download tiktoken encodings (cl100k_base, o200k_base) during build - Pre-download fastembed models (BAAI/bge-small-en-v1.5) during build - Copy cached models to final image with proper environment variables - Updated EmbeddingManager to support offline mode - Added `fastembed_cache_path` parameter to explicitly set cache directory - Added `local_files_only` flag when cache path is set to prevent network calls - Added offline testing infrastructure - Created `scripts/test-offline.sh` for testing without network access - Added CI workflow to test offline mode using `docker run --network none` - Integrated offline tests into code-checks workflow - Updated all tests to use new EmbeddingManager signature This enables the container to run in airgapped/offline environments without requiring internet access for model downloads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
PR ReviewStrengths
Code Quality Issues1. Redundant cache path setting (Dockerfile:71) 2. Coupling between cache path and offline mode (embeddings.py:67) 3. Verbosity: Debug prints in production Dockerfile (lines 73-80) 4. Missing parameter documentation (embeddings.py:44-54) 5. Trailing comma inconsistency (config.py:160) Security and Performance
Recommendations
Overall: Strong PR with minor cleanup needed. The implementation correctly enables offline deployment. |
|
@claude check again the latest commit and see if the comments were addressed |
|
Claude finished @aponcedeleonch's task —— View job Re-review ResultsChecking if the 5 previously identified issues were addressed in the latest commit:
SummaryAll issues have been successfully addressed! ✓ Issue #1: Redundant cache path setting (Dockerfile:71) - FIXEDThe redundant Issue #2: Coupling between cache path and offline mode (embeddings.py:67-68) - ACKNOWLEDGEDThe coupling remains (line 68: Issue #3: Debug prints in Dockerfile (lines 73-80) - FIXEDAll verbose print statements and Issue #4: Missing parameter documentation (embeddings.py:44-56) - FIXEDThe fastembed_cache_path: Optional path to FastEmbed model cache directory.Issue #5: Trailing comma inconsistency (config.py:160) - FIXEDThe trailing comma formatting has been corrected. Line 160-161 now consistently uses proper spacing. RecommendationThis PR is ready to merge. All identified code quality issues have been resolved, and the offline mode implementation is production-ready. Job Run: https://github.com/StacklokLabs/mcp-optimizer/actions/runs/${{ github.run_id }} |
fastembed_cache_pathparameter to explicitly set cache directorylocal_files_onlyflag when cache path is set to prevent network callsscripts/test-offline.shfor testing without network accessdocker run --network noneThis enables the container to run in airgapped/offline environments without requiring internet access for model downloads.
🤖 Generated with Claude Code