Skip to content

feat(typesafe): backport #41607 to stable/1.100.x for v1.100.2 - #42597

Merged
mateo-berri merged 1 commit into
stable/1.100.xfrom
litellm_cherrypick_1_100_x
Sep 23, 2026
Merged

mateo-berri merged 1 commit into
stable/1.100.xfrom
litellm_cherrypick_1_100_x

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • TypeSafe Jev only ships in v1.103.0-rc, users on stable 1.100.x cannot use it
  • Customers want it on a stable line without moving to an rc in prod

How it solves it:

Included PRs:

User Flow

Before: a developer on stable 1.100.x points their TypeSafe client at the proxy and every call is refused

  1. The admin sets TYPESAFE_API_KEY and starts the proxy from stable/1.100.x
  2. The developer sends POST http://localhost:4000/typesafe/v1/systemone with a model: jev-latest payload
  3. The proxy answers 404 or 401, the request never reaches TypeSafe
  4. http://localhost:4000/ui/?page=logs shows no TypeSafe request

After: the same call is forwarded to TypeSafe and logged with spend

  1. The admin sets TYPESAFE_API_KEY and starts the proxy from this branch
  2. The developer sends POST http://localhost:4000/typesafe/v1/systemone with the same payload
  3. The proxy answers 200 with the TypeSafe response body
  4. http://localhost:4000/ui/?page=logs shows the request under typesafe/jev-latest with non-zero spend

Relevant issues

Backport of #41607

Affected release

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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

Live proxy started with python litellm/proxy/proxy_cli.py --config config.yaml --port 4000 --detailed_debug (master key sk-1234, TYPESAFE_API_KEY set from the shared vault) at each sha, one real call to https://api.typesafe.ai per leg

Before (44d3c4f, stable/1.100.x merge base)

POST /typesafe/v1/systemone

curl -s -w "\nHTTP %{http_code}\n" -X POST http://localhost:4000/typesafe/v1/systemone
-H "Authorization: Bearer sk-1234" -H "Content-Type: application/json"
-d '{"state":"Help! My payouts have been failing for 3 days.","model":"jev-latest","questions":{"department":{"type":"choice","instructions":"Which team should handle this?","criteria":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations","sales":"Pricing, upgrades, new accounts"}}}}'

2. ```
{"detail":"Not Found"}
HTTP 404

After (1ebc488, PR tip)

POST /typesafe/v1/systemone

  1. Same curl as above

{"model":"jev-1.13.0","answers":{"department":{"type":"choice","choice":"billing","confidence":0.82,"probabilities":{"sales":0.0,"technical":0.12,"billing":0.88}}},"usage":{"input_tokens":349,"output_tokens":38}}
HTTP 200

3. Proxy log after the call shows spend tracked against `typesafe/jev-1.13.0`:

response_cost: 1.4658e-05


## Type

🆕 New Feature

## Caveats (if any)

## Final Attestation

- [x] The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR


Link to Devin session: https://app.devin.ai/sessions/b6d5b6c20aec42babbd9213ec27ef3bd
Open in Devin Desktop: https://app.devin.ai/desktop/session/b6d5b6c20aec42babbd9213ec27ef3bd?variant=devin
Requested by: @mateo-berri

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Additive passthrough and cost-tracking path following existing provider handlers; spend depends on registry pricing and parsed usage, with zero cost when model or usage is missing.
> 
> **Overview**
> Adds **TypeSafe AI** as a first-class proxy passthrough provider so stable `1.100.x` clients can call Jev via `/typesafe/{endpoint}` instead of getting 404.
> 
> The proxy forwards GET/POST to `TYPESAFE_API_BASE` (default `https://api.typesafe.ai`), injects `Authorization: Bearer` from `TYPESAFE_API_KEY`, and registers the route on the gateway allowlist and LLM passthrough route map. **Spend logging** parses TypeSafe `usage` and model fields, resolves pricing from the cost map (`typesafe/jev-*`), and records standard pass-through logs with `response_cost`.
> 
> The model registry gains three **evaluation**-mode entries (`jev-1.13.0`, `jev-latest`, `jev-preview`) plus schema/type support for `mode: evaluation`. Unit tests cover the logging handler, route wiring, and metadata.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1ebc488f077e50cae545c6f00416532d14ed23d2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

…acking

Backport of #41607 to stable/1.100.x.
Cherry-picked from deb9d8a (main).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding findings.

Summary

This backport adds TypeSafe Jev passthrough support to the stable 1.100.x line.

  • Registers authenticated GET and POST /typesafe/* proxy routes.
  • Adds TypeSafe response normalization, usage logging, and registry-based spend calculation.
  • Adds pricing metadata for the supported Jev model aliases and the evaluation model mode.
  • Adds route, logging, pricing, and metadata tests plus generated dashboard schema declarations.

Reviews (2) · Last reviewed commit: "feat(typesafe): add TypeSafe Jev passthr..."

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1ebc488. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit 9c1216a into stable/1.100.x Sep 23, 2026
6 of 7 checks passed
@mateo-berri
mateo-berri deleted the litellm_cherrypick_1_100_x branch September 23, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant