{ if (e.target === e.currentTarget) onClose(); }} >
Commit AI
AI settings
{ e.preventDefault(); void handleSave(); }}>
{ provider = "local"; }}>
Local AI
{ provider = "openai"; }}>
OpenAI
{ provider = "anthropic"; }}>
Anthropic (Claude)
{ provider = "custom"; }}>
Custom endpoint
{#if provider === "local"}
Model
{#each localModels as option (option.id)}
{option.label} — {formatSize(option.approx_size_mb)}
{/each}
Switching downloads the model{selectedLocalModel ? ` (${formatSize(selectedLocalModel.approx_size_mb)})` : ""} in the background — depending on your internet connection this can take several minutes. After that it stays cached locally and loads instantly on the next start.
{:else if provider === "openai"}
Model
API key
{ showKey = !showKey; }} aria-label={showKey ? "Hide" : "Show"}> {#if showKey}
{:else}
{/if}
{:else if provider === "anthropic"}
Model
API key
{ showKey = !showKey; }} aria-label={showKey ? "Hide" : "Show"}> {#if showKey}
{:else}
{/if}
{:else}
Endpoint URL
Model
API key (optional)
{ showKey = !showKey; }} aria-label={showKey ? "Hide" : "Show"}> {#if showKey}
{:else}
{/if}
For local OpenAI-compatible servers like Ollama or LM Studio. The base URL should end in /v1.
{/if} {#if error}
{error}
{/if}
Cancel
{#if saving}
{:else}
{/if} Save