From 7398983350c422dbf91323f84abbe1f4a3bc1f10 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 25 Apr 2026 18:58:59 +0900 Subject: [PATCH] fix: use 127.0.0.1 instead of localhost for local provider base URLs (#73) On dual-stack hosts (notably macOS), `localhost` resolves to both ::1 and 127.0.0.1 with IPv6 tried first. Local LLM servers (Ollama, vLLM, LM Studio) installed via the standard scripts bind IPv4 only, so the IPv6 connection attempt fails immediately and Happy Eyeballs fallback to IPv4 isn't reliably triggered for connection-refused errors, producing spurious "Configured local provider offline" warnings in the daemon even when the server is up and reachable via curl. Companion to librefang/librefang#3112 which fixes the hardcoded URL constants in the main repo. After both land, existing installs pick up the fix on their next registry sync. --- providers/lmstudio.toml | 2 +- providers/ollama.toml | 2 +- providers/vllm.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/lmstudio.toml b/providers/lmstudio.toml index c1dcf0c..aec8e70 100644 --- a/providers/lmstudio.toml +++ b/providers/lmstudio.toml @@ -5,7 +5,7 @@ id = "lmstudio" display_name = "LM Studio" api_key_env = "LMSTUDIO_API_KEY" -base_url = "http://localhost:1234/v1" +base_url = "http://127.0.0.1:1234/v1" key_required = false [[models]] diff --git a/providers/ollama.toml b/providers/ollama.toml index a1049a1..0cbb68c 100644 --- a/providers/ollama.toml +++ b/providers/ollama.toml @@ -5,7 +5,7 @@ id = "ollama" display_name = "Ollama" api_key_env = "OLLAMA_API_KEY" -base_url = "http://localhost:11434/v1" +base_url = "http://127.0.0.1:11434/v1" key_required = false [[models]] diff --git a/providers/vllm.toml b/providers/vllm.toml index 36397dc..12ce8b1 100644 --- a/providers/vllm.toml +++ b/providers/vllm.toml @@ -5,7 +5,7 @@ id = "vllm" display_name = "vLLM" api_key_env = "VLLM_API_KEY" -base_url = "http://localhost:8000/v1" +base_url = "http://127.0.0.1:8000/v1" key_required = false [[models]]