Home Assistant + LiteLLM: Docker gateway setup

Learn to connect Home Assistant to LiteLLM with Docker, PostgreSQL and virtual keys, plus the tutorial's conversation-agent limitation.

Player not loading? Watch on YouTube

This tutorial sets up a self-hosted LiteLLM gateway for Home Assistant. The speaker identifies Home Assistant 2026.8 as the release that adds native integration. The examples use external model APIs, so hosting the gateway locally does not make the demonstrated setup offline.

The Docker configuration maps DeepSeek v4-flash and v4-pro in config.yaml. An OpenAI prefix selects compatible routing, while the API base points to DeepSeek and an environment variable supplies the API key. The compose file runs LiteLLM alongside PostgreSQL, exposes port 4000 and includes a database health check. The speaker uses a master key to sign into the admin interface at /ui.

A virtual key connects Home Assistant to the gateway. The tutorial then creates a conversation agent and assigns it to a voice assistant. In the speaker's chat test, a command turns off a smart plug. The stated limitation is that the integration supports conversation agents but does not yet support AI tasks.

The admin interface also lets users add a custom OpenAI-compatible model without editing configuration files and restrict a dedicated virtual key to one model. The final example enables prompt storage in spend logs. The speaker shows that this exposes the system prompt, user prompt and model response, then raises the privacy question of recording family conversations.