Pick the model that answers: grouped, searchable, with what each is good at, its context size and a cost hint.
Quill
Quill 4. Vision, Reasoning, Tools. 200K tokens of context. $3 in, $15 out per million tokens. Default for new chats
Quill 4 Mini. Fast, Vision. 128K tokens of context. $0.25 in, $1.25 out per million tokens
Quill 4 Deep. Reasoning, Tools. 200K tokens of context. $15 in, $75 out per million tokens
Ember
Ember Pro. Vision, Files. 1M tokens of context. $2.50 in, $10 out per million tokens
Ember Flash. Fast, Files. 1M tokens of context. $0.10 in, $0.40 out per million tokens
Open models
Atlas Vision. Vision, Reasoning. 64K tokens of context. $1 in, $4 out per million tokens. On the Pro plan
New chats start with Quill 4.
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { ModelPicker } from "./ui/uicontext/components/chat/ModelPicker.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, space } from "./ui/uicontext/components/tokens.stylex.ts"import { chatModels } from "./ai-chat.ts"const Message = UiSchema.TaggedEnum({ PickedModel: { model: Schema.String }, SavedDefault: { model: Schema.String } })const styles = stylex.create({ frame: { display: "grid", gap: space.md, justifyItems: "start" }, note: { margin: 0, color: color.muted, fontSize: font.sm },})export const ModelPickerDemo = Html.component({ name: "ModelPickerDemo", model: Schema.Struct({ model: Schema.String, fallback: Schema.String }), message: Message,}).make({ init: () => ({ model: "quill-4", fallback: "quill-4" }), update: { PickedModel: ($, { model }) => $.evolve({ model }), SavedDefault: ($, { model }) => $.evolve({ fallback: model }), }, view: (h, model) => h.div.attrs(sx(styles.frame)).children( ModelPicker(h, { props: { models: chatModels, value: model.model, defaultModel: model.fallback }, onEmit: { Picked: ({ model: picked }) => Message.PickedModel({ model: picked }), RequestedDefault: ({ model: picked }) => Message.SavedDefault({ model: picked }) }, }), h.p.attrs(sx(styles.note)).children(`New chats start with ${chatModels.find((m) => m.id === model.fallback)?.name ?? "—"}.`), ),})Installation
pnpm dlx shadcn@latest add checkfu/uicontext/model-pickerUsage
import { ModelPicker } from "./ui/uicontext/components/chat/ModelPicker.ts"import type { ChatModel } from "./ui/uicontext/components/domain/Chat.ts"const Message = UiSchema.TaggedEnum({ PickedModel: { model: Schema.String }, SavedDefaultModel: { model: Schema.String } })// the chat owns its model; the account owns the default for new chatsexport const ChatModelPicker = (h: Html.H<typeof Message.Type>, models: ReadonlyArray<ChatModel>, chat: string, fallback: string) => ModelPicker(h, { props: { models, value: chat, defaultModel: fallback }, onEmit: { Picked: ({ model }) => Message.PickedModel({ model }), RequestedDefault: ({ model }) => Message.SavedDefaultModel({ model }), }, })Examples
In the composer
The composer's tools slot holds the picker beside the attach button; the list opens upward from the bottom of the screen.
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { ModelPicker } from "./ui/uicontext/components/chat/ModelPicker.ts"import { Composer } from "./ui/uicontext/components/kit/Composer.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { chatModels } from "./ai-chat.ts"const Message = UiSchema.TaggedEnum({ PickedModel: { model: Schema.String } })const styles = stylex.create({ frame: { inlineSize: "min(100%, 40rem)", paddingTop: "16rem" } })export const ComposerModelPicker = Html.component({ name: "ComposerModelPicker", model: Schema.Struct({ model: Schema.String }), message: Message,}).make({ init: () => ({ model: "ember-pro" }), update: { PickedModel: ($, { model }) => $.evolve({ model }) }, view: (h, model) => h.div.attrs(sx(styles.frame)).children( Composer(h, { props: { label: "Message the assistant", placeholder: "Ask anything", attachments: true, hints: false }, onEmit: { Sent: () => undefined, Attached: () => undefined, RequestedStop: () => undefined, RequestedEditLast: () => undefined, Drafted: () => undefined }, slots: { tools: ModelPicker(h, { props: { models: chatModels, value: model.model, side: "top" }, onEmit: { Picked: ({ model: picked }) => Message.PickedModel({ model: picked }), RequestedDefault: () => undefined }, }), }, }), ),})API reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
modelsrequired | ChatModel[] | — | — |
valuerequired | string | — | The conversation's model |
defaultModel | string | — | The model new chats start with; marked in the list |
label | string | "Model" | What it picks, for screen readers and agents: "Model" by default |
agentId | string | — | This picker's id for agents, unique on the page |
disabled | boolean | — | — |
align | "start" | "end" | "start" | Which edge of the button the list lines up with: "start" by default |
side | "top" | "bottom" | — | Open upward, as from a composer at the bottom of the screen |
Events
| Event | Payload | Description |
|---|---|---|
Picked | { model: string } | The person picked a model for this conversation |
RequestedDefault | { model: string } | Make model the one new chats start with |
Agent actions
| Action | Description |
|---|---|
PickedModel | Answer with another model, by its id (see the choices) |