{#snippet systemPromptField(value: string, onInput: (v: string) => void, placeholder: string)}
{$t('models.systemPrompt')}
{#if value.trim()} {/if}
{#if showVariables}
{#each TEMPLATE_VARIABLES as v}
{`{{${v.name}}}`} {v.desc}
{/each}
{/if}
{/snippet} {#snippet paramRows(rows: ParamRow[], onInput: () => void, onRemove: (i: number) => void, onAdd: () => void)}
request params {#each rows as row, i}
{/each}
{/snippet}
{#if loading}
{:else}

{$t('admin.models')}

{#if globalExpanded} {@render systemPromptField( globalSystemPrompt, (v) => { globalSystemPrompt = v; globalDirty = true; }, DEFAULT_PROMPT_PLACEHOLDER )} {@render paramRows( globalRows, () => (globalDirty = true), (i) => { globalRows = globalRows.filter((_, idx) => idx !== i); globalDirty = true; }, () => { globalRows = [...globalRows, { key: '', value: '' }]; globalDirty = true; } )} {/if} {#each models as model} {#if selectedId === model.id} {@render systemPromptField( model.systemPrompt, (v) => { model.systemPrompt = v; model.dirty = true; }, $t('models.systemPromptInherited') )} {@render paramRows( model.rows, () => (model.dirty = true), (i) => { model.rows = model.rows.filter((_, idx) => idx !== i); model.dirty = true; }, () => { model.rows = [...model.rows, { key: '', value: '' }]; model.dirty = true; } )} {/if} {/each} {#if models.length === 0}

{$t('models.noModels')}

{/if}
{/if}