Skip to content

[LHF-03] Hardcoded Microservice Endpoint Bindings #43

Description

@sheepdestroyer

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

  1. 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")
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dockerPRs that update Docker/Container configurationsenhancementNew feature or requestjulesIssues for Jules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions