The capture compose.yaml with a model and a gateway
The top-level models element declares llm with model ai/qwen3:4b, and Compose asks Docker Model Runner to pull and configure it. Inside the Compose project m101, the service printer on alpine:3.22 binds llm with endpoint_var LLM_URL and model_var LLM_MODEL and receives LLM_MODEL=ai/qwen3:4b and LLM_URL=http://model-runner.docker.internal/v1/. Its GET of LLM_URL followed by models answers 200 with the model list. The service mcp-gateway runs docker/mcp-gateway with --transport=streaming --port=8811 and use_api_socket true, starts no server, prints a bearer token, and answers the printer request without that token with 401 Unauthorized.
models: llm
model: ai/qwen3:4b
Docker Model Runner
model-runner.docker.internal
pull, configure
COMPOSE PROJECT M101
printer, alpine:3.22
LLM_MODEL=ai/qwen3:4b
LLM_URL=http://model-runner.docker.internal/v1/
endpoint_var, model_var
GET LLM_URL models: 200
mcp-gateway, docker/mcp-gateway
--transport=streaming --port=8811
use_api_socket: true, no server
prints a bearer token, 0 tools
401 Unauthorized
Docker Engine API
the host socket
no server started
API socket