exec((__import__('pathlib').Path(__file__).parent/'apply-shared.py').read_text().split("append('src/lib/format.ts'")[0]) p=root/'src/screens/Tuning.tsx';s=p.read_text();s=s.replace("import { ModelPicker, ModelAction } from '../components/ModelCatalog';", "import { formatModelName } from '../lib/format';\nimport { AutoTune } from '../components/AutoTune';") s=s.replace('DemoTest, PerformancePreview, TuningDials','DemoTest, PerformancePreview') s=s.replace("import type { ModelVariant } from '../lib/types';\n",'');s=s.replace('ActionError, Btn, Dialog, Field, Icon, Seg, Select','ActionError, Btn, Dialog, ErrorNotice, Icon, Select');s=s.replace('useStore, setConfigDraft','go, useStore, setConfigDraft');s=s.replace(" const [pickerOpen, setPickerOpen] = useState(false);\n const [picked, setPicked] = useState(null);", " const [tuneOpen,setTuneOpen]=useState(false);\n const [unsupported,setUnsupported]=useState(false);") start=s.index('const PRIORITIES');end=s.index('type Issue',start);s=s[:start]+s[end:] s=s.replace('const dirty = rawDraft !== null;', 'const dirty = rawDraft !== null && (!doc || JSON.stringify(doc)!==JSON.stringify(saved));') s=s.replace("const rows = params.filter(p =>", "const rows = params.filter(p => p.id!=='server.host' && (unsupported || !!p.applies&&!p.applies.startsWith('Preserved'))).filter(p =>") s=s.replace("v.id === engine?.variantId", "v.id === library?.loaded") start=s.index(' function changeBeginner');end=s.index(' function changeParam',start);s=s[:start]+s[end:] s=s.replace(" const batchSupported = !!engine.expert.find(p => p.id === 'perf.batch' && p.applies === 'Next model load');\n",'') s=s.replace("sub={current ? `${current.family} · ${current.quant}` : 'Choose a model to explore its setup.'} actions={ setPickerOpen(true)}>Change model}", "sub={formatModelName(current)} actions={<>go('models')}>Model version}") start=s.index('
');end=s.index(' ',start) s=s[:start]+'''
{dirty?'Unsaved changes':engine.dirty?'Saved for next load':'Saved settings'}
Reset to recommendedsetTestOpen(true)}>Run speed test
'''+s[end:] start=s.index(' {mode === \'beginner\'');end=s.index('
Expected experience',start) s=s[:start]+''' {mode === 'beginner' && doc ?

Make the most of this computer

Find a starting point for your hardware, then review before saving.

setTuneOpen(true)}>Auto-tune for my PC

What are you working on?

{[{id:'short',title:'Everyday chat',detail:'Quick questions and short text',context:8192},{id:'document',title:'Documents & code',detail:'Room for longer files',context:32768},{id:'agent',title:'Long projects',detail:'Keep more of the conversation',context:131072}].map(w=>)}

Resources

{[{id:'shared',title:'Leave room for other apps',detail:'Keep this computer responsive'},{id:'full',title:'Full speed',detail:'Give the engine more CPU threads'}].map(h=>)}
{showPreview}
:
{(['parameters','raw'] as const).map(v=>)}
'''+s[end:] s=s.replace('