Host Model Access
A language model can run on your machine, outside Docker, in a server such as Ollama, LM Studio or llama.cpp's server. The services of the stack that run your code or call a model reach that server at host.docker.internal, and read its address from LLM_BASE_URL. The model server stays on the host because containers on macOS cannot use the Mac's GPU, and GPU access in containers differs by platform. Any server with an OpenAI-compatible API works. The end-to-end tests run the commands below on every release, against a small stand-in server on the runner.
This guide builds on Getting Started.

Run a Model Server on the Host
| Server | Address on the host | Listens on by default | To listen beyond 127.0.0.1 |
|---|---|---|---|
| Ollama | http://localhost:11434/v1 |
127.0.0.1:11434 |
OLLAMA_HOST=0.0.0.0:11434 (FAQ) |
| LM Studio | http://localhost:1234/v1 |
127.0.0.1 |
lms server start --bind 0.0.0.0 (CLI) |
| llama.cpp server | http://localhost:<port>/v1 |
127.0.0.1 |
--host 0.0.0.0 |
On Linux, and on Docker Engine inside WSL2, a container reaches the host through Docker's bridge address, so a server that listens only on 127.0.0.1 cannot be reached. Make it listen on 0.0.0.0. Ollama runs as a systemd service on Linux:
| docs/snippets/local-models/commands.sh:ollama-linux | |
|---|---|
On macOS, Ollama runs as an application:
| docs/snippets/local-models/commands.sh:ollama-macos | |
|---|---|
A server on 0.0.0.0 also accepts connections from your local network. Keep the host's firewall closed to it if that matters on your network.
Set It Up for Your Platform
odctl init writes three keys to .odctl/.env:
LLM_BASE_URLis the server's OpenAI-compatible base URL as the containers reach it. It ishttp://host.docker.internal:11434/v1by default, Ollama's address.LLM_MODELis the model the services call when the code does not name one, such as Trino'saicatalog. It isllama3.2by default; Call the Model from a Container sets it to a model your server has.ODCTL_HOST_GATEWAYis empty by default. Set it totruewhere Docker does not resolvehost.docker.internalby itself. odctl then addshost.docker.internal:host-gatewayto the services that call the server, and to no other.
| Platform | Engine | Set ODCTL_HOST_GATEWAY |
Tested | What the vendor's docs say |
|---|---|---|---|---|
| macOS | OrbStack | No; true also works |
Yes, with Ollama on 127.0.0.1 |
host.docker.internal reaches a server on the Mac (OrbStack) |
| macOS | Docker Desktop | No | Not tested | host.docker.internal resolves to the host (Docker Desktop) |
| macOS | Colima | Not known | Not tested | Colima's FAQ does not say how a container reaches the host |
| Linux | Docker Engine 20.10.0 or later | Yes | Yes, in the end-to-end tests | host-gateway in --add-host maps a name to the host (Docker Engine) |
| Linux | Docker Desktop for Linux | No | Not tested | As Docker Desktop on macOS |
| WSL2 | Docker Desktop | No | Not tested | As Docker Desktop on macOS |
| WSL2 | Docker Engine inside the distribution | Yes | Not tested | As Docker Engine on Linux; Windows is a separate host, as below (WSL networking) |
With Docker Engine inside WSL2, host.docker.internal is the WSL2 virtual machine, so it reaches a server that runs inside the distribution. A server on Windows is reached at another address. In WSL2's default NAT mode it is the Windows host's address, which ip route show | grep -i default | awk '{ print $3}' prints inside the distribution (WSL networking); put that address in LLM_BASE_URL, and make the server listen on 0.0.0.0. Langfuse admits a private address only when its host is listed, so for Langfuse also add LANGFUSE_LLM_CONNECTION_WHITELISTED_HOST="host.docker.internal,<that address>" to .odctl/.env (a comma-separated list) and run odctl recreate langfuse.
Turn the flag on:
| docs/snippets/local-models/commands.sh:gateway-flag | |
|---|---|
For a server other than Ollama, change the address, here to LM Studio's port. With Docker Engine inside WSL2 and the server on Windows, keep the Windows address from above in place of host.docker.internal:
| docs/snippets/local-models/commands.sh:base-url | |
|---|---|
A change to any of the keys reaches a running service when it is recreated, for example with odctl recreate airflow. A server that needs an API key is not supported.
Check the Connection
odctl check llm starts a short-lived alpine:3.24 container on the odctl network, the way the stack's services run, and requests <LLM_BASE_URL>/models:
| docs/snippets/local-models/commands.sh:check | |
|---|---|
It prints the models the server lists. When the request fails, it names the cause and what to change:
| Failure | Cause |
|---|---|
| The host name does not resolve | Docker does not resolve host.docker.internal: set ODCTL_HOST_GATEWAY=true. For another name, correct LLM_BASE_URL |
The connection failed and LLM_BASE_URL names localhost or 127.0.0.1 |
In a container that is the container itself: use host.docker.internal |
| The connection was refused | The server is not running, or listens only on 127.0.0.1 |
| No reply within 5 seconds | A firewall on the host drops connections from Docker's network |
| No complete reply within 30 seconds | The server keeps sending without finishing the model list, so check the server's own logs |
| The server answered an HTTP error | LLM_BASE_URL has the wrong path; it usually ends in /v1 |
Call the Model from a Container
These services get LLM_BASE_URL and LLM_MODEL, and the host gateway when the flag is on:
airflow;spark-master, wherespark-sqlandspark-submitrun the driver, and the Spark workers;- the Flink
jobmanager, where the SQL client and job clients run, and the task managers; mlflowandmlflow-serve;langfuse-webandlangfuse-worker;trino, for itsaicatalog;metabase, for its AI features, which getsLLM_BASE_URLonly, because Metabase picks the model in its own settings.
Start Airflow. If it was already running when you changed .env, run odctl recreate airflow instead, so that it gets the new keys:
From the airflow container, the server lists its models:
| docs/snippets/local-models/commands.sh:container | |
|---|---|
A task reads the address and the model from the environment and calls the chat API. This function uses only Python's standard library, so it runs in any of those containers that has Python, such as airflow; metabase has no LLM_MODEL:
Make the first model the server lists the default in .env, so that it is set in MODEL and in LLM_MODEL:
Save the function as llm_task.py and run it once in the airflow container:
| docs/snippets/local-models/commands.sh:task | |
|---|---|
It prints the model's reply. In a DAG, call ask from a task, as Airflow DAGs from S3 shows for any task. Run odctl recreate airflow first, so that the DAG's tasks read the new LLM_MODEL.
Use the Model in Langfuse
Langfuse's Playground and its LLM-as-a-judge evaluations call a model through an LLM connection. Langfuse refuses a connection to a private address unless its host is listed, so the profile lists host.docker.internal in LANGFUSE_LLM_CONNECTION_WHITELISTED_HOST. Start Langfuse, or recreate it if it was running when you changed .env:
Create the connection through Langfuse's public API, with the MODEL set above:
The connection is named host and offers only that model:

