chore: hide some model capabilities (#5189)

* chore: hide some model capabilities

* chore: update model setting description

* chore: disable vision and embedding and add tooltip

---------

Co-authored-by: Louis <louis@jan.ai>
This commit is contained in:
Faisal Amir 2025-06-04 12:11:16 +07:00 committed by GitHub
parent 7ca57e1fa7
commit a88da16edc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 60 additions and 36 deletions

View File

@ -7,13 +7,18 @@ import {
DialogTrigger,
} from '@/components/ui/dialog'
import { Switch } from '@/components/ui/switch'
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from '@/components/ui/tooltip'
import { useModelProvider } from '@/hooks/useModelProvider'
import {
IconPencil,
IconEye,
IconTool,
IconWorld,
IconAtom,
// IconWorld,
// IconAtom,
IconCodeCircle2,
} from '@tabler/icons-react'
import { useState, useEffect } from 'react'
@ -143,20 +148,6 @@ export const DialogEditModel = ({
<div className="py-1">
<h3 className="text-sm font-medium mb-3">Capabilities</h3>
<div className="space-y-4">
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconEye className="size-4 text-main-view-fg/70" />
<span className="text-sm">Vision</span>
</div>
<Switch
id="vision-capability"
checked={capabilities.vision}
onCheckedChange={(checked) =>
handleCapabilityChange('vision', checked)
}
/>
</div>
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconTool className="size-4 text-main-view-fg/70" />
@ -173,19 +164,45 @@ export const DialogEditModel = ({
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconCodeCircle2 className="size-4 text-main-view-fg/70" />
<span className="text-sm">Embeddings</span>
<IconEye className="size-4 text-main-view-fg/70" />
<span className="text-sm">Vision</span>
</div>
<Switch
id="embedding-capability"
checked={capabilities.embeddings}
onCheckedChange={(checked) =>
handleCapabilityChange('embeddings', checked)
}
/>
<Tooltip>
<TooltipTrigger>
<Switch
id="vision-capability"
checked={capabilities.vision}
disabled={true}
onCheckedChange={(checked) =>
handleCapabilityChange('vision', checked)
}
/>
</TooltipTrigger>
<TooltipContent>Not available yet</TooltipContent>
</Tooltip>
</div>
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconCodeCircle2 className="size-4 text-main-view-fg/70" />
<span className="text-sm">Embeddings</span>
</div>
<Tooltip>
<TooltipTrigger>
<Switch
id="embedding-capability"
disabled={true}
checked={capabilities.embeddings}
onCheckedChange={(checked) =>
handleCapabilityChange('embeddings', checked)
}
/>
</TooltipTrigger>
<TooltipContent>Not available yet</TooltipContent>
</Tooltip>
</div>
{/* <div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconWorld className="size-4 text-main-view-fg/70" />
<span className="text-sm">Web Search</span>
@ -197,9 +214,9 @@ export const DialogEditModel = ({
handleCapabilityChange('web_search', checked)
}
/>
</div>
</div> */}
<div className="flex items-center justify-between">
{/* <div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<IconAtom className="size-4 text-main-view-fg/70" />
<span className="text-sm">Reasoning</span>
@ -211,7 +228,7 @@ export const DialogEditModel = ({
handleCapabilityChange('reasoning', checked)
}
/>
</div>
</div> */}
</div>
</div>
</DialogContent>

View File

@ -26,7 +26,8 @@ export const modelSettings = {
temperature: {
key: 'temp',
title: 'Temperature',
description: 'Temperature for sampling (higher = more random).',
description:
'Temperature for sampling (higher = more random). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 0.8,
@ -39,7 +40,8 @@ export const modelSettings = {
top_k: {
key: 'top_k',
title: 'Top K',
description: 'Top-K sampling (0 = disabled).',
description:
'Top-K sampling (0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 40,
@ -50,7 +52,8 @@ export const modelSettings = {
top_p: {
key: 'top_p',
title: 'Top P',
description: 'Top-P sampling (1.0 = disabled).',
description:
'Top-P sampling (1.0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 0.9,
@ -61,7 +64,8 @@ export const modelSettings = {
min_p: {
key: 'min_p',
title: 'Min P',
description: 'Min-P sampling (0.0 = disabled).',
description:
'Min-P sampling (0.0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 0.1,
@ -73,7 +77,7 @@ export const modelSettings = {
key: 'repeat_last_n',
title: 'Repeat Last N',
description:
'Number of tokens to consider for repeat penalty (0 = disabled, -1 = ctx_size).',
'Number of tokens to consider for repeat penalty (0 = disabled, -1 = ctx_size). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 64,
@ -84,7 +88,8 @@ export const modelSettings = {
repeat_penalty: {
key: 'repeat_penalty',
title: 'Repeat Penalty',
description: 'Penalize repeating token sequences (1.0 = disabled).',
description:
'Penalize repeating token sequences (1.0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 1.0,
@ -95,7 +100,8 @@ export const modelSettings = {
presence_penalty: {
key: 'presence_penalty',
title: 'Presence Penalty',
description: 'Repeat alpha presence penalty (0.0 = disabled).',
description:
'Repeat alpha presence penalty (0.0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 0.0,
@ -106,7 +112,8 @@ export const modelSettings = {
frequency_penalty: {
key: 'frequency_penalty',
title: 'Frequency Penalty',
description: 'Repeat alpha frequency penalty (0.0 = disabled).',
description:
'Repeat alpha frequency penalty (0.0 = disabled). This is the default setting on load and can be overridden by the assistant settings.',
controller_type: 'input',
controller_props: {
value: 0.0,