Repository navigation
chore(backport): add the remaining jev changes to stable/1.99.x - #42669
devin-ai-integration[bot] wants to merge 19 commits into
Conversation
(cherry picked from commit 4bfac88)
…able/1.99.x The add-auto-router submit path builds BuildComplexityRouterConfigParams, which requires classificationPrompt and classifierContextBudgetChars; both now come from the form config. hydratePlanModeMinTier referenced the CustomTierSet type that only exists on lines with the custom-tier UI, which this line lacks, and nothing on this line calls it, so the dead export is removed instead of stubbing the type.
eslint flagged seven unused imports left over from dropping the upstream-only tier surface, a nested ternary in autoRouterRows, and new local/no-large-inline-object-arg warnings versus the stable base: the ternary is a label map, the inline objects in the edit modal and the transition test are named variables, and the edit modal import block regains the classifier and adaptive types its interfaces reference.
… code The picks brought upstream imports, signatures and literals that tripped the 1.99.x lint gates: ruff flagged two unused imports and one unsorted import block, the strict gate flagged BLE001 and the same F401s, and the type-discipline gate flagged mutable-annotation (LIT001/2) and **kwargs (LIT008) lines. Imports cleaned and sorted, and each remaining flagged line carries the required suppression with its reason.
make check runs prettier over the dashboard tree; two touched files drifted from its output.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
|
This comment has been minimized.
This comment has been minimized.
The backport dropped the main-line call shape in preview_auto_router_routing: it synthesized a single user message from data.prompt and skipped refresh_proxy_server_request_body_snapshot, so a dry run carrying messages classified a null-content turn and the raw-body snapshot was never refreshed. Restore the imported helper call and pass request_kwargs["messages"] as main does.
The 1.99.x serializer gated classifier_fallback on classifierType === "llm", so a fallback chosen for a jev classifier was silently dropped on save. Main includes it whenever usesClassifierContext holds, which covers jev. Gate on usesClassifierContext to match.
|
bugbot run |
There was a problem hiding this comment.
✅ 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 333fb3c. Configure here.
TLDR
Problem this solves:
stable/1.99.xonly carries the TypeSafe Jev passthrough (feat(proxy): add TypeSafe AI Jev evaluate passthrough with registry-priced spend tracking #41607, merged via feat(typesafe): backport #41607 to stable/1.99.x for v1.99.2 #42598)How it solves it:
stable/1.99.x, one commit per PR, original author keptIncluded PRs:
Backport notes:
git cherry-pick -n -m 1from the main merge commit for cf42b60, 34718f0, 2edda5a, 1e161f5 and a83773c, plain pick for the #42301 squash 1106b16, each committed with the original author, subject and a two-line provenance body.4bfac88281(the stable dashboard adaptation from #42595) is picked with-xright after #41886Prerequisites, each its own commit with a provenance body naming the main sha:
7015bf37bb(apply team model aliases on the JWT auth path),109ca70f66(allow opted-in team members to manage their routers: theDatabaseClientprotocol,AUTO_ROUTER_MANAGE, theprisma_clientkwarg oncan_key_call_model/can_team_access_model, the lazyteam_membershipparams on_check_team_member_model_access, the member dry-run plumbing and matching test helpers),d8edfb69c2(#38174, derive auto-router health from its underlying models, which #41615 and #41879 build on and which this oldest line did not have yet) and510424c86c(classifier circuit breaker, which the Jev classifier plugs into)Conflicts resolved, always toward what main has after the pick: this is the oldest line and lacks
CustomTierSet, theNON_REASONINGtier,heuristic_first/hybrid/heuristic_v2,classification_examples,forecast_classifier_configandAutoRouterClassifierTabs, so shared files took ours plus each pick's delta and the tier and classifier-tab files #41886 brought from main that depend on those features were dropped again in the stable adaptation.schema.d.tsand_lazy_openapi_snapshot.jsonwere regenerated wholesale (see below). Own follow-up commits, all Devin identity:fix(ui): adapt the jev dashboard pieces to stable/1.99.x(classifier fields passed at the serializer call site inadd_auto_router_tab.tsx, deadhydratePlanModeMinTierremoved, nested ternary replaced by a lookup map inautoRouterRows.ts, stale imports removed and call sites hoisted to named consts inedit_auto_router_modal.tsx),fix(ui): pass the jev classifier fields the serializer requires on stable/1.99.x,fix(ui): clear the eslint errors on the touched dashboard files,fix(lint): satisfy the strict and type-discipline gates on the picked code,style(dashboard): prettier-format the touched dashboard filesGenerated artifacts: #41615 and #41757 brought
litellm/proxy/_lazy_openapi_snapshot.jsonandui/litellm-dashboard/src/lib/http/schema.d.tsverbatim from main.chore(backport): regenerate the openapi snapshot and dashboard api types for stable/1.99.xregenerates both under Python 3.12 (uv sync --python 3.12 --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev,scripts/prisma_generate_if_needed.py,python -m litellm.proxy._lazy_openapi_snapshot,npm run gen:api), so the snapshot dropsagent_365from theunreachable_fallbackdescription andschema.d.tsdrops the upstream-only classifier surface andJsonValueand gains/auto_router/manageReview-loop follow-ups after c2bcf43, both Devin identity with a body:
a7bdc0a753restores main's call shape in the test-routing preview (forwardrequest_kwargs["messages"]and refresh the raw-body snapshot instead of synthesizing one user message fromprompt), and333fb3c951gatesclassifier_fallbackonusesClassifierContextin the dashboard serializer so a fallback picked for a jev router is saved, matching mainChecks run on the tip c2bcf43 and repeated on 333fb3c. Python: every
tests/test_litellmfile the picks touch was run in the worktree withLITELLM_LOCAL_MODEL_COST_MAP=True, 563 passed, 14 failed; the 14 are therequires_semantic_routertests intest_complexity_router.py, which fail on the line's tip before these picks too becausesemantic_routeris not installed. Dashboard, underui/litellm-dashboard:npx vitest runon every touched test file PASS (391 tests),npx eslinton every changed file PASS with 0 errors and no net newlocal/no-large-inline-object-argwarnings,npx tsc --noEmiton non-test sources PASS,npm run test:typesPASS,npm run buildPASS.make checkat the repo root: FAIL, on exactly one finding,LIT002: total 26877 over limit 26873 (this change added 1) - litellm/integrations/otel/model/payloads.py:104,106. That file is byte-identical toorigin/stable/1.99.xand no commit on this branch touches it. The gate measures againstmerge-base(origin/litellm_internal_staging, HEAD), so it counts drift the stable line picked up since it forked. Running the same gate with the line as base,scripts/type_discipline_gate.py --base origin/stable/1.99.x, printsOK: every LIT rule is within its codebase ceiling. Every othermake checkgate passed. No budget JSON was editedUser Flow
Before: an admin on stable 1.99.x cannot use Jev anywhere except the raw passthrough
TYPESAFE_API_KEY, starts the proxy fromstable/1.99.xand opens http://localhost:4000/ui/?page=models to add an auto-routertypesafe_compactionguardrail toconfig.yamland the proxy refuses to start with an unknown guardrail error"classifier_type": "jev"and gets 422, jev is not an accepted classifierAfter: the same admin configures Jev routing, compaction and budgets from the UI and API
TYPESAFE_API_KEY, starts the proxy from this branch and opens http://localhost:4000/ui/?page=models to add an auto-routertypesafe_compactionguardrail and the proxy starts and trims low-relevance turns before forwarding"cause": "jev_classifier"and the chosen tiertypesafe/jev-1.13Relevant issues
Backport of #41615, #41723, #41757, #41879, #41886 and #42301. Follows #42598 on this line and mirrors #42595
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
Two proxies from two worktrees, 2 uvicorn workers each, own Postgres each, real TypeSafe, OpenRouter and OpenAI calls, no mocks. Before is the merge base on port 18402, After is the PR tip on port 18403
Before (1394d33)
POST /openrouter/api/alpha/decisions
POST /model/new with a jev auto-router
POST /auto_router/test_routing with a jev classifier
Over-budget member key on /auto_router/test_routing
Not reachable: the jev classifier config is rejected at validation before the budget check runs
After (333fb3c)
POST /openrouter/api/alpha/decisions
POST /model/new with a jev auto-router
POST /auto_router/test_routing with a jev classifier
Over-budget member key on /auto_router/test_routing
Member key under a team with
team_member_permissions=["/auto_router/manage"],max_budget=0.000001, spend pushed over the cap by one real chat completionAlso on the After side: GET /typesafe/v1/models returns the TypeSafe model list, and a
typesafe_compactionguardrail loaded from config shows up in GET /v2/guardrails/listType
🆕 New Feature
Caveats (if any)
Medium
make checkfails on this branch onLIT002inlitellm/integrations/otel/model/payloads.py, a file this branch does not touch; the same gate passes with--base origin/stable/1.99.xLow
fix(ui): adapt the jev dashboard pieces to stable/1.99.x(521ebb4) has no commit body; rewriting it would need a force pushrequires_semantic_routertests fail on the line's tip with or without this PRFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/dcedce8035d64a199713bae4b2b90b7f
Open in Devin Desktop: https://app.devin.ai/desktop/session/dcedce8035d64a199713bae4b2b90b7f?variant=devin
Requested by: @mateo-berri