Optimize miku-bot container size by removing unused dependencies

Major changes:
- Remove unused ML libraries: torch, scikit-learn, langchain-core, langchain-text-splitters, langchain-community, faiss-cpu
- Comment out unused langchain imports in utils/core.py (only used in commented-out code)
- Keep transformers (used in persona_dialogue.py for sentiment analysis)

Results:
- Container size reduced from 14.5GB to 2.6GB
- 82% reduction (11.9GB saved)
- Bot runs correctly without errors
- All functionality preserved

Removed packages:
- torch: ~1.0-1.5GB (not used, only in soprano_to_rvc/)
- scikit-learn: ~200-300MB (not used in bot/)
- langchain-core: ~50-100MB (not used, only in commented code)
- langchain-text-splitters: ~30-50MB (not used, only in commented code)
- langchain-community: ~50-80MB (not used, only in commented code)
- faiss-cpu: ~100-200MB (not used in bot/)

This is Phase 1 of container optimization (Quick Wins).
Further optimizations possible:
- OpenCV headless (150-200MB)
- Evaluate Playwright usage (500MB-1GB)
- Alpine base image (1-1.5GB)
- Multi-stage builds (200-400MB)
This commit is contained in:
2026-02-15 20:56:25 +02:00
parent 8d09a8a52f
commit 33e5095607
2 changed files with 4 additions and 9 deletions

View File

@@ -1,10 +1,6 @@
discord.py
aiohttp
requests
langchain-core
langchain-text-splitters
faiss-cpu
langchain-community
aiofiles
apscheduler
fastapi
@@ -17,9 +13,7 @@ python-multipart
Pillow
opencv-contrib-python
numpy
scikit-learn
transformers
torch
PyNaCl>=1.5.0
websockets>=12.0
discord-ext-voice-recv