Repository navigation
Run route code unchanged against a shared gateway, and follow LiteLLM's Router - #7
Merged
Merged
Conversation
…'s Router - route() and LiteLLM's Router no longer raise when AGENTROUTER_BASE_URL is set. Calls send the route's name to that gateway, whose route of the same name applies, and the SDK warns once. A Router chooses its route name at each call, so one made before the gateway was set still works. - export_config() names a Router's routes after their group, so a gateway made from it answers to the names code calls. - LiteLLM's Router shares a group's traffic by weight, rpm or tpm, as LiteLLM's simple-shuffle does, keeping fractional ratios. It warns about a routing_strategy and litellm_params it does not use. - A call with api_base= warns once that it goes there in place of the gateway. - A plain-text 403 from a gateway you set names AGENTROUTER_API_KEY as a possible cause, without the provider's name in front. - A call to a model without a known price reports response_cost as None and warns nothing, as in LiteLLM. Signed-off-by: arifsetiawan <n.arif.setiawan@gmail.com>
GitHub no longer runs the macos-14 runner ("The configuration 'macos-14-arm64-us-default' is not
supported"), so the darwin-arm64 build was cancelled before it started, and the release, which
downloads that wheel, could not publish. macos-15 is also Apple Silicon; the wheel's minimum macOS
version comes from the aigw program, not the runner.
Signed-off-by: arifsetiawan <n.arif.setiawan@gmail.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.
Code that defines routes now runs unchanged against a shared gateway, and LiteLLM's
Routerbehaves more like LiteLLM's. Before, code tested against the local gateway that defined routes failed at startup onceAGENTROUTER_BASE_URLpointed at another gateway.Changes
route()and LiteLLM'sRouterno longer raise whenAGENTROUTER_BASE_URLis set. Nothing is set up on this computer; calls send the route's name to that gateway, whose route of the same name applies, and the SDK warns once. ARouterchooses its route name at each call, so one made before the gateway was set still works.export_config()names aRouter's routes after their group (chat, notrouter-1a2b3c4d:chat), so a gateway made from it answers to the names code calls. Two routes that would get one name raiseBadRequestError.Routertraffic shares. A group's traffic is shared byweight,rpmortpm, as LiteLLM's defaultsimple-shuffledoes, and fractional weights keep their ratio (0.01and100become 1 and 10000). Arouting_strategyother thansimple-shuffle, andlitellm_paramsthe gateway does not use, now warn.api_base. A call withapi_base=warns once that it goes to that address in place of the gateway.AGENTROUTER_API_KEYas a possible cause, without the provider's name in front.response_costasNoneand warns nothing, as in LiteLLM.completion_cost()called directly still warns and returns 0.Docs, both skills and
CHANGELOG.md(under Unreleased) are updated.A second commit moves the macOS gateway build from
macos-14, which GitHub no longer runs, tomacos-15. Without it the darwin-arm64 wheel is not built and the release cannot publish.Checks
ruff check,ruff format --checkpytestaigwtest rantests/test_adk.py,tests/test_openai_agents.pymake apps,make apps-livePASS=11 FAIL=0on both SDKssmoke_real,smoke_local_gateway,smoke_routesPASS=8,PASS=10,PASS=9smoke_examplesPASS=21; the two framework examples run in their own environments, both passsmoke_adk_real,smoke_agents_realPASS=4,PASS=4An AI tool (Claude Code) was used to write this change and its tests.