Migrate voice server from Flask to FastAPI + uvicorn #2
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/minerva#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Both
voice_server.pyandvoice_server_enhanced.pyuse Flask. CF convention is FastAPI + uvicorn. Flask's dev server is single-threaded and not production-safe for concurrent audio uploads.Specific issues with current Flask code
app.run(debug=False)is Flask's dev server — not production-safeBadRequestexceptions raised manually; FastAPI handles with 422 + Pydantic validation/wake-word/detectionspoll endpoint would be better as WebSocket or SSE (awkward in Flask)global whisper_model,global ha_client) needs to become dependency-injected instances — easier to wire in FastAPIMigration approach
run_in_executor(non-blocking)BadRequestwith Pydantic request modelsReferences