Settings / Model Policy

Where a workspace decides how it uses AI models: which model does which job, what takes over when one fails, how much may be spent and by whom, and how long prompts are kept. Every change shows what it would have cost.

Get pro lifetime to installPro screen · 4 examples · built from 7 Liro components
Open full screen

When to use

  • Admin settings of an AI product with more than one model
  • Controlling AI spend per workspace or per member
  • Setting fallbacks for when a provider fails

When not to use

The decision inside it

Every change is priced on last month's real usage

Switching a default or a cap shows what the last 30 days would have cost and how fast replies would have been, before saving. Teams choose on evidence from their own traffic, not on list prices.

Installation

Settings / Model Policy is a Pro screen, included with pro lifetime. It is two files on top of the Liro components it is made of.

  1. Add the components it uses:
    npx shadcn@latest add @liro/alert @liro/state @liro/badge @liro/button @liro/input @liro/segmented-control @liro/select
  2. Copy screens/model-policy-screen.tsx and screens/data/model-policy-screen.ts from the Code tab above into your project, at the same paths.
  3. It also imports @/lib, @/demos/liro-mark, @/demos/portraits, @/demos/screen-kit and @/demos/settings-shell: Liro’s shared helpers and the demo’s sample images. Point them at your own.

Usage

app/page.tsx
import { ModelPolicyScreen } from "@/screens/model-policy-screen";

export default function Page() {
  /* A screen fills the box it is given: give it the window. */
  return (
    <main className="h-dvh">
      <ModelPolicyScreen className="h-full" />
    </main>
  );
}

Built from

Every Liro component this screen imports. Each has its own page, props and install command.

API reference

Read from ModelPolicyScreenProps when the site is built. It also takes every attribute a div does, such as className.

ModelPolicyScreen

TypeNotes
stateModelPolicyState No–
onSave(policy: Policy) => void | Promise<void> No–
loadingboolean NoThe data is on its way: the frame stays and the content is drawn as gray shapes in the shape of the real page.
emptyboolean NoThere is nothing yet: each screen says what goes here and offers the one action that fills it.
onNavigate(label: string) => void NoCalled with the label of a sidebar or settings item when someone opens it ("Inbox", "Model policy"). Without it, a toast says where it would go.
workspaceScreenWorkspace NoThe workspace at the top of the sidebar.
userScreenUser NoThe signed-in person, at the bottom of the sidebar.
layoutScreenLayout No"inset": the page on a card beside a gray sidebar. "flat": the page edge to edge. Default "inset".
classNamestring No–

Accessibility

  • The cost preview is written out, not only shown as bars
  • Fallback order can be changed with buttons as well as dragging
  • Every field has a label and errors are announced
  • Movement follows the reduced-motion setting

Responsive behavior

  • Fills the box it is given: mount it at the window's height
  • The preview moves under each section on narrow widths
  • Light and dark come from the Liro theme: it follows the dark class on <html>, like every component.

More screens

Liro · 270 components · 17 screens · 4 templates