Support route_through_gateway, and warn that it is Cloud only - #16
Open
ericjohanson-langchain wants to merge 2 commits into
Open
Support route_through_gateway, and warn that it is Cloud only#16ericjohanson-langchain wants to merge 2 commits into
ericjohanson-langchain wants to merge 2 commits into
Conversation
The control plane can route a deployment's OpenAI and Anthropic calls through the LLM Gateway itself, so the deployment needs no provider key. The client had no way to set it. Add --route-through-gateway. Then the important part: this field exists on Cloud's control plane and *not* on self-hosted. Setting it against a self-hosted instance is accepted by the API and silently dropped -- I only noticed because I read the value back afterwards and it was still null. Warn when it is used with --target self-hosted, say "Cloud only" in the help, and document what the two hosting models actually support. The gateway is a Cloud service, so a self-hosted deployment must forward a Cloud key as LLM_GATEWAY_API_KEY or use a provider key directly; its own instance key gets a 403 from the gateway. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Left behind while trimming that test; ruff caught it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Missed the merge of #15 — pushed to that branch after it merged.
The control plane can route a deployment's OpenAI and Anthropic calls through
the LLM Gateway itself, so the deployment needs no provider key of its own. The
client had no way to set it. Adds
--route-through-gateway.The part worth reviewing
This field exists on Cloud's control plane and not on self-hosted. Setting
it against a self-hosted instance is accepted by the API and then silently
dropped — I only noticed because I read the value back afterwards and it was
still null.
So the CLI now warns when it is used with
--target self-hosted, the help says"Cloud only", and the docs spell out what each hosting model actually supports:
route_through_gatewayLLM_GATEWAY_API_KEY, or the injectedLANGSMITH_API_KEYLLM_GATEWAY_API_KEYmust be a Cloud keyANTHROPIC_API_KEY/OPENAI_API_KEYThe gateway is a Cloud service, so a self-hosted instance's own API key gets a
403from it. That is whyLLM_GATEWAY_API_KEYexists separately, and whythere is no "the platform handles it" option on self-hosted.
76 tests, lint, actionlint and bandit green. Workflows are still disabled by
request, so CI will not run on this PR.