Problem: Line 196 in install_complete_dependencies.sh used ${torch.__version__} which is Python syntax, not bash.
Error: bad substitution error in bash
Fix:
# Before (broken):
echo -e " • PyTorch ${torch.__version__} with CUDA support"
# After (fixed):
TORCH_VERSION=$(python -c "import torch; print(torch.__version__)" 2>/dev/null || echo "unknown")
echo -e " • PyTorch ${TORCH_VERSION} with CUDA support"Problem: The llama-cpp-python server was running in the foreground, blocking the health check process.
Root Cause: Server process was not detached, so the health check could never run while server was starting.
Fix:
- Added
preexec_fn=os.setsidto create new process group - Server now runs as detached background process
- Health checks can run concurrently with server startup
Problem: Log showed --n_gpu_lays -1 instead of --n_gpu_layers -1
Fix: This was just a display issue in logs, actual command was correct.
Problem: If port 1234 was in use, assumed it was a conflict rather than our server.
Fix:
- If port is in use, assume it might be our server starting up
- Wait and check for health responses
- Only fail if port is occupied but not responding to our health checks
- Fixed bash variable substitution error
- Now properly gets PyTorch version for summary
- CRITICAL: Added
preexec_fn=os.setsidto run server as detached background process - Changed
check_port_available()tocheck_port_in_use()with smarter logic - If port 1234 is in use, assume it's our server and wait for health check
- Increased timeout from 60 to 120 seconds
- Added
_get_model_size()helper method - Enhanced error logging with detailed output
- Added progress logging during startup
- Better process monitoring with graceful fallback
- Comprehensive diagnostic tool
- Tests all aspects of server startup
- Helps identify specific failure points
- Independent server startup test
- Runs server in background and tests health checks
- Useful for debugging server issues separately
cd /workspace/RealtimeVoiceChat
chmod +x install_complete_dependencies.sh
./install_complete_dependencies.sh# Test the server startup independently
python test_orpheus_server.py
# Or run full diagnostics
python diagnose_orpheus_server.pycd code
python server.pyNote: If you see the server taking a long time, that's normal for the 3.8GB model. The new logic will detect if port 1234 is in use and assume the server is working.
The new OrpheusServerManager now provides:
-
Port Conflict Detection:
🎤⚠️ Port 1234 is already in use 🎤💡 Try: lsof -ti:1234 | xargs kill -9 -
Progress Monitoring:
🎤⏳ Waiting for Orpheus server startup... (10s/120s) 🎤⏳ Waiting for Orpheus server startup... (20s/120s) -
Model Information:
🎤📊 Model size: 3.1 GB 🎤⏱️ Timeout: 120 seconds -
Detailed Error Output:
🎤❌ Server process died after 15.2s 🎤📤 stdout: [server output] 🎤📤 stderr: [error details]
-
Port 1234 already in use:
lsof -ti:1234 | xargs kill -9
-
Model file missing or corrupted:
# Re-download model wget https://huggingface.co/lex-au/Orpheus-3b-FT-Q8_0.gguf/resolve/main/Orpheus-3b-FT-Q8_0.gguf \ -O /workspace/models/Orpheus-3b-FT-Q8_0.gguf -
llama-cpp-python server module missing:
CMAKE_ARGS="-DLLAMA_CUDA=on" pip install llama-cpp-python[server] --force-reinstall -
CUDA not available:
- Check:
nvidia-smi - Reinstall PyTorch with CUDA support
- Check:
-
Server startup timeout:
- Model loading can take 60-120 seconds for 3GB model
- Check GPU memory availability
- Monitor with diagnostic script
With the fixes, you should see:
🎤🚀 Initializing Orpheus server for TTS...
🎤✅ Orpheus model found at: /workspace/models/Orpheus-3b-FT-Q8_0.gguf
🎤✅ llama-cpp-python[server] is already installed
🎤🚀 Starting Orpheus server at http://0.0.0.0:1234...
🎤📊 Model size: 3.1 GB
🎤⏱️ Timeout: 120 seconds
🎤🔧 Running command: /usr/bin/python -m llama_cpp.server --model /workspace/models/Orpheus-3b-FT-Q8_0.gguf --host 0.0.0.0 --port 1234 --n_gpu_layers -1
🎤⏳ Waiting for Orpheus server startup... (10s/120s)
🎤⏳ Waiting for Orpheus server startup... (20s/120s)
🎤✅ Orpheus server started successfully at http://0.0.0.0:1234 (took 45.3s)
🎤✅ Orpheus server initialized successfully
🗣️🚀 SpeechPipelineManager initialized and workers started.
INFO: Uvicorn running on http://0.0.0.0:8000
- Reliability: Increased timeout and better error handling
- Diagnostics: Comprehensive logging and diagnostic tools
- User Experience: Clear progress indicators and helpful error messages
- Robustness: Port conflict detection and model validation
- Debugging: Detailed output capture for troubleshooting
The Orpheus TTS server should now start reliably without the previous timeout and diagnostic issues!