chore: subdirectory routing, configurable domain, and deployment guidelines (PR #242 fixes)#243
chore: subdirectory routing, configurable domain, and deployment guidelines (PR #242 fixes)#243sheepdestroyer wants to merge 19 commits into
Conversation
…tions in AGENTS.md
…vironment variable
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
… single x570.vendeuvre.lan domain
…leak / TLS bypass
…up false failures
…al_host/port resolution, fix agy startup SSH commands
…uccess endpoints, nohup stdin redirect)
…add fallbacks, avoid duplicate variables)
…PLACEHOLDER, HOME_PLACEHOLDER, and RUN_USER_PLACEHOLDER
…g subpath if missing
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideImplements subdirectory-aware routing and configurable public/local base URLs, wires LiteLLM behind HAProxy with SERVER_ROOT_PATH/PROXY_BASE_URL, hardens hostname/domain handling in the dashboard, restores portable pod.yaml templating, re-enables the local-qwen-3.6 model, and adds a concrete production deployment checklist for the Sequence diagram for subdirectory-aware dashboard routingsequenceDiagram
actor User
participant HAProxy
participant Router as FastAPI_Router
User->>HAProxy: HTTPS GET /llm-routing/dashboard
HAProxy->>Router: GET /dashboard
Router->>Router: get_dashboard(request)
alt BASEURL or BASE_URL set
Router->>Router: urlparse(external_host_env)
Router->>Router: validate external_host, external_netloc
else no external host env
Router->>Router: use request.base_url
Router->>Router: validate hostname/netloc
end
Router->>Router: domain = ROUTING_DOMAIN or vendeuvre.lan
alt external host in ROUTING_DOMAIN
Router->>Router: langfuse_url = https://external_netloc/llm-routing/langfuse
Router->>Router: litellm_url = https://external_netloc/llm-routing/litellm/ui
Router->>Router: llama_url = https://external_netloc/llm-routing/llama/
else base_url in ROUTING_DOMAIN
Router->>Router: base = scheme://netloc
Router->>Router: langfuse_url = base + /llm-routing/langfuse
Router->>Router: litellm_url = base + /llm-routing/litellm/ui
Router->>Router: llama_url = base + /llm-routing/llama/
else fallback (non-matching domain)
Router->>Router: langfuse_url = http://external_host:3001
Router->>Router: litellm_url = http://external_host:4000/ui
Router->>Router: llama_url = http://external_host:8080
end
Router->>Router: get_dashboard_data()
Router-->>HAProxy: HTML dashboard (links use langfuse_url, litellm_url, llama_url)
HAProxy-->>User: HTML response
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
get_dashboardhandler is introducing another set of URL/domain env vars (BASEURL/BASE_URL/ROUTING_DOMAIN) whilestart-stack.shnow derives a normalizedPUBLIC_BASE_URL; consider centralizing this base URL/domain resolution into a single helper or env convention to avoid subtle drift between shell and Python logic. - In
get_dashboard, the logic that parses and validatesexternal_host_envandrequest.base_url(hostname/netloc, scheme) is fairly involved and duplicated in branches; extracting this into a small utility (e.g.,resolve_external_base(request)) would make the routing rules easier to reason about and safer to evolve.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `get_dashboard` handler is introducing another set of URL/domain env vars (`BASEURL`/`BASE_URL`/`ROUTING_DOMAIN`) while `start-stack.sh` now derives a normalized `PUBLIC_BASE_URL`; consider centralizing this base URL/domain resolution into a single helper or env convention to avoid subtle drift between shell and Python logic.
- In `get_dashboard`, the logic that parses and validates `external_host_env` and `request.base_url` (hostname/netloc, scheme) is fairly involved and duplicated in branches; extracting this into a small utility (e.g., `resolve_external_base(request)`) would make the routing rules easier to reason about and safer to evolve.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request updates the LLM Routing project by replacing hardcoded user paths with generic placeholders across configuration files (such as pod.yaml, README.md, and start-stack.sh) to support flexible deployments. It re-enables the local-qwen-3.6 model in LiteLLM, updates the free models roster, and enhances the router dashboard to dynamically resolve and validate base URLs with strict domain validation. Additionally, it adds a production deployment checklist and GitHub operations policy to the agent documentation. No review comments were provided, so there is no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…tilizing PUBLIC_BASE_URL
This PR resolves review comments from PR #242, syncs recent production changes from
boy, and introduces subdirectory proxy routing.Key Changes
/llm-routing/litellm,/llm-routing/langfuse, and/llm-routing/llama/subdirectories depending on request headers/domain.SERVER_ROOT_PATHand addedPROXY_BASE_URLbehind HAProxy.ROUTING_DOMAINenv variable inrouter/main.py(default:vendeuvre.lan).livenessProbeandreadinessProbeto use direct in-pod endpoints (/pingand/health/readiness) rather than the reverse proxy paths.boy:local-qwen-3.6model on port8081inlitellm/config.yaml.boy.ssh boyprefixes.Addressed PR #242 Review Fixes:
PUBLIC_BASE_URLslash normalization: StandardizedPUBLIC_BASE_URLandLOCAL_BASE_URLto trim any trailing slash, preventing double slashes (e.g.//v1) in concatenations.pod.yamlplaceholders: Reverted all hardcoded path (/mnt/DATA/boy/...) and user ID (1002) bindings back to genericWORKDIR_PLACEHOLDER,HOME_PLACEHOLDER, andRUN_USER_PLACEHOLDERtemplates, ensuring portability across multiple environments and restoring proper validation.start-stack.shright after environment file loading.local-qwen-3.6model in the fallback chains./home/gpav/...) fromREADME.mdand comments.Summary by Sourcery
Introduce subdirectory-aware routing and environment-driven public URLs while sanitizing deployment templates and documentation for portability.
New Features:
Bug Fixes:
Enhancements:
Documentation: