-
-
llama
+
+
+
-
serve
+
+
- -hf
+
+ or download from your terminal
+
- {modelId}{commandMainQuant ? ':' : ''}
-
-
- {#if baseOptions.length}
-
- {/if}
-
-
- {#if draftEntry && draftSidecar}
- -hfd
-
- {modelId}{commandDraftQuant ? ':' : ''}
-
-
-
- --spec-type
-
- {SPEC_TYPE[draftSidecar]}
- {/if}
-
-
-
+
-
+
setPick('main', path)}
+ onDraftPick={(path) => setPick('draft', path)}
+ specType={draftEntry && draftSidecar ? SPEC_TYPE[draftSidecar] : null}
+ />
{/if}
diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadButton.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadButton.svelte
new file mode 100644
index 0000000000..ae01397a3f
--- /dev/null
+++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadButton.svelte
@@ -0,0 +1,18 @@
+
+
+
diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadCommand.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadCommand.svelte
new file mode 100644
index 0000000000..5c60c3afd3
--- /dev/null
+++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsDownloadCommand.svelte
@@ -0,0 +1,124 @@
+
+
+
+
$
+
+
+ llama
+
+ serve
+
+ -hf
+
+ {modelId}{mainQuant ? ':' : ''}
+
+
+ {#if baseOptions.length}
+
+ {/if}
+
+
+ {#if specType !== null}
+ -hfd
+
+ {modelId}{draftQuant ? ':' : ''}
+
+
+
+ --spec-type
+
+ {specType}
+ {/if}
+
+
+
+
diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsQuantToggle.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsQuantToggle.svelte
new file mode 100644
index 0000000000..cb613355d9
--- /dev/null
+++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsQuantToggle.svelte
@@ -0,0 +1,109 @@
+
+
+
+
+ {#if state.isDownloaded}
+
+
+ {#if meta?.sidecar && !isAuxSidecar(meta.sidecar)}
+
+ {meta.sidecar}
+
+ {/if}
+
+ {label}
+
+
+
+ {HuggingFaceService.formatFileSize(file.size ?? 0)}
+
+
+
+ {:else}
+
+ {#if state.isFailed && !state.isDownloading}
+
+ Failed
+
+ {/if}
+
+ {#if meta?.sidecar && !isAuxSidecar(meta.sidecar)}
+
+ {meta.sidecar}
+
+ {/if}
+
+ {label}
+
+
+
+
+ {#if state.isDownloading && state.progress && state.progress.totalBytes > 0}
+ {Math.round((state.progress.downloadedBytes / state.progress.totalBytes) * 100)}%
+ {:else}
+ {HuggingFaceService.formatFileSize(file.size ?? 0)}
+ {/if}
+
+
+ {#if state.isDownloading && state.progress}
+
+ {/if}
+
+ {/if}
+
+
+
+ {tooltipText}
+
+
diff --git a/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsRow.svelte b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsRow.svelte
new file mode 100644
index 0000000000..85a62a66cb
--- /dev/null
+++ b/tools/ui/src/lib/components/app/models/discover/ModelsDiscoverModelDetailsDownloadOptionsRow.svelte
@@ -0,0 +1,42 @@
+
+
+
+
+ {#if bitDepth === 99}
+ Other
+ {:else}
+ {bitDepth}-bit
+ {/if}
+
+ {#if mainMemGb}
+
+ needs at least {mainMemGb}GB{draftMemGb ? ` + ${draftMemGb}GB` : ''}+ memory
+
+ {/if}
+
+
+
+ {#each files as file (file.path)}
+
+ {/each}
+
+
diff --git a/tools/ui/src/lib/components/app/models/discover/download-options.utils.ts b/tools/ui/src/lib/components/app/models/discover/download-options.utils.ts
new file mode 100644
index 0000000000..a76ca621fd
--- /dev/null
+++ b/tools/ui/src/lib/components/app/models/discover/download-options.utils.ts
@@ -0,0 +1,51 @@
+import { isAuxSidecar } from '$lib/constants';
+import { HuggingFaceService } from '$lib/services';
+import type { HfModelSibling } from '$lib/types/huggingface';
+
+/** Download state of a single repo entry, injected by the integration layer. */
+export interface DownloadEntryState {
+ isDownloading: boolean;
+ progress: ModelDownloadProgress | null;
+ isDownloaded: boolean;
+ isFailed: boolean;
+}
+
+export type BitDepthRow = { bitDepth: number; files: HfModelSibling[] };
+
+/** A selectable GGUF, tagged with its kind: main weights, draft, or aux (mmproj). */
+export type SelectableFile = HfModelSibling & { kind: 'main' | 'draft' | 'aux' };
+
+/** Option of a quant `