Skip to content

feat(web): provider-grouped ModelPicker for the LiteLLM matrix#2

Merged
gaurav0107 merged 1 commit into
mainfrom
feat-model-picker
Jun 6, 2026
Merged

feat(web): provider-grouped ModelPicker for the LiteLLM matrix#2
gaurav0107 merged 1 commit into
mainfrom
feat-model-picker

Conversation

@gaurav0107

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1. The previous PR widened the credential matrix to six providers but didn't surface them in any UI; users had to know the right model string and provider prefix to type. This PR adds a curated picker.

What ships

web/src/lib/models.ts — static catalog: 4-6 models per provider (anthropic, openai, gemini, mistral, deepseek, groq), each with value (the <provider>/<model> string the gateway expects), label, and a one-line tier hint.

<ModelPicker> — provider-grouped <select> with an "Other → Custom…" escape hatch that flips the input to free-text so the user can paste any model ID. Doesn't lock anyone out of new releases between catalog updates.

<ProviderModelPicker> — same UI, but for surfaces like Luna judges that store {provider, model} as separate columns. Splits the catalog value on dispatch.

Wired into:

  • Playground (single + compare) — replaces the hardcoded PRESET_MODELS array
  • /judges create form — replaces the freeform "Model" input

API: Luna _VALID_PROVIDERS widens to the six-provider matrix + stub. The credential router was already widened in #1.

Why a static catalog

Considered LiteLLM's runtime model registry (~500 entries, auto-updates) and recent-model autocomplete from ClickHouse traces. Both are heavier and most of the value is just "show me what Gemini can do." Static covers 95% of the discoverability need; LiteLLM's catalog endpoint can layer on later if needed. The Custom… escape hatch means the catalog is never a blocker.

Test plan

  • Local: docker compose build api web && up -d. Web 200, api healthz ok.
  • TypeScript build clean (Next.js prod build inside the web image succeeds).
  • Open /playground, confirm model dropdown groups: Anthropic / OpenAI / Gemini / Mistral / DeepSeek / Groq / Other.
  • Open /judges → New judge → confirm provider dropdown shows all six + Custom; type stub/echo to test the deterministic path.
  • Create a Gemini credential (admin only), confirm playground dispatches to gemini/gemini-2.5-pro.

🤖 Generated with Claude Code

Static MODEL_CATALOG per provider in web/src/lib/models.ts (4-6 models
each: anthropic/openai/gemini/mistral/deepseek/groq). New
<ModelPicker> renders a grouped <select> with a 'Custom...' escape
hatch for models not yet in the catalog.

Wired into:
- Playground (single + compare modes) via ModelPicker
- /judges create form via ProviderModelPicker (provider+model split)

api: widen luna_judges _VALID_PROVIDERS to include the four new ones.

Discoverability fix for the Lite­LLM PR: configured a Gemini key but
'how do I pick a Gemini model' had no answer. The picker shows them
grouped by provider; users still type custom IDs through the escape
hatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gaurav0107 gaurav0107 merged commit 54df930 into main Jun 6, 2026
0 of 3 checks passed
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