Skip to content

feat(chat): add provider badge to chat input#2257

Draft
gary149 wants to merge 20 commits into
mainfrom
claude/add-provider-badge-NyGaZ
Draft

feat(chat): add provider badge to chat input#2257
gary149 wants to merge 20 commits into
mainfrom
claude/add-provider-badge-NyGaZ

Conversation

@gary149
Copy link
Copy Markdown
Collaborator

@gary149 gary149 commented May 7, 2026

Summary

  • Adds a small gray pill in the chat input (right after the MCP badge) that shows the current inference provider for the active model and lets users switch via a bits-ui dropdown — Auto / Fastest / Cheapest, plus the model's specific providers with HF avatars.
  • Reuses the existing settings.providerOverrides[modelId] plumbing (storage and the model:provider suffix on the OpenAI endpoint), so no server changes are needed.
  • Hidden for the Omni router (model.isRouter) and self-hosted instances; only renders on HuggingChat for models that expose providers.
  • Drops font-semibold on the MCP badge too so the two pills match in weight.

Test plan

  • HuggingChat + non-Omni model with providers: badge renders after MCP badge, defaults to "Auto" with magic-wand icon.
  • Open dropdown → switch to Fastest / Cheapest / a specific provider; badge updates and /settings/<model> reflects the same choice.
  • Send a message after switching: assistant message shows the chosen provider in routerMetadata.provider.
  • Omni model selected: badge does NOT render.
  • Self-hosted (PUBLIC_APP_ASSETS != "huggingchat"): badge does NOT render.
  • Dark mode: pill remains legible (dark:bg-gray-700, dark:text-gray-100).
  • Mobile viewport: chip row wraps cleanly.

claude and others added 20 commits May 7, 2026 21:22
Adds a green pill next to the MCP badge in the chat input that shows the
currently selected inference provider and lets users switch on the spot,
reusing the existing providerOverrides settings + bits-ui Select pattern
from the model settings page. Hidden for the Omni router and self-hosted
deployments to avoid surfacing irrelevant choices.
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