Buckets:
gijl/lv-storage / llama.cpp /tools /ui /src /lib /components /app /models /ModelCapabilityIcons.svelte
| <script lang="ts"> | |
| import * as Tooltip from '$lib/components/ui/tooltip'; | |
| import { | |
| CAPABILITY_ICONS, | |
| CAPABILITY_LABELS, | |
| MODALITY_FLAG_KEYS, | |
| MODALITY_ICONS, | |
| MODALITY_LABELS, | |
| MODALITY_ORDER | |
| } from '$lib/constants'; | |
| import { ModelCapability } from '$lib/enums'; | |
| import type { ModelModalities } from '$lib/types/models'; | |
| interface Props { | |
| modalities?: ModelModalities; | |
| supportsThinking?: boolean; | |
| supportsToolUse?: boolean; | |
| hideCapabilities?: boolean; | |
| hideModalities?: boolean; | |
| iconSize?: string; | |
| gapClass?: string; | |
| } | |
| let { | |
| gapClass = 'gap-1.25', | |
| hideCapabilities = false, | |
| hideModalities = false, | |
| iconSize = 'h-3 w-3', | |
| modalities, | |
| supportsThinking = false, | |
| supportsToolUse = false | |
| }: Props = $props(); | |
| let capabilities = $derived([ | |
| ...(supportsToolUse ? [ModelCapability.TOOL_USE] : []), | |
| ...(supportsThinking ? [ModelCapability.REASONING] : []) | |
| ]); | |
| let shownModalities = $derived( | |
| MODALITY_ORDER.filter((modality) => modalities?.[MODALITY_FLAG_KEYS[modality]]) | |
| ); | |
| // an icon-less box still takes the gap where its icons would sit, so a caller with | |
| // nothing to show renders no box at all | |
| let hasIcons = $derived( | |
| (!hideCapabilities && capabilities.length > 0) || | |
| (shownModalities.length > 0 && !hideModalities) | |
| ); | |
| </script> | |
| {#if hasIcons} | |
| <span class="inline-flex items-center {gapClass}"> | |
| {#if !hideCapabilities} | |
| {#each capabilities as capability (capability)} | |
| { Icon = CAPABILITY_ICONS[capability]} | |
| <Tooltip.Root> | |
| <Tooltip.Trigger> | |
| <Icon class="{iconSize} text-muted-foreground" /> | |
| </Tooltip.Trigger> | |
| <Tooltip.Content> | |
| <p>{CAPABILITY_LABELS[capability]}</p> | |
| </Tooltip.Content> | |
| </Tooltip.Root> | |
| {/each} | |
| {/if} | |
| {#if shownModalities.length > 0 && !hideModalities} | |
| <span class="inline-flex items-center {gapClass} text-muted-foreground"> | |
| {#each shownModalities as modality (modality)} | |
| { Icon = MODALITY_ICONS[modality]} | |
| <Tooltip.Root> | |
| <Tooltip.Trigger> | |
| <Icon class={iconSize} /> | |
| </Tooltip.Trigger> | |
| <Tooltip.Content> | |
| <p>{MODALITY_LABELS[modality]}</p> | |
| </Tooltip.Content> | |
| </Tooltip.Root> | |
| {/each} | |
| </span> | |
| {/if} | |
| </span> | |
| {/if} | |
Xet Storage Details
- Size:
- 2.23 kB
- Xet hash:
- 662fe450146e0dfed3856c09515c8b4abf255c88fd07e2f03174e9306a97bcc4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.