Location
router/main.py (inside sync_adaptive_router_roster, check_http_endpoint, get_dashboard, proxy_memory, proxy_models, etc.)
Problem Description
Core target URLs (LiteLLM at http://127.0.0.1:4000/, Llama.cpp at http://127.0.0.1:8080/health, Langfuse at http://127.0.0.1:3001) are hardcoded directly inside logic checks, reducing deployment agility across varied rootless Podman networks where microservices run on separate hostnames (e.g. http://litellm:4000).
Fix Overview
Extract the endpoint bases into environment variable parameters while assigning safe fallback constants near the top of the file.
Proposed Implementation Steps
- Define global configuration variables near the top of
router/main.py:
LITELLM_URL = os.getenv("LITELLM_ADMIN_URL", "http://127.0.0.1:4000")
LLAMA_SERVER_URL = os.getenv("LLAMA_SERVER_URL", "http://127.0.0.1:8080")
LANGFUSE_URL = os.getenv("LANGFUSE_URL", "http://127.0.0.1:3001")
- Replace all hardcoded occurrences with these constants throughout the file.
Code Example / Diff
@@ -390,3 +390,3 @@
headers = {"Authorization": f"Bearer {master_key}", "Content-Type": "application/json"}
- admin_url = "http://127.0.0.1:4000"
+ admin_url = LITELLM_URL
Location
router/main.py(insidesync_adaptive_router_roster,check_http_endpoint,get_dashboard,proxy_memory,proxy_models, etc.)Problem Description
Core target URLs (LiteLLM at
http://127.0.0.1:4000/, Llama.cpp athttp://127.0.0.1:8080/health, Langfuse athttp://127.0.0.1:3001) are hardcoded directly inside logic checks, reducing deployment agility across varied rootless Podman networks where microservices run on separate hostnames (e.g.http://litellm:4000).Fix Overview
Extract the endpoint bases into environment variable parameters while assigning safe fallback constants near the top of the file.
Proposed Implementation Steps
router/main.py:Code Example / Diff