// DevPanel.jsx — right rail. Controlled by settings prop from App. function DevPanel({ settings, onChangeSettings, usage }) { const [tab, setTab] = React.useState('params'); const temp = (settings && typeof settings.default_temp === 'number') ? settings.default_temp : 0.2; const topP = (settings && typeof settings.default_top_p === 'number') ? settings.default_top_p : 0.95; const maxTok = (settings && typeof settings.default_max_tokens === 'number') ? settings.default_max_tokens : 512; const serverUrl = (window.API && window.API.serverUrl) || 'http://127.0.0.1:8000'; const llmUrl = (window.API && window.API.llmUrl) || 'http://100.106.148.2:8091'; // Live model identity from /v1/models. The Rust proxy ignores client-side // `model` and always serves whatever the M3 sidecar has loaded — so picking // from a static dropdown would be misleading. Show what's actually live and // let the LLM team rotate it via CPN_VERSION on the sidecar. const [liveModel, setLiveModel] = React.useState(null); React.useEffect(() => { let cancelled = false; window.API.liveModel().then(id => { if (!cancelled) setLiveModel(id); }); return () => { cancelled = true; }; }, []); const model = liveModel || (settings && settings.default_model) || 'GBR-LM'; const set = (k, v) => onChangeSettings && onChangeSettings({ [k]: v }); return ( ); } window.DevPanel = DevPanel;