Custom LLM endpoint
The Custom OpenAI-compatible card in Building Settings → AI Assistant → Add LLM connects the Copilot to any server that speaks the OpenAI chat dialect: vLLM, LiteLLM, LM Studio, OpenRouter, Together, Fireworks, a corporate gateway in front of any of them. The named cards (OpenAI, DeepSeek, Groq, Mistral, Ollama, …) use the same adapter with a base URL filled in; pick Custom when your endpoint is not on the list.
What the endpoint must provide
POST {baseUrl}/chat/completionsin the OpenAI request and response shape, includingtoolsin the request andtool_callsin the response. The Copilot drives the building through tool calls, so a model that cannot call functions answers questions but never acts.GET {baseUrl}/modelsis what Test connection tries first. If it returns 404 or 405, the test falls back to a one-token completion, so gateways without a models endpoint still pass.- Reachability from the platform. Requests leave from the API server that runs
tv-api, not from your browser. A model on your laptop or in a private subnet has to be routable from that cluster;localhostin the base URL means the API server itself.
Filling in the card
| Field | What to enter |
|---|---|
| Base URL | The API root, without a trailing slash and without /chat/completions: https://llm.example.com/v1, http://vllm.internal:8000/v1. The platform appends the path. |
| Model | The exact model id the server expects (meta-llama/Llama-3.3-70B-Instruct, qwen2.5:14b). The custom card has no curated list; the server's /models response tells you what it serves. |
| API key | Whatever the server expects in Authorization: Bearer …. Leave it empty for endpoints that need none; the platform then sends a placeholder token, which your gateway must not reject. |
Then Test connection. The wizard runs the same probe the platform will run later and shows the error code if it fails, with the server's own message when it sent one.
Beyond the card
Some things the wizard does not expose are available when a config is created over the API (POST /api/v1/buildings/:buildingId/llm-configs):
extraHeaders— a map of extra request headers, sent on every call and on the connection test. Use it for gateways that authenticate with a header other thanAuthorization(Azure OpenAI'sapi-key) or that route by a tenant header.- Several configs per building — save more than one and mark one as the building's default; the Copilot uses the default and the others stay ready to switch to.
When it fails
The two errors specific to custom endpoints:
MODEL_NOT_FOUNDwith a model you are sure exists usually means the base URL is off by a path segment — the server answered 404 to…/chat/completionsbecause/v1was missing or doubled.PROVIDER_UNREACHABLEon a server you can open in a browser means the platform's network cannot reach it. Check from the cluster, not from your machine.
Everything else — keys, rate limits, timeouts — is in the error reference.