Langfuse covers the rest of the profile.
Use the Model in MLflow
MLflow's AI Gateway can route an endpoint to the server on the host. Call a Model on the Host in the MLflow guide creates one.
Use the Model in Trino
Trino's catalog ai, in .odctl/trino/catalog/ai.properties, gives SQL functions such as ai_gen, ai_classify and ai_translate in its ai schema (AI functions). Each call sends a chat request to the server on the host. Trino adds /v1/chat/completions to the catalog's endpoint, so the trino service passes LLM_BASE_URL without its /v1. The catalog reads its model from LLM_MODEL. If Trino is not running, start it with odctl up trino, which reads the new .env; odctl recreate does not start the profiles Trino needs. If it is running, recreate it after the change to .env above:
| docs/snippets/local-models/commands.sh:trino-model | |
|---|---|
Then call the model from SQL:
| docs/snippets/local-models/commands.sh:trino | |
|---|---|
It prints the model's reply. The access rules in .odctl/trino/rules.json let every user run the functions of ai.ai, and no other catalog's functions. Trino and Metabase covers the rest of the profile.
Use the Model in Metabase
The metabase service sets MB_LLM_VLLM_API_BASE_URL to LLM_BASE_URL, so Metabase's admin AI settings list a vLLM connection to the server, with the models it lists. Metabase's vLLM provider works with any OpenAI-compatible server. Metabase refuses an LLM on a private or local address by default, so the service also sets MB_LLM_ALLOWED_NETWORKS=allow-all. Metabot needs a model that calls tools: Metabase's vLLM provider checks for tool calls and for a context window of at least 16,384 tokens, so a small model may not pass. The end-to-end tests check that Metabase lists the server's models; they do not run Metabot.
With qwen3.8:27b-mlx on Ollama, Metabot built a count query on the sample ORDERS table in about two minutes. The query returns 18,760, but the model's reply says 4,000, so read the number from the query result, not from the reply:
