chore: subdirectory and subdomain routing configuration#247
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors the stack startup and pod templating logic to parameterize LiteLLM and Langfuse URLs/root paths via environment variables, replacing hard‑coded routing configuration and updating healthcheck and NextAuth settings to support both subdirectory and subdomain layouts. Flow diagram for templated routing configuration in pod startupflowchart TD
A[start-stack.sh] --> B[set env PUBLIC_BASE_URL LOCAL_BASE_URL]
A --> C[set env LITELLM_PUBLIC_URL LANGFUSE_PUBLIC_URL LITELLM_ROOT_PATH]
B --> D[render_pod_yaml]
C --> D
D --> E[replace PROXY_BASE_URL_PLACEHOLDER with LITELLM_PUBLIC_URL]
D --> F[replace NEXTAUTH_URL_PLACEHOLDER with LANGFUSE_PUBLIC_URL]
D --> G[replace SERVER_ROOT_PATH_PLACEHOLDER with LITELLM_ROOT_PATH]
D --> H[write pod.yaml]
H --> I[LiteLLM container uses SERVER_ROOT_PATH PROXY_BASE_URL]
H --> J[Langfuse/NextAuth uses NEXTAUTH_URL]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesPlaceholder-based pod.yaml rendering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The default values for LITELLM_PUBLIC_URL and LANGFUSE_PUBLIC_URL are hardcoded to a specific internal domain, which may be surprising for other environments; consider leaving them unset or using generic/localhost defaults so misconfiguration is more obvious.
- NEXTAUTH_URL_PLACEHOLDER is currently populated from LANGFUSE_PUBLIC_URL, which couples the two concepts; consider introducing a dedicated NEXTAUTH_URL environment variable to avoid unintended cross-dependence.
- The liveness probe was changed from /ping to /health/liveness; double-check that this path is stable and version-independent for the Litellm image to avoid unexpected startup failures if the upstream health endpoints change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The default values for LITELLM_PUBLIC_URL and LANGFUSE_PUBLIC_URL are hardcoded to a specific internal domain, which may be surprising for other environments; consider leaving them unset or using generic/localhost defaults so misconfiguration is more obvious.
- NEXTAUTH_URL_PLACEHOLDER is currently populated from LANGFUSE_PUBLIC_URL, which couples the two concepts; consider introducing a dedicated NEXTAUTH_URL environment variable to avoid unintended cross-dependence.
- The liveness probe was changed from /ping to /health/liveness; double-check that this path is stable and version-independent for the Litellm image to avoid unexpected startup failures if the upstream health endpoints change.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 pod.yaml and start-stack.sh to introduce configurable public URLs and root paths for LiteLLM and Langfuse, replacing hardcoded values with placeholders and dynamic environment variables. Additionally, the liveness probe endpoint for LiteLLM was updated to /health/liveness. Feedback on these changes suggests dynamically referencing the ROUTING_DOMAIN variable in the default values of LITELLM_PUBLIC_URL and LANGFUSE_PUBLIC_URL to avoid hardcoding the domain name.
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.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This PR refactors the routing configuration to cleanly support both subdirectory-based and subdomain-based routing layouts for LiteLLM and Langfuse. It dynamically templates NextAuth URL, LiteLLM root path, and base URL settings using environment variables, avoiding hardcoding in pod templates.
Summary by Sourcery
Configure routing to support environment-driven subdirectory and subdomain setups for LiteLLM and Langfuse.
Enhancements:
Summary by CodeRabbit