Skip to content

feat(ui): replace Reset example with an Example preset dropdown and a Clear button on the Decisions tab - #45848

Merged
kerrylu-berri merged 3 commits into
mainfrom
litellm_decisions_presets
Oct 10, 2026
Merged

kerrylu-berri merged 3 commits into
mainfrom
litellm_decisions_presets

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • The Decisions tab had one example and a Reset example button, so the only way to see what a choice, noul, or score question does was to edit the bug triage example by hand
  • There was no way to empty the form and start from nothing
  • Nothing told you whether the request on screen was still the example or something you had edited

How it solves it:

  • Reset example is replaced by an Example dropdown with four presets: Triage a bug report (choice, noul, score), Route a support ticket (choice), Moderate a forum comment (noul), Score a sales lead (score)
  • Picking a preset swaps the whole request in. The same presets are offered on /v1/decisions in the OpenAI shape (input, questions array, predicate) and on /v1/systemone in the System One shape (state, questions object, noul)
  • As soon as the request differs from every preset the dropdown reads Custom
  • A Clear button next to the dropdown empties the request (keeps the model, blank input, no questions), Send is disabled until it is valid again, and any preset can be picked from that empty state

Intentional product change: the Reset example button is gone. Its job is done by picking the preset again from the dropdown

User Flow

Before: one example, edit it by hand to try another question type

  1. Open http://localhost:3000/ui/playground/?tab=system-one, the bug triage example is loaded and the top right has Reset example and Send
  2. Edit the Input or a question, nothing on screen says the request is no longer the example
  3. To try a score only request, delete the two other question cards and rewrite the input, or click Reset example to go back to the single example

After: pick a preset, see it is Custom once edited, Clear to start from nothing

  1. Open http://localhost:3000/ui/playground/?tab=system-one, the top right has an Example dropdown reading Triage a bug report, Clear, and Send
  2. Open the dropdown and pick Score a sales lead, the Input and the single fit score question replace the form, the JSON tab shows the same request
  3. Edit the Input, the dropdown now reads Custom
  4. Click Clear, the Input is empty, there are no question cards, Send and Clear are disabled, the dropdown reads Custom
  5. Pick Route a support ticket from the dropdown, the form fills with the billing ticket and its department choice question, Send is enabled
  6. Switch Endpoint to /v1/decisions, the same four presets are offered and Moderate a forum comment produces a predicate question named breaks_rules

Before

After, dropdown open

After, Custom once edited

After, cleared

  • The Example dropdown matches presets by parsed content with model ignored (matchPreset), so picking a model or reordering keys keeps the preset label, and a request that omits model keeps omitting it through Clear and preset picks (bot findings on 290bc6a, fixed in e8b5f32)

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. npx vitest run "src/app/(dashboard)/playground/components/systemOneUI/lib/example.test.ts" "src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.integration.test.tsx". 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

Admin UI dev server (npm run dev in ui/litellm-dashboard) on http://localhost:3000 in front of a live proxy on http://localhost:4000 with a real azure/microsoft-decision-1 deployment, Playground > Decisions, /v1/systemone

Before (7831d8a)

  1. Open http://localhost:3000/ui/playground/?tab=system-one, the toolbar's top right reads Reset example and Send, no way to pick another example or empty the form
  2. Screenshot under User Flow, Before

After (e8b5f32)

  1. Open http://localhost:3000/ui/playground/?tab=system-one, the toolbar's top right reads Triage a bug report, Clear, Send
  2. Pick Score a sales lead, edit the Input, the dropdown reads Custom. Click Clear, the form is empty and Send is disabled. Pick Triage a bug report, the example is back
  3. Screenshots under User Flow, After

Each new preset sent to the live model exactly as the dropdown builds it, as the end user would by clicking Send:

$ for preset in support-routing moderation lead-scoring; do curl -s http://localhost:4000/v1/systemone \
    -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" \
    -d @$preset.json | jq -c .answers; done
{"department":{"type":"choice","choice":"billing","confidence":0.9955,"probabilities":{"account":0.0013,"billing":0.9966,"sales":0.0007,"technical":0.0013}}}
{"breaks_rules":{"type":"noul","noul":0.1330}}
{"fit":{"type":"score","score":3.9718,"confidence":0.9664,"legend":{"0":"No fit, wrong market or no budget","1":"Weak fit, early curiosity only","2":"Possible fit, needs discovery","3":"Strong fit, active evaluation","4":"Ideal fit, ready to buy this quarter"}}}

Mutation check: changing the Moderate a forum comment preset's question type to "predicate" makes lib/example.test.ts fail on the /v1/systemone validation, and removing the questions: {} from emptyPayload makes the "clears the whole request" integration test fail because the form no longer renders Add question

Type

🆕 New Feature

Caveats (if any)

Low

  • Preset detection is an exact match on the serialized JSON, so reformatting the JSON by hand without changing a value also reads as Custom until you pick the preset again
  • Clear keeps the selected model in the request so the Model picker does not blank out, so the cleared JSON is {"model": "...", "state": "", "questions": {}} rather than {}

CI note

The non-required code-quality job is red on this PR because tests/code_coverage_tests/test_proxy_types_import.py fails with module litellm has no attribute proxy. That is already the case on main at the merge base (this branch has no non-UI diff against main, and the script fails the same way locally on main), the last change to litellm/__init__.py before it is #44927, and main has not run the test-linting workflow since 2026-10-07. Not fixed here

Final Attestation

  • 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/f08f36d6b15149878bc762ca06e03409
Open in Devin Desktop: https://app.devin.ai/desktop/session/f08f36d6b15149878bc762ca06e03409?variant=devin
Requested by: @kerry-berri


Note

Devin errored when opening this Pull Request as kerry-berri.
As a fallback, Devin opened this PR as itself.


Note

Low Risk
Playground UI and local example helpers only; no proxy or auth changes.

Overview
The Decisions playground replaces “Reset example” with an Example dropdown (four presets: bug triage, support routing, moderation, lead scoring) and a Clear button that blanks input/questions while keeping the selected model.

Presets load the full request on both /v1/systemone and /v1/decisions (OpenAI-shaped via toOpenAIDecisionsRequest). The dropdown shows Custom when the payload no longer matches a preset (matchPreset ignores model). Picking a preset again restores that example; Clear disables Send until the request is valid again.

lib/example.ts centralizes DECISION_PRESETS, presetPayload, emptyPayload, and matching logic; integration and unit tests cover preset switching, clear-from-empty, model-agnostic matching, and /v1/decisions behavior.

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

… Clear button on the Decisions tab

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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


kerry seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@kerrylu-berri

Copy link
Copy Markdown
Contributor

bugbot run

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new blocking issues remain.

Summary

Replaces Reset example with four example presets and a Clear button on the Decisions tab.

  • The Decisions tab offers four request presets and a way to clear the form.

Reviews (2) · Last reviewed commit: "fix(ui): match Decisions presets by cont..." · Reviewed by Greptile

@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.

Stale Bugbot comment from a previous run.

… out of Clear and preset picks

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

Copy link
Copy Markdown
Contributor

bugbot run

@kerrylu-berri

Copy link
Copy Markdown
Contributor

@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.

Stale Bugbot comment from a previous run.

@kerrylu-berri

Copy link
Copy Markdown
Contributor

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 f0f852c. Configure here.

@kerrylu-berri kerrylu-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

@kerrylu-berri
kerrylu-berri merged commit dc77381 into main Oct 10, 2026
87 checks passed
@kerrylu-berri
kerrylu-berri deleted the litellm_decisions_presets branch October 10, 2026 21:05
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.

2 participants