docs: add External LLM Gateways integration page - #702
Open
rajshah4 wants to merge 2 commits into
Open
Conversation
… with attribution recipes Add a new Integrations page covering how to chain the OpenHands Enterprise built-in LiteLLM to an external LLM gateway (LiteLLM or Bifrost). Includes gateway chaining setup, multi-model patterns (explicit per-model entries vs wildcard passthrough), a verified capability matrix, and five attribution recipes (per-team keys, per-profile extra_headers, static custom_llm_extra_headers, LiteLLM spend-log metadata, conversation tags). Key finding documented: LLM.extra_headers is already a first-class field on every OHE LLM profile, making per-user attribution workable today (one profile per user) without waiting on OSS-4865. Co-authored-by: openhands <openhands@all-hands.dev>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…egrations list Co-authored-by: openhands <openhands@all-hands.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new Integrations page covering how to chain the OpenHands Enterprise built-in LiteLLM to an external LLM gateway (LiteLLM or Bifrost).
enterprise/integrations/external-llm-gateways.mdxenterprise/integrations/external-llm-gatewaysto the Enterprise → Integrations group indocs.jsonWhy
Many customers already run an LLM gateway (LiteLLM, Bifrost, or a similar OpenAI-compatible proxy) to route, rate-limit, audit, and track cost across multiple LLM providers. OHE ships with its own built-in LiteLLM instance, and that built-in instance can forward requests to the customer's existing gateway instead of calling LLM providers directly. This guide documents how to set that up and how to attribute traffic per team or per user as it flows through both gateways.
How it works
OHE does not point the OpenHands runtime directly at an external gateway. The built-in LiteLLM forwards requests to the external gateway, which in turn forwards to the actual LLM provider:
The doc covers:
provider/modelnaming Bifrost requires.extra_headers, staticcustom_llm_extra_headers, LiteLLM spend-log metadata, and batch reconciliation with conversation tags.x-litellm-session-idheader.Key finding documented in the attribution section:
LLM.extra_headersis already a first-class field on every OHE LLM profile, exposed in the UI under Settings > LLM > Advanced Options. The SDK forwards it to LiteLLM on every call. Withforward_client_headers_to_llm_api: trueon the built-in LiteLLM, any header starting withx-reaches the upstream gateway. This makes per-user attribution workable today (one profile per user with the user ID inextra_headers) without waiting on OSS-4865, which is the long-term fix for scaling without per-user profile duplication.The doc uses the same Mintlify components (
Info,Warning,Note,Tabs/Tab,AccordionGroup/Accordion) and voice as the existing enterprise integration pages (azure-devops,slack,external-postgres).Verification status
Each link in the chain is verified independently on a self-hosted Replicated cluster:
extra_headersfield exposed on the LLM profile schema in the OHE app and persists through the profile API round-trip.llm.extra_headersto LiteLLM on every call (code inspection:openhands-sdk/openhands/sdk/llm/options/common.py).x-*headers to the upstream gateway whenforward_client_headers_to_llm_api: true(end-to-end with a capture service standing in for the upstream gateway).One gap: a single end-to-end capture from a real OHE conversation was blocked by an unrelated LiteLLM virtual-key issue (401 after pod restart wiped the verification token cache). Each link in the chain is verified independently. Filed as a follow-up.
Notes
custom_llm_extra_headersrecipe references the setting shipped in OpenHands-Cloud#669. It is available now; provider-agnostic static headers are tracked in draft PR OpenHands-Cloud#674.Style constraints
No em dashes, no en dashes, no "e.g." or "i.e." (uses "for example"), no HTML tags. Mintlify .mdx format.
This PR was created by an AI agent (OpenHands) on behalf of rajshah4.