Repository navigation
fix(proxy): forward every method on the typesafe pass-through route - #41723
Merged
Merged
Conversation
#41607 registered the typesafe pass-through with a route that only accepted GET and POST, so a PUT, DELETE or PATCH to /typesafe/... came back 405 before reaching the upstream. CircleCI's pass-through method test caught it, but that lane does not run on the PR gate, so the mapped unit test now covers the same invariant for typesafe The same CircleCI run also failed test_models_by_provider because typesafe is not a key of models_by_provider. Registering it there would satisfy the assertion without changing behaviour: typesafe has no LlmProviders member, so a typesafe/* deployment never loads and get_valid_models returns nothing, and its spend is priced straight from model_cost. The test already skips search-mode providers for that reason, so it now skips evaluation mode too
… the typesafe methods
Contributor
|
The previous regeneration ran on Python 3.13, which strips docstring indentation at compile time, so one description and one query field came out different from what the Python 3.12 sync check produces. Regenerated on 3.12 so only the typesafe route entries differ from main
…ed upstream The route test only resolved route names. It now sends every method through the proxy with a virtual key and asserts the upstream receives that method, the proxy's TypeSafe key and the caller's body
yucheng-berri
approved these changes
Sep 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 of 6 tasks
Merged
10 tasks done
mgmonteleone
pushed a commit
to mgmonteleone/litellm
that referenced
this pull request
Sep 22, 2026
Partial backport of upstream BerriAI#41607 (price rows and the "evaluation" model mode only; the /typesafe pass-through is not carried), plus the test_models_by_provider skip from BerriAI#41723. The Jev classifier (BerriAI#41615) prices its calls from typesafe/jev-* registry rows, so they must exist even when LITELLM_LOCAL_MODEL_COST_MAP is set. Drop this commit when rebasing onto a release that contains BerriAI#41607. Co-Authored-By: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
14 tasks done
This was referenced Sep 23, 2026
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.
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer sending anything but GET or POST to /typesafe/... gets the proxy's own 405, and a TypeSafe endpoint added with another method would need a proxy release first
TYPESAFE_API_KEYand restarts the proxy405 {"detail":"Method Not Allowed"}and nothing reaches TypeSafeAfter: the same request is forwarded and TypeSafe's own answer comes back
TYPESAFE_API_KEYand restarts the proxyRelevant issues
Follows up #41607. CircleCI pipeline 89758 on main flagged both gaps: https://app.circleci.com/pipelines/github/BerriAI/litellm/89758
TypeSafe's public OpenAPI (v0.2.0 at https://api.typesafe.ai/openapi.json, read 2026-09-18) lists only POST /v1/systemone and GET /v1/models, and TypeSafe itself answers 405 to PUT, DELETE and PATCH today. #41607 mirrored that surface with GET and POST. The wider method set is this repo's pass-through convention, enforced by
test_pass_through_routes_support_all_methods: the proxy forwards every method and the upstream decides, with the exemption list reserved for wire protocols that admit a single method like Amazon Comprehend Medical. That test only runs on CircleCI, so the PR gate never showed itRegistering typesafe in
models_by_providerwould have turnedtest_models_by_providergreen too, but it was dropped on purpose. typesafe has noLlmProvidersmember, so atypesafe/*deployment fails to load,get_valid_modelsreturns nothing for it, and its spend is priced straight frommodel_cost. The registry entry would only silence the test. The test already carves out search-mode providers for the same reason, so the carve-out now covers evaluation mode as wellAffected release
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup.
TYPESAFE_API_BASEpoints at a local echo server that answers every method with what it received, because no TypeSafe credentials are available on this machine; the proxy side, which is what changes here, is the real proxyBefore (7e03084)
curl -s -w '\nHTTP %{http_code}\n' -X PUT http://127.0.0.1:53611/typesafe/v1/systemone -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"state":"x"}'After (50ccb2c)
curl -s -w '\nHTTP %{http_code}\n' -X PUT http://127.0.0.1:53611/typesafe/v1/systemone -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"state":"x"}'Type
🐛 Bug Fix
✅ Test
Caveats (if any)
Low
Final Attestation