diff --git a/www/src/routes/models/+page.svelte b/www/src/routes/models/+page.svelte index 5b79cdd0..907dde28 100644 --- a/www/src/routes/models/+page.svelte +++ b/www/src/routes/models/+page.svelte @@ -49,6 +49,18 @@ let error = ''; let copiedModelId: string | null = null; let copiedCliCommandId: string | null = null; + let detectedOs: 'windows' | 'macos' | 'linux' | 'other' = 'other'; + let showAllPlatforms = false; + + $: visibleInstallLinks = showAllPlatforms + ? CLI_INSTALL_LINKS + : detectedOs === 'windows' + ? CLI_INSTALL_LINKS.filter((i) => i.id === 'windows-cli') + : detectedOs === 'macos' + ? CLI_INSTALL_LINKS.filter((i) => i.id === 'macos-cli') + : detectedOs === 'linux' + ? CLI_INSTALL_LINKS.filter((i) => i.id === 'linux-cli') + : CLI_INSTALL_LINKS; // Modal state let selectedModel: GroupedFoundryModel | null = null; @@ -473,6 +485,14 @@ } onMount(() => { + // Detect OS for the CLI install panel + if (typeof navigator !== 'undefined') { + const ua = navigator.userAgent; + if (/Win/i.test(ua)) detectedOs = 'windows'; + else if (/Mac/i.test(ua)) detectedOs = 'macos'; + else if (/Linux|X11/i.test(ua)) detectedOs = 'linux'; + } + // Read initial filter state from URL before fetching suppressUrlUpdate = true; readFiltersFromUrl(); @@ -513,21 +533,31 @@ class="border-border/50 bg-muted/30 mb-4 rounded-lg border px-3 py-2.5 sm:px-4" aria-label="CLI quick test" > -
+
- {#each CLI_INSTALL_LINKS as item} + {#each visibleInstallLinks as item} diff --git a/www/src/routes/models/components/ModelCard.svelte b/www/src/routes/models/components/ModelCard.svelte index 1f238aed..5c5ea96c 100644 --- a/www/src/routes/models/components/ModelCard.svelte +++ b/www/src/routes/models/components/ModelCard.svelte @@ -1,87 +1,39 @@ @@ -183,157 +135,59 @@ {/if}
- -
+ +
{#if isSpeechToText} - -
- +
+ SDK only + Not available via CLI
- {:else if uniqueVariants.length > 0} -
-
- Copy Run Command: + {:else} +
+
+ Run with CLI
- - - - - {#snippet child({ props })} - - {/snippet} - - - - {formatModelCommand(genericModelName)} - - - - - -
- {#each uniqueVariants as variant (variant.name)} - - - {#snippet child({ props })} - - {/snippet} - - - - {formatModelCommand(variant.name)} - - - - {/each} +
+ + foundry run {genericModelName} + +
{/if} +
+
+ Starter code +
+ +