import React, { useEffect, useState } from 'react'; import { Sliders, Shield, DollarSign, Cpu, CheckCircle, Sun, Moon } from 'lucide-react'; import { fetchApi } from '../lib/api'; import { useTheme } from '../ThemeContext'; export const SettingsPage: React.FC = () => { const { theme, toggleTheme } = useTheme(); const [budget, setBudget] = useState<{ daily_limit: number; monthly_limit: number; per_request_limit: number; current_monthly_spend: number; intervention_mode: string; } | null>(null); useEffect(() => { fetchApi('/api/budgets').then(setBudget).catch(console.error); }, []); return (

SYSTEM CONFIGURATION & BUDGET GUARDS

Configure daily and monthly spend limits, routing threshold interventions, and environment parameters.

{/* Budget Management */}

Budget Thresholds & Automated Interventions

Intervention Mode: {budget?.intervention_mode || 'NORMAL'}
Monthly Limit ${budget?.monthly_limit?.toFixed(2) || '100.00'}
Current Monthly Spend ${budget?.current_monthly_spend?.toFixed(4) || '0.0000'}
Daily Limit ${budget?.daily_limit?.toFixed(2) || '10.00'}
{/* Budget Intervention Legend */}
< 80% Budget: Standard balanced multi-criteria routing
>= 80% Budget: Cost optimization weighting enabled
>= 95% Budget: Hard prefer local / zero-cost models
{/* Security & Secrets */}

Security Policy & Secrets Architecture

Model Router operates under a zero-secret-exposure contract. API tokens are stored only in environment files (.env), never stored as plain text in browser databases, and automatically redacted from server logs.

); };