YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
add cost tier badges and warnings to model selector UI
Louis Beaumont10d6523f0ec8
diff --git a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsxindex 63070d166..c1e517053 100644--- a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx@@ -192,7 +192,7 @@ export function AIProviderConfig({const [showApiKey, setShowApiKey] = useState(false);const isEnterprise = useIsEnterpriseBuild();const [piAvailable, setPiAvailable] = useState(false);- const [piModels, setPiModels] = useState<{ id: string; name: string; free?: boolean; health?: { status: string; error_rate_5m: number } }[]>([]);+ const [piModels, setPiModels] = useState<{ id: string; name: string; free?: boolean; cost_tier?: string; recommended_for?: string[]; warning?: string; health?: { status: string; error_rate_5m: number } }[]>([]);// Fetch PI models from gateway (single source of truth)useEffect(() => {@@ -209,6 +209,9 @@ export function AIProviderConfig({id: m.id,name: m.name || m.id,free: m.free,+ cost_tier: m.cost_tier,+ recommended_for: m.recommended_for,+ warning: m.warning,health: m.health,}));setPiModels(models);@@ -821,18 +824,34 @@ export function AIProviderConfig({<SelectValue placeholder="select model" /></SelectTrigger><SelectContent>- {piModels.map((m) => (+ {piModels.map((m) => {+ const costLabel = m.cost_tier === 'low' ? '$' : m.cost_tier === 'medium' ? '$$' : m.cost_tier === 'high' ? '$$$' : m.cost_tier === 'very_high' ? '$$$$' : '';+ return (<SelectItem key={m.id} value={m.id}><span className="flex items-center gap-1.5">{m.health?.status === 'down' && <span className="inline-block w-1.5 h-1.5 rounded-full bg-red-500" title="overloaded" />}{m.health?.status === 'degraded' && <span className="inline-block w-1.5 h-1.5 rounded-full bg-yellow-500" title="degraded" />}{m.name}{m.free ? " (free)" : ""}+ {costLabel && <span className="text-[9px] font-medium text-muted-foreground">{costLabel}</span>}+ {m.recommended_for?.includes('pipes') && <span className="text-[9px] text-muted-foreground bg-muted rounded px-1">pipes</span>}{m.health?.status === 'down' && <span className="text-[9px] text-red-400 ml-1">overloaded</span>}</span></SelectItem>- ))}+ );+ })}</SelectContent></Select>+ {(() => {+ const selectedModel = piModels.find((m) => m.id === formData.model);+ if (selectedModel?.warning) {+ return (+ <p className="text-[10px] text-muted-foreground mt-1">+ ! {selectedModel.warning}+ </p>+ );+ }+ return null;+ })()}</div>)}@@ -1513,6 +1532,13 @@ export const AIPresetsSelector = ({<span className="truncate max-w-[120px]">{preset.model}</span>+ {(() => {+ const m = piModels.find((pm) => pm.id === preset.model);+ if (!m) return null;+ const label = m.cost_tier === 'low' ? '$' : m.cost_tier === 'medium' ? '$$' : m.cost_tier === 'high' ? '$$$' : m.cost_tier === 'very_high' ? '$$$$' : m.free ? 'free' : '';+ const color = 'text-muted-foreground';+ return label ? <span className={`text-[9px] font-medium ${color}`}>{label}</span> : null;+ })()}</div><div className="flex items-center gap-1"><Buttondiff --git a/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx b/apps/screenpipe-app-tauri/components/settings/ai-presets.tsxindex 201035d17..729b9a663 100644--- a/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx+++ b/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx@@ -158,6 +158,9 @@ export interface AIModel {best_for?: string[];speed?: string;intelligence?: string;+ cost_tier?: 'free' | 'low' | 'medium' | 'high' | 'very_high';+ recommended_for?: string[];+ warning?: string;}export const AIProviderCard = ({@@ -1326,7 +1329,9 @@ const AISection = ({</CommandGroup>)}<CommandGroup heading={models?.some((m) => m.free) ? "Included with Screenpipe" : "Available Models"}>- {models?.filter((m) => !m.free).map((model) => (+ {models?.filter((m) => !m.free).map((model) => {+ const costLabel = model.cost_tier === 'low' ? '$' : model.cost_tier === 'medium' ? '$$' : model.cost_tier === 'high' ? '$$$' : model.cost_tier === 'very_high' ? '$$$$' : '';+ return (<CommandItemkey={model.id}value={model.id}@@ -1356,17 +1361,24 @@ const AISection = ({<div className="flex items-center justify-between"><span className="font-medium">{model.name}</span><div className="flex items-center gap-1 ml-2">- {model.intelligence === "highest" && <Badge variant="outline" className="text-[10px]">smartest</Badge>}- {model.speed === "fast" && model.intelligence !== "highest" && <Badge variant="outline" className="text-[10px]">fast</Badge>}- {model.tags?.includes("reasoning") && model.intelligence !== "highest" && <Badge variant="outline" className="text-[10px]">reasoning</Badge>}+ {costLabel && <Badge variant="outline" className="text-[10px]">{costLabel}</Badge>}+ {model.speed === "fast" && <Badge variant="outline" className="text-[10px]">fast</Badge>}</div></div>- {model.description && (- <span className="text-xs text-muted-foreground">{model.description}{model.context_window ? ` · ${Math.round(model.context_window / 1000)}K ctx` : ""}</span>+ <span className="text-xs text-muted-foreground">+ {model.description}{model.context_window ? ` · ${Math.round(model.context_window / 1000)}K ctx` : ""}+ </span>+ {model.recommended_for && model.recommended_for.length > 0 && (+ <div className="flex items-center gap-1 mt-0.5">+ {model.recommended_for.map((use) => (+ <span key={use} className="text-[9px] rounded bg-muted px-1 py-0.5 text-muted-foreground">{use}</span>+ ))}+ </div>)}</div></CommandItem>- ))}+ );+ })}</CommandGroup></>)}@@ -1374,6 +1386,35 @@ const AISection = ({</Command></PopoverContent></Popover>+ {(() => {+ const selectedModel = models?.find((m) => m.id === settingsPreset?.model);+ if (selectedModel?.warning) {+ return (+ <div className="flex items-start gap-2 rounded-md border p-3 text-xs text-muted-foreground">+ <span className="shrink-0 text-sm">!</span>+ <div className="space-y-1">+ <p>{selectedModel.warning}</p>+ {models?.filter((m) => m.recommended_for?.includes('pipes') && m.id !== selectedModel.id).slice(0, 2).length > 0 && (+ <p className="text-muted-foreground">+ recommended for pipes:{" "}+ {models.filter((m) => m.recommended_for?.includes('pipes') && m.id !== selectedModel.id).slice(0, 3).map((m) => (+ <button+ key={m.id}+ type="button"+ className="inline-flex items-center rounded bg-muted px-1.5 py-0.5 mr-1 font-medium hover:bg-accent cursor-pointer"+ onClick={() => updateSettingsPreset({ model: m.id })}+ >+ {m.name} {m.free ? "(free)" : ""}+ </button>+ ))}+ </p>+ )}+ </div>+ </div>+ );+ }+ return null;+ })()}{settingsPreset?.provider === "native-ollama" && (<div className="text-xs text-muted-foreground space-y-1"><p>diff --git a/packages/ai-gateway/src/handlers/models.ts b/packages/ai-gateway/src/handlers/models.tsindex 7e489320f..525f7d776 100644--- a/packages/ai-gateway/src/handlers/models.ts+++ b/packages/ai-gateway/src/handlers/models.ts@@ -21,6 +21,12 @@ interface ModelEntry {best_for: string[];speed: 'fast' | 'medium' | 'slow';intelligence: 'standard' | 'high' | 'highest';+ /** Relative cost indicator — drives UI badges, no exact prices shown */+ cost_tier: 'free' | 'low' | 'medium' | 'high' | 'very_high';+ /** Where this model shines — drives recommendation pills in UI */+ recommended_for: ('pipes' | 'chat' | 'coding' | 'analysis')[];+ /** Optional warning shown when model is selected (e.g. for expensive models) */+ warning?: string;/** Live health status from rolling 5-minute error rate */health?: ModelHealthStatus;}@@ -40,6 +46,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['coding', 'reasoning', 'tool use'],speed: 'fast',intelligence: 'highest',+ cost_tier: 'free',+ recommended_for: ['pipes', 'chat', 'coding'],},{id: 'glm-5',@@ -53,6 +61,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['complex reasoning', 'analysis'],speed: 'medium',intelligence: 'highest',+ cost_tier: 'free',+ recommended_for: ['chat', 'analysis'],},{id: 'kimi-k2.5',@@ -66,6 +76,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['reasoning', 'general'],speed: 'medium',intelligence: 'high',+ cost_tier: 'free',+ recommended_for: ['pipes', 'chat'],},{id: 'gemini-3-flash',@@ -79,6 +91,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['general', 'search'],speed: 'fast',intelligence: 'high',+ cost_tier: 'free',+ recommended_for: ['pipes', 'chat'],},// ── Included with screenpipe ──{@@ -93,6 +107,9 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['complex tasks', 'analysis'],speed: 'slow',intelligence: 'highest',+ cost_tier: 'very_high',+ recommended_for: ['chat', 'analysis'],+ warning: 'very expensive — will quickly use your daily limit. use haiku or a free model for pipes',},{id: 'claude-sonnet-4-5',@@ -106,6 +123,9 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['general', 'coding'],speed: 'medium',intelligence: 'high',+ cost_tier: 'high',+ recommended_for: ['chat', 'coding'],+ warning: 'expensive — consider haiku or a free model for pipes',},{id: 'claude-haiku-4-5',@@ -119,6 +139,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['quick tasks', 'pipes'],speed: 'fast',intelligence: 'standard',+ cost_tier: 'low',+ recommended_for: ['pipes', 'chat', 'coding'],},{id: 'qwen/qwen3.5-flash-02-23',@@ -132,6 +154,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['long documents', 'pipes'],speed: 'fast',intelligence: 'standard',+ cost_tier: 'low',+ recommended_for: ['pipes', 'chat'],},{id: 'deepseek/deepseek-chat',@@ -145,6 +169,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['reasoning', 'coding'],speed: 'medium',intelligence: 'high',+ cost_tier: 'low',+ recommended_for: ['pipes', 'chat', 'coding'],},{id: 'deepseek/deepseek-v3.2-speciale',@@ -158,6 +184,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['complex reasoning'],speed: 'slow',intelligence: 'highest',+ cost_tier: 'medium',+ recommended_for: ['chat', 'analysis'],},{id: 'qwen/qwen3.5-397b-a17b',@@ -171,6 +199,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['vision', 'complex tasks'],speed: 'slow',intelligence: 'highest',+ cost_tier: 'high',+ recommended_for: ['chat', 'analysis'],},{id: 'meta-llama/llama-4-scout',@@ -184,6 +214,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['general', 'pipes'],speed: 'fast',intelligence: 'standard',+ cost_tier: 'low',+ recommended_for: ['pipes', 'chat'],},{id: 'meta-llama/llama-4-maverick',@@ -197,6 +229,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['reasoning', 'coding'],speed: 'medium',intelligence: 'high',+ cost_tier: 'medium',+ recommended_for: ['chat', 'coding'],},{id: 'gemini-3.1-pro',@@ -210,6 +244,8 @@ const CURATED_MODELS: ModelEntry[] = [best_for: ['reasoning', 'long documents'],speed: 'medium',intelligence: 'high',+ cost_tier: 'medium',+ recommended_for: ['chat', 'analysis'],},];