Fix 1 — AttributeError: 'AgentSession' object has no attribute 'room'
In LiveKit Agents v1.5+, context.session is an AgentSession.
It does not have a .room attribute. The room is only available in entrypoint
via ctx.room.name.
Solution: room_name is now passed as a constructor argument to every agent class
and stored as self.room_name. No more reliance on context.session.room.
Fix 2 — 500 errors on GET /sessions/{id}
The livekit.api.LiveKitAPI constructor changed in newer versions.
Replaced with the correct AccessToken + VideoGrants pattern that works
with livekit>=0.17. Also fixed the update endpoint to not 404 when the agent
pushes before the frontend polls — it now logs a warning and returns gracefully.
Fix 3 — model "qwen3:32b" not found
Ollama cloud model names differ from local names. Default changed to llama3.1
which is stable and well-supported on Ollama cloud.
Fix 4 — silero deprecation warning
livekit-plugins-silero is deprecated in v1.5+. VAD is now bundled inside
AgentSession automatically. Removed the explicit vad=silero.VAD.load() arg
and the silero import entirely.
main.py FastAPI — session management + LiveKit token generation (fixed)
agent.py Voice agent — three agents, room_name fix applied (fixed)
tools.py Dispatch tools — unchanged
escalation.py Escalation logic — unchanged
requirements.txt
.env.development
.env.production
python -m venv venv
source venv/bin/activate # Mac/Linux
# venv\Scripts\activate # Windows
pip install -r requirements.txt
cp .env.development .env
# Fill in LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET,
# DEEPGRAM_API_KEY, OLLAMA_API_KEY# Terminal 1
uvicorn main:app --reload --port 8000
# Terminal 2
python agent.py devllama3.1 ← default, recommended
llama3.2
mistral
Do NOT use qwen3:32b — that format is for local Ollama only.
On Ollama cloud check available models at ollama.com/library.
Service 1 — FastAPI:
uvicorn main:app --host 0.0.0.0 --port $PORT
Service 2 — Agent worker:
python agent.py start
Add all vars from .env.production to both services.
Set BACKEND_URL in Service 2 to the Railway URL of Service 1.