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

View File

@ -26,7 +26,8 @@ export const modelSettings = {
temperature: { temperature: {
key: 'temp', key: 'temp',
title: 'Temperature', 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_type: 'input',
controller_props: { controller_props: {
value: 0.8, value: 0.8,
@ -39,7 +40,8 @@ export const modelSettings = {
top_k: { top_k: {
key: 'top_k', key: 'top_k',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 40, value: 40,
@ -50,7 +52,8 @@ export const modelSettings = {
top_p: { top_p: {
key: 'top_p', key: 'top_p',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 0.9, value: 0.9,
@ -61,7 +64,8 @@ export const modelSettings = {
min_p: { min_p: {
key: 'min_p', key: 'min_p',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 0.1, value: 0.1,
@ -73,7 +77,7 @@ export const modelSettings = {
key: 'repeat_last_n', key: 'repeat_last_n',
title: 'Repeat Last N', title: 'Repeat Last N',
description: 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_type: 'input',
controller_props: { controller_props: {
value: 64, value: 64,
@ -84,7 +88,8 @@ export const modelSettings = {
repeat_penalty: { repeat_penalty: {
key: 'repeat_penalty', key: 'repeat_penalty',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 1.0, value: 1.0,
@ -95,7 +100,8 @@ export const modelSettings = {
presence_penalty: { presence_penalty: {
key: 'presence_penalty', key: 'presence_penalty',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 0.0, value: 0.0,
@ -106,7 +112,8 @@ export const modelSettings = {
frequency_penalty: { frequency_penalty: {
key: 'frequency_penalty', key: 'frequency_penalty',
title: '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_type: 'input',
controller_props: { controller_props: {
value: 0.0, value: 0.0,