Model settings

Controls for which model runs and how: a run-settings sidebar for a playground, a quick popover from the chat header, and preset tones with the numbers tucked away.

Loading preview…

Install

  1. 1

    Run this command in your Tailwind CSS project. It adds components/ai/model-settings-sidebar.tsx and installs its dependencies.

    $ npx shadcn@latest add https://gradientdeck.com/ai-components/r/model-settings-sidebar.json

Usage & API

Example

model-settings-sidebar.tsx
import { RunSettings } from "@/components/ai/model-settings-sidebar"

<RunSettings
  models={[]}
  value={value}
  defaults={defaults}
  onChange={() => {}}
/>

Props RunSettings

PropType & descriptionRequired
modelsRunModel[]Required
valueRunSettingsValueRequired
defaultsRunSettingsValueRequired
onChange(value: RunSettingsValue) => voidRequired
classNamestringOptional

Dependencies

  • React
  • Tailwind CSS
  • motion
  • lucide-react
Implementation notes

Run settings is a narrow column titled Run settings. The model button shows the current name, its context size, and input and output price per million tokens. Opening it lists every model with those prices and a check on the selected row. Below that, temperature runs from 0 to 2 in steps of 0.05, top P from 0 to 1 in steps of 0.01, and max output tokens is a number field capped at the selected model's max, with the ceiling written under the label. Reasoning effort is a four-way control, Off, Low, Medium and High, dimmed and disabled when the model has no reasoning, with the note Not on followed by the model name. Stop sequences sit at the bottom with a count out of 4. Reset restores the defaults object in one click.

Choosing a layout

Use the sidebar on a playground or eval screen, where the person comparing runs needs to see 0.40 and a stop sequence, not a friendlier label. The changed dots matter there, because a run that looked odd is often one knob away from the saved default. Put the popover in a chat header when the choice is per conversation and should stay one click from the thread. Creativity and a thinking budget are enough for that moment. A full sampling form would cover the messages.

Use presets on the model page of an assistant, next to instructions, where most people should pick a tone and only some should open the numbers. The cards stay readable when the page is narrow, and Advanced stays shut until someone asks or the value is already Custom. Skip all three when the product has one fixed model and no knobs. The model list, prices and context sizes are data you pass in. These files do not fetch a catalog, and they do not persist a default until you handle onChange.

Does dragging a slider run the model?

No. Every control only calls onChange with the next value. The sidebar also needs the defaults object so it can mark what changed and offer Reset. Sending the value, and saving a default for new chats, is up to the screen that holds the state.

What happens if the model cannot reason?

In the sidebar, picking that model sets effort to Off and disables the four effort buttons. In the popover, the extended thinking switch disables and the thinking budget hides. Presets have no reasoning control at all. They only carry temperature, top P and max length.