Skip to content

Custom provider names trigger unexpected outbound lookup to models.dev, causing failures in internet-restricted environments #3165

@sjuanola34

Description

@sjuanola34

Description

When defining a custom provider with an arbitrary name in the Docker Agent configuration, Docker Agent makes outbound HTTP requests to models.dev during model resolution. In network-restricted environments where direct internet access is not allowed, this causes timeouts or significant latency. Renaming the provider to a well-known name (e.g., openai) bypasses this behavior, suggesting that Docker Agent performs an external lookup only for unrecognized provider names.

Expected Behavior

A custom provider defined with a base_url and token_key in the configuration should be used as-is, without any additional external HTTP calls to resolve provider metadata. The configuration should be entirely self-contained and work in air-gapped or internet-restricted environments.

Actual Behavior

When the provider name is not a recognized built-in (e.g., mistral_gateway instead of openai), Docker Agent attempts to reach models.dev to resolve provider or model metadata. In environments where outbound internet access is blocked, this results in connection timeouts and severe latency, making the agent unusable.

Steps to Reproduce

Define a custom provider with a non-standard name in your config.yaml

providers:
  mistral_gateway:
    base_url: https://your-internal-gateway.example.com/v1
    token_key: YOUR_API_KEY
models:
  my_model:
    provider: mistral_gateway
    model: Mistral:mistral-small-latest

Run Docker Agent in an environment where outbound HTTP to the internet (specifically models.dev) is blocked.
Observe connection timeouts or high latency when Docker Agent starts or processes the first request.

time=2026-06-18T15:35:53.095Z level=DEBUG msg="Failed to get model definition" error="failed to fetch from API and no cached data available: failed to fetch from API: Get \"https://models.dev/api.json\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"

Rename the provider from mistral_gateway to openai (keeping base_url and token_key identical) and restart.
Observe that the agent starts and responds correctly with no external calls.

Environment

Docker Agent Version:
docker-agent version v1.79.0
Commit: a2c0cc8
OS & Terminal: Kubernetes pod
Model Used: Mistral:mistral-small-latest (via internal Gravitee API Gateway proxying Mistral)
A clear and concise description of what the bug is.

Metadata

Metadata

Assignees

Labels

area/configFor configuration parsing, YAML, environment variablesarea/providersFor features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.)

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions