Repository navigation
Let workers use the organization's LiteLLM proxy through the broker; release 0.20.0 - #102
Merged
Merged
Conversation
…release 0.20.0 With LITELLM_API_KEY in the secret store and LITELLM_BASE_URL in its settings, an organization's workers get the broker's address and their own token; the broker forwards to the organization's proxy with the real key. The cluster manager writes the address onto each worker token (api_tokens.broker_settings), which is where the broker reads it. The broker only forwards to public https hosts. Co-Authored-By: Claude Fable 5.2 <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.
Last of the four planned steps (
TODO.md). Details indocs/release-0.20.0.md.What changes
An organization sets the secret
LITELLM_API_KEYand the (visible) settingLITELLM_BASE_URLin the dashboard. Its workers then getand the broker forwards each request to the organization's proxy with the real key, streaming the answer back.
LITELLM_API_KEYwas never passed to workers, so organizations that do not set it see no change.Secret flow
LITELLM_API_KEYLITELLM_BASE_URL(not a secret)api_tokens.broker_settingson the worker token → brokerThe broker has no database credential; it reads the address with the worker token's own JWT. A worker token cannot write
api_tokens, so job code cannot redirect the broker.Where the broker may forward to
The address is organization-chosen, so
checked_upstreamrequireshttps, a host name, and that every resolved address is public. The broker never forwardsMetadata-Flavorand never follows redirects. Known limit (in the release notes andTODO.md): the name is resolved once for the check and again to connect.Also
GET /healthon the broker (Cloud Run's front end keeps/healthz).LITELLM_BASE_URLin full and refuses non-https values.What a release requires
Apply migration
20261123000000_worker_token_broker_settings.sql(adds a column and a defaulted fourth argument tocreate_worker_token; compatible in both orders), publish 0.20.0, upgrade manager, broker and dashboard. No worker image changes.Tests
tests/test_broker.py(29 tests in total) andtests/test_worker_tokens.py: the LiteLLM route against a stand-in proxy, the address check with a fake resolver, the manager's side, and the new argument against a real PostgreSQL. Full suite: 295 passed.Not verified: a real LiteLLM proxy; it needs an organization with the two settings.
🤖 Generated with Claude Code