{#if ollamaEnabled} {#if ollamaVersion !== null}
{$i18n.t('Manage Ollama Models')}
{#if OLLAMA_URLS.length > 0}
{#each OLLAMA_URLS as url, idx}
{url}
{/each}
{ updateModelsHandler(); }} >
{#if updateModelId} Updating "{updateModelId}" {updateProgress ? `(${updateProgress}%)` : ''} {/if} {/if}
{$i18n.t('Pull a model from Ollama.com')}
{ pullModelHandler(); }} disabled={modelTransferring} > {#if modelTransferring}
{:else}
{/if}
{$i18n.t('To access the available model names for downloading,')}
{$i18n.t('click here.')}
{#if Object.keys($MODEL_DOWNLOAD_POOL).length > 0} {#each Object.keys($MODEL_DOWNLOAD_POOL) as model} {#if 'pullProgress' in $MODEL_DOWNLOAD_POOL[model]}
{model}
{$MODEL_DOWNLOAD_POOL[model].pullProgress ?? 0}%
{ cancelModelPullHandler(model); }} >
{#if 'digest' in $MODEL_DOWNLOAD_POOL[model]}
{$MODEL_DOWNLOAD_POOL[model].digest}
{/if}
{/if} {/each} {/if}
{$i18n.t('Delete a model')}
{#if !deleteModelTag}
{$i18n.t('Select a model')}
{/if} {#each $models.filter((m) => !(m?.preset ?? false) && m.owned_by === 'ollama' && (selectedOllamaUrlIdx === null ? true : (m?.ollama?.urls ?? []).includes(selectedOllamaUrlIdx))) as model}
{model.name + ' (' + (model.ollama.size / 1024 ** 3).toFixed(1) + ' GB)'}
{/each}
{ deleteModelHandler(); }} >
{$i18n.t('Create a model')}
"\nPARAMETER stop "USER:"\nPARAMETER stop "ASSISTANT:"`} disabled={createModelLoading} />
{ createModelHandler(); }} disabled={createModelLoading} >
{#if createModelDigest !== ''}
{createModelTag}
{createModelPullProgress ?? 0}%
{#if createModelDigest}
{createModelDigest}
{/if}
{/if}
{$i18n.t('Experimental')}
{ showExperimentalOllama = !showExperimentalOllama; }}>{showExperimentalOllama ? $i18n.t('Hide') : $i18n.t('Show')}
{#if showExperimentalOllama}
{ uploadModelHandler(); }} >
{$i18n.t('Upload a GGUF model')}
{ if (modelUploadMode === 'file') { modelUploadMode = 'url'; } else { modelUploadMode = 'file'; } }} type="button" > {#if modelUploadMode === 'file'}
{$i18n.t('File Mode')}
{:else}
{$i18n.t('URL Mode')}
{/if}
{#if modelUploadMode === 'file'}
{ console.log(modelInputFile); }} accept=".gguf,.safetensors" required hidden />
{ modelUploadInputElement.click(); }} > {#if modelInputFile && modelInputFile.length > 0} {modelInputFile[0].name} {:else} {$i18n.t('Click here to select')} {/if}
{:else}
{/if}
{#if (modelUploadMode === 'file' && modelInputFile && modelInputFile.length > 0) || (modelUploadMode === 'url' && modelFileUrl !== '')}
{#if modelTransferring}
{:else}
{/if}
{/if}
{#if (modelUploadMode === 'file' && modelInputFile && modelInputFile.length > 0) || (modelUploadMode === 'url' && modelFileUrl !== '')}
{$i18n.t('Modelfile Content')}
{/if}
{$i18n.t('To access the GGUF models available for downloading,')}
{$i18n.t('click here.')}
{#if uploadMessage}
{$i18n.t('Upload Progress')}
{uploadMessage}
{modelFileDigest}
{:else if uploadProgress !== null}
{$i18n.t('Upload Progress')}
{uploadProgress ?? 0}%
{modelFileDigest}
{/if}
{/if}
{:else if ollamaVersion === false}
Ollama Not Detected
{:else}
{/if} {:else if ollamaEnabled === false}
Ollama API is disabled
{:else}
{/if}