Redis-backed FastAPI service providing text and optional voice chat for the Cutter project.
- Create and activate a virtual environment
python -m venv .venv source .venv/bin/activate - Install dependencies
pip install -r requirements.txt
- Configure environment
Fill in the values (OpenAI key, Redis URL, helplines, etc.).
cp .env.example .env
- Run the server
uvicorn main:app --reload
OPENAI_API_KEYOPENAI_CHAT_MODELREDIS_URL(use rediss:// for TLS)ALLOWED_ORIGINSVOICE_ALLOWEDNA_HELPLINE_UKEMERGENCY_UKSESSION_TTL_SECONDSRATE_LIMIT_PER_MINUTELOG_LEVEL
The service stores sessions and user memory in Redis. Use Redis Cloud or another managed instance. For local development the tests use fakeredis.
Run the test suite with:
pytestOn Render, set main:app as the entry point and configure environment variables in the dashboard. Provide a TLS Redis URL and OpenAI key.
web/js/cutter-client.js offers minimal helpers for the WordPress frontend to call the API.