Skip to content

Fix default endpoint URLs to use host.docker.internal#1645

Merged
akwasigroch merged 1 commit intomainfrom
fix/docker-endpoint-defaults
Apr 15, 2026
Merged

Fix default endpoint URLs to use host.docker.internal#1645
akwasigroch merged 1 commit intomainfrom
fix/docker-endpoint-defaults

Conversation

@akwasigroch
Copy link
Copy Markdown
Collaborator

Purpose

When Rhesis backend runs inside Docker, localhost and 0.0.0.0 in endpoint URLs refer to the container itself, not the host machine. Users running Ollama, LiteLLM, or vLLM on their host need host.docker.internal to reach those services from inside the container. The previous defaults were inconsistent — Ollama already used host.docker.internal, but vLLM used localhost and LiteLLM used 0.0.0.0.

What Changed

  • Default endpoints: Updated vLLM (localhost:8000host.docker.internal:8000) and LiteLLM proxy (0.0.0.0:4000host.docker.internal:4000) to use host.docker.internal, matching Ollama
  • Helper text: Replaced generic endpoint descriptions for Ollama and LiteLLM with a clear explanation: "When Rhesis runs in Docker, use host.docker.internal instead of localhost to reach [service] on your machine"

Testing

  • Open the model connection dialog for Ollama, LiteLLM proxy, and vLLM providers
  • Verify the default endpoint URL pre-fills with host.docker.internal
  • Verify the helper text explains the Docker networking context

Update default endpoint URLs for Ollama, vLLM, and LiteLLM proxy to use
host.docker.internal instead of localhost/0.0.0.0, since the backend runs
in Docker and cannot reach host services via localhost. Also improve
helper text to explain why the non-obvious hostname is needed.
Copy link
Copy Markdown

@peqy peqy bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaults now consistently use host.docker.internal for Docker networking 👍. I left two small notes about non-Docker resolution/fallback and keeping the Docker helper text consistent across providers.

helperText={
provider?.type_value === 'ollama'
? 'The URL where Ollama is running (default: http://host.docker.internal:11434)'
? 'When Rhesis runs in Docker, use host.docker.internal instead of localhost to reach Ollama on your machine'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement: These helpers (and the new defaults) are Docker-centric, but when running Rhesis outside Docker host.docker.internal may not resolve. Consider mentioning the non-Docker case too (e.g., “If running Rhesis locally, use http://localhost:…”), and adding the same Docker hint for vllm for consistency.

ollama: 'http://host.docker.internal:11434',
vllm: 'http://localhost:8000',
litellm_proxy: 'http://0.0.0.0:4000',
vllm: 'http://host.docker.internal:8000',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Any concern about host.docker.internal not resolving on some Linux setups (outside your provided docker-compose that uses extra_hosts: host-gateway)? If so, we might want a note in docs/UI or an env-based default fallback to localhost when not in Docker.

@akwasigroch akwasigroch merged commit 83ce887 into main Apr 15, 2026
10 of 11 checks passed
@akwasigroch akwasigroch deleted the fix/docker-endpoint-defaults branch April 15, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant