Skip to content

feat(ui): run the Lite preset's medium and complex tiers at their documented efforts - #38482

Merged
tin-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_autorouter_preset_tier_efforts
Aug 28, 2026
Merged

feat(ui): run the Lite preset's medium and complex tiers at their documented efforts#38482
tin-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_autorouter_preset_tier_efforts

Conversation

@tin-berri

@tin-berri tin-berri commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Lite runs Muse Spark and Kimi K3 at provider defaults
  • Kimi K3's own default is max, which it never got
  • No bundled preset ever set a per-tier effort

How it solves it:

  • Medium runs Muse Spark 1.2 at xhigh
  • Complex runs Kimi K3 at max
  • Both efforts are what those models document

User Flow

Before: an admin picking the Lite template gets two mid-tier models on whatever thinking their provider defaults to

  1. They open https://litellm-domain/ui/?page=llm-playground, go to Add Model, then the Auto Router tab
  2. They pick the Lite template
  3. Medium fills in with muse-spark-1.2 and Complex with kimi-k3
  4. Every Reasoning effort dropdown reads Default
  5. They try to set Complex to max by hand and the dropdown does not offer it

After: both tiers arrive on the effort their model documents

  1. They open the same page and pick the Lite template
  2. The Reasoning effort dropdown beside muse-spark-1.2 reads xhigh, and the one beside kimi-k3 reads max
  3. They save the router
  4. A complex prompt reaches Kimi K3 with reasoning_effort: max even though the caller sent none
  5. A medium one reaches Muse Spark 1.2 with reasoning_effort: xhigh

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • 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

Screenshots / Proof of Fix

Shared setup. A local proxy holding the four model groups this preset names, each pointed at a local stub upstream that echoes the body it received. The auto-router is built by reading autorouter_presets.json straight off the branch and handing its complexity_router_config to the proxy verbatim, so what is under test is the shipped preset data rather than a hand-copied version of it.

LITELLM_LOCAL_MODEL_COST_MAP=True litellm --config rig/preset_config.yaml --port 4481

No request below sends reasoning_effort. Every value the stub reports came from the preset. Tiers are reached by prompt complexity, with LITELLM ESCALATE bumping the scored tier one step up.

Substitution declared: no provider on this account sells Kimi K3, Muse Spark or Claude Opus 5, so the upstream is a local stub. The stub only ever receives what the gateway decided to send, which is the whole question here.

Before (49655da, the parent commit)

  1. Trivial prompt routes to fireworks_ai/deepseek-v4-flash, the stub receives no effort
  2. Escalated trivial prompt routes to meta/muse-spark-1.2, the stub receives no effort
  3. Hard prompt routes to fireworks_ai/kimi-k3, the stub receives no effort
  4. Escalated hard prompt routes to anthropic/claude-opus-5, the stub receives no effort

After (98a7b4a)

  1. The same four prompts, same commands:
SIMPLE      routed=fireworks_ai/deepseek-v4-flash  stub received: nothing (provider default)
MEDIUM      routed=meta/muse-spark-1.2             stub received: {'reasoning_effort': 'xhigh'}
COMPLEX     routed=fireworks_ai/kimi-k3            stub received: {'reasoning_effort': 'max'}
REASONING   routed=anthropic/claude-opus-5         stub received: nothing (provider default)
  1. Medium and Complex carry the efforts the preset declares, on requests that asked for none
  2. Simple and Reasoning send nothing, so the effort is scoped to its tier rather than applied router-wide

Type

🆕 New Feature

Caveats (if any)

Medium

Low

  • Muse Spark 1.2 needed no map change
    • It already carries supports_xhigh_reasoning_effort: true, confirmed on the live rig

Final Attestation

  • The tests check the right things, including the edge cases

Note

Low Risk
Bundled preset JSON and dashboard tests only; behavior change is default routing params for admins who choose the Lite template, with no auth or core gateway logic edits in this diff.

Overview
The Lite auto-router preset now declares per-tier reasoning_effort for its medium and complex models instead of leaving them on provider defaults.

autorouter_presets.json adds tier_model_configs for MEDIUM (muse-spark-1.2xhigh) and COMPLEX (kimi-k3max), and the preset description is updated to match. SIMPLE and REASONING tiers are unchanged.

Tests lock in those tier_model_configs values and assert buildPresetPrefill maps them into tier_model_params so the Add Model / Auto Router UI shows the correct effort dropdowns and saved routers forward the params on routed requests.

Reviewed by Cursor Bugbot for commit 542649b. Bugbot is set up for automated code reviews on this repo. Configure here.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai can you reply here with a score and why that score?

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Score: 4/5

The feature is well-scoped and convincingly covered. The explicit supported_reasoning_efforts capability correctly takes precedence over per-level flags, preserves canonical ordering, supports prefixed/bare model fallback, and survives model-info hydration. The preset changes keep reasoning efforts tier-specific, and the tests cover resolver behavior, mixed-group intersection, preset prefill, and the final create payload.

I’m holding back 5/5 because rig/stub.py is not portable repository test infrastructure: it imports FastAPI outside proxy/ and writes to a hard-coded absolute path. It should be removed or made repository-safe before merge. I found no functional issue in the reasoning-effort or preset implementation itself.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The Lite auto-router preset now assigns documented reasoning efforts to its medium and complex tiers.

  • Configures Muse Spark 1.2 with xhigh effort and Kimi K3 with max.
  • Adds tests for the preset data and its conversion into UI prefill parameters.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/autorouter_presets.json Updates the Lite preset description and adds per-tier reasoning-effort configuration for its medium and complex models.
ui/litellm-dashboard/src/lib/autorouter_presets.test.ts Verifies the Lite preset’s effort declarations and their conversion into tier model parameters.

Reviews (5): Last reviewed commit: "feat(ui): run the Lite preset's medium a..." | Re-trigger Greptile

Comment thread rig/stub.py Outdated
Comment on lines +1 to +3
from fastapi import FastAPI, Request
import uuid, json
app = FastAPI()

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.

P2 Out-of-boundary FastAPI handler

This file constructs custom FastAPI request handlers outside litellm/proxy/, bypassing the repository's established dependency and handler boundary.

Rule Used: What: Do not allow fastapi imports on files outsid... (source)

Comment thread rig/stub.py Outdated
@app.post("/v1/chat/completions")
async def cc(request: Request):
body = await request.json()
open("/tmp/claude-501/-Users-tin/c58f6262-3b18-4f0e-a1e1-010bca404add/scratchpad/stub_last.json","w").write(json.dumps(body, indent=1))

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.

P2 Machine-specific output path

Both handlers write to an author-specific directory that the repository never creates, so requests in a normal checkout raise FileNotFoundError instead of returning the expected stub response.

Comment on lines +201 to +204

class TestDeclaredEffortList:
def test_a_declared_list_answers_where_no_flag_could(self):
"""The Kimi K3 shape: low, high and max, with medium excluded. No flag can drop medium,

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.

P2 Narrative test commentary

These tests add extensive narrative comments and docstrings beyond the repository's allowed comment categories, duplicating implementation history that can drift from the self-describing assertions.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread rig/stub.py Outdated
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tin-berri
tin-berri force-pushed the litellm_kimi_k3_reasoning_efforts branch from aba9a37 to 49655da Compare August 27, 2026 08:40
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch 2 times, most recently from 261d76c to 98a7b4a Compare August 27, 2026 08:41
@tin-berri tin-berri changed the title feat(ui): give the anthropic and lite auto-router presets per-tier reasoning efforts feat(ui): run the Lite preset's medium and complex tiers at their documented efforts Aug 27, 2026
@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai rig/stub.py is gone; it was a stale parent commit, now rebased. This PR is lite-only. Score?

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@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 98a7b4a. Configure here.

@tin-berri
tin-berri force-pushed the litellm_kimi_k3_reasoning_efforts branch from 49655da to 481f256 Compare August 27, 2026 16:00
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch from 98a7b4a to 7399548 Compare August 27, 2026 16:00
@tin-berri

Copy link
Copy Markdown
Contributor Author

Pushed: trimmed overlong lines and condensed the test prose per the repo comment rule. All within 120 now.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai line lengths and test comments addressed. Score?

@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 7399548. Configure here.

@tin-berri
tin-berri force-pushed the litellm_kimi_k3_reasoning_efforts branch from 481f256 to 5e02f0a Compare August 27, 2026 19:18
@tin-berri tin-berri closed this Aug 27, 2026
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch from 7399548 to 5e02f0a Compare August 27, 2026 19:18
@tin-berri tin-berri reopened this Aug 27, 2026
@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai can you reply here with a score and why that score?

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Confidence score: 4/5.

No blocking issues found. The change is appropriately scoped to the Lite preset, sets xhigh and max only on the MEDIUM and COMPLEX tiers, keeps SIMPLE/REASONING unchanged, and the description matches the shipped behavior. The added tests verify both the bundled tier_model_configs and the resulting tier_model_params, plus guard against tier/model mismatches across all presets. The supplied stub-upstream evidence also demonstrates that the values reach provider requests when the caller omits reasoning_effort.

I’m not giving 5/5 because the max option depends on stacked PR #38481, and the end-to-end forwarding evidence is provided as manual validation rather than an automated regression test.

@tin-berri
tin-berri force-pushed the litellm_kimi_k3_reasoning_efforts branch from 5e02f0a to 0dc08e6 Compare August 27, 2026 19:22
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch from 198cd92 to a4fef59 Compare August 27, 2026 19:22
@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai can you reply here with a score and why that score?

@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 a4fef59. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Confidence score: 4/5

The change is appropriately scoped and correctly uses the existing tier_model_configstier_model_params → serialized router-config flow. The Lite preset sets muse-spark-1.2 to xhigh only for MEDIUM and kimi-k3 to max only for COMPLEX, while leaving SIMPLE and REASONING unchanged. The tests cover the preset values, tier/model consistency, and UI prefill behavior, including model-name resolution.

I’m not giving 5/5 yet because the max capability depends on #38481 and the current e2e check is still pending; those should be confirmed before merge.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Confidence score: 4/5.

The change is focused and correctly uses the existing tier_model_configstier_model_params path. The Lite preset now declares xhigh for Muse Spark 1.2 and max for Kimi K3, while leaving SIMPLE and REASONING unchanged. The added tests verify both the shipped preset values and the prefill transformation, and the provided stub-upstream evidence confirms the values reach routed requests when callers omit reasoning_effort.

I’m not giving 5/5 because the max dropdown availability depends on stacked PR #38481, and the tests added here stop at preset/prefill transformation rather than directly exercising the final request serialization for both tiers.

@tin-berri
tin-berri force-pushed the litellm_kimi_k3_reasoning_efforts branch from 0dc08e6 to e377a04 Compare August 27, 2026 19:33
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch from a4fef59 to d8a5e8b Compare August 27, 2026 19:33
Base automatically changed from litellm_kimi_k3_reasoning_efforts to litellm_internal_staging August 27, 2026 22:38
…umented efforts

Lite ran Muse Spark 1.2 and Kimi K3 at whatever effort each provider happens to
default to. Set the ones their own docs name: Muse Spark 1.2 at xhigh, and Kimi
K3 at max, which is Kimi's own default and what the model map now declares for
that model.

Stacked on the map change, since without it kimi-k3 resolves to unknown levels
and the tier editor's capability-blind fallback list does not offer max.
@tin-berri
tin-berri force-pushed the litellm_autorouter_preset_tier_efforts branch from d8a5e8b to 542649b Compare August 27, 2026 22:55
@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai can you reply here with score & why

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Confidence score: 5/5

I found no blocking issues. The change is narrowly scoped to the Lite preset and uses the existing tier_model_configstier_model_params hydration path, so xhigh and max are applied only to the MEDIUM and COMPLEX tiers rather than globally. The tests cover both the bundled declarations and the UI prefill transformation, while the existing invariant checks ensure each configured model belongs to its tier. SIMPLE and REASONING remain unchanged. The dependency on #38481 for exposing max in the capability map is an integration prerequisite, not a defect in this PR.

@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 542649b. Configure here.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai rereview

@tin-berri
tin-berri enabled auto-merge (squash) August 28, 2026 21:22
@tin-berri
tin-berri disabled auto-merge August 28, 2026 21:26
@tin-berri
tin-berri merged commit 8868aaa into litellm_internal_staging Aug 28, 2026
77 checks passed
@tin-berri
tin-berri deleted the litellm_autorouter_preset_tier_efforts branch August 28, 2026 21:26
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.

3 participants