Skip to content

Commit 02f7b88

Browse files
dinhlongviolin1qnixsynapseurmauurMinh141120
authored
Bring QA (0.6.9) changes to dev (#6296)
* fix: check for env value before setting (#6266) * fix: check for env value before setting * Use empty instead of none * fix: update linux build script to be consistent with CI (#6269) The local build script for Linux was failing due to a bundling error. This commit updates the `build:tauri:linux` script in `package.json` to be consistent with the CI build pipeline, which resolves the issue. The updated script now includes: - **`NO_STRIP=1`**: This environment variable prevents the `linuxdeploy` utility from stripping debugging symbols, which was a potential cause of the bundling failure. - **`--verbose`**: This flag provides more detailed output during the build, which can be useful for debugging similar issues in the future. * fix: compatibility imported model * fix: update copy mmproj setting desc * fix: toggle vision for remote model * chore: add tooltip visions * chore: show model setting only for local provider * fix/update-ui-info * chore: update filter hub while searching * fix: system monitor window permission * chore: update credit description --------- Co-authored-by: Akarshan Biswas <[email protected]> Co-authored-by: Faisal Amir <[email protected]> Co-authored-by: Minh141120 <[email protected]> Co-authored-by: Nguyen Ngoc Minh <[email protected]>
1 parent b5fbba6 commit 02f7b88

File tree

15 files changed

+182
-168
lines changed

15 files changed

+182
-168
lines changed

extensions/llamacpp-extension/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"description": "Environmental variables for llama.cpp(KEY=VALUE), separated by ';'",
1717
"controllerType": "input",
1818
"controllerProps": {
19-
"value": "none",
19+
"value": "",
2020
"placeholder": "Eg. GGML_VK_VISIBLE_DEVICES=0,1",
2121
"type": "text",
2222
"textAlign": "right"

extensions/llamacpp-extension/src/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,17 +1082,18 @@ export default class llamacpp_extension extends AIEngine {
10821082

10831083
// If we reach here, download completed successfully (including validation)
10841084
// The downloadFiles function only returns successfully if all files downloaded AND validated
1085-
events.emit(DownloadEvent.onFileDownloadAndVerificationSuccess, {
1086-
modelId,
1087-
downloadType: 'Model'
1085+
events.emit(DownloadEvent.onFileDownloadAndVerificationSuccess, {
1086+
modelId,
1087+
downloadType: 'Model',
10881088
})
10891089
} catch (error) {
10901090
logger.error('Error downloading model:', modelId, opts, error)
10911091
const errorMessage =
10921092
error instanceof Error ? error.message : String(error)
10931093

10941094
// Check if this is a cancellation
1095-
const isCancellationError = errorMessage.includes('Download cancelled') ||
1095+
const isCancellationError =
1096+
errorMessage.includes('Download cancelled') ||
10961097
errorMessage.includes('Validation cancelled') ||
10971098
errorMessage.includes('Hash computation cancelled') ||
10981099
errorMessage.includes('cancelled') ||
@@ -1372,7 +1373,7 @@ export default class llamacpp_extension extends AIEngine {
13721373
envs['LLAMA_API_KEY'] = api_key
13731374

13741375
// set user envs
1375-
this.parseEnvFromString(envs, this.llamacpp_env)
1376+
if (this.llamacpp_env) this.parseEnvFromString(envs, this.llamacpp_env)
13761377

13771378
// model option is required
13781379
// NOTE: model_path and mmproj_path can be either relative to Jan's data folder or absolute path
@@ -1751,7 +1752,7 @@ export default class llamacpp_extension extends AIEngine {
17511752
}
17521753
// set envs
17531754
const envs: Record<string, string> = {}
1754-
this.parseEnvFromString(envs, this.llamacpp_env)
1755+
if (this.llamacpp_env) this.parseEnvFromString(envs, this.llamacpp_env)
17551756

17561757
// Ensure backend is downloaded and ready before proceeding
17571758
await this.ensureBackendReady(backend, version)
@@ -1767,7 +1768,7 @@ export default class llamacpp_extension extends AIEngine {
17671768
return dList
17681769
} catch (error) {
17691770
logger.error('Failed to query devices:\n', error)
1770-
throw new Error("Failed to load llamacpp backend")
1771+
throw new Error('Failed to load llamacpp backend')
17711772
}
17721773
}
17731774

@@ -1876,7 +1877,7 @@ export default class llamacpp_extension extends AIEngine {
18761877
logger.info(
18771878
`Using explicit key_length: ${keyLen}, value_length: ${valLen}`
18781879
)
1879-
headDim = (keyLen + valLen)
1880+
headDim = keyLen + valLen
18801881
} else {
18811882
// Fall back to embedding_length estimation
18821883
const embeddingLen = Number(meta[`${arch}.embedding_length`])

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"download:lib": "node ./scripts/download-lib.mjs",
2323
"download:bin": "node ./scripts/download-bin.mjs",
2424
"build:tauri:win32": "yarn download:bin && yarn tauri build",
25-
"build:tauri:linux": "yarn download:bin && ./src-tauri/build-utils/shim-linuxdeploy.sh yarn tauri build && ./src-tauri/build-utils/buildAppImage.sh",
25+
"build:tauri:linux": "yarn download:bin && NO_STRIP=1 ./src-tauri/build-utils/shim-linuxdeploy.sh yarn tauri build --verbose && ./src-tauri/build-utils/buildAppImage.sh",
2626
"build:tauri:darwin": "yarn tauri build --target universal-apple-darwin",
2727
"build:tauri": "yarn build:icon && yarn copy:assets:tauri && run-script-os",
2828
"build:tauri:plugin:api": "cd src-tauri/plugins && yarn install && yarn workspaces foreach -Apt run build",

src-tauri/capabilities/system-monitor-window.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"core:window:allow-set-theme",
1010
"log:default",
1111
"core:webview:allow-create-webview-window",
12-
"core:window:allow-set-focus"
12+
"core:window:allow-set-focus",
13+
"hardware:allow-get-system-info",
14+
"hardware:allow-get-system-usage",
15+
"llamacpp:allow-get-devices",
16+
"llamacpp:allow-read-gguf-metadata",
17+
"deep-link:allow-get-current"
1318
]
1419
}

web-app/src/components/ui/hover-card.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import { cn } from '@/lib/utils'
66
function HoverCard({
77
...props
88
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
9-
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
9+
return (
10+
<HoverCardPrimitive.Root
11+
openDelay={0}
12+
closeDelay={0}
13+
data-slot="hover-card"
14+
{...props}
15+
/>
16+
)
1017
}
1118

1219
function HoverCardTrigger({

web-app/src/containers/ChatInput.tsx

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,15 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
107107
if (selectedProvider === 'llamacpp') {
108108
const hasLocalMmproj = await checkMmprojExists(selectedModel.id)
109109
setHasMmproj(hasLocalMmproj)
110-
} else {
111-
// For non-llamacpp providers, only check vision capability
110+
}
111+
// For non-llamacpp providers, only check vision capability
112+
else if (
113+
selectedProvider !== 'llamacpp' &&
114+
selectedModel?.capabilities?.includes('vision')
115+
) {
112116
setHasMmproj(true)
117+
} else {
118+
setHasMmproj(false)
113119
}
114120
} catch (error) {
115121
console.error('Error checking mmproj:', error)
@@ -119,7 +125,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
119125
}
120126

121127
checkMmprojSupport()
122-
}, [selectedModel?.id, selectedProvider])
128+
}, [selectedModel?.capabilities, selectedModel?.id, selectedProvider])
123129

124130
// Check if there are active MCP servers
125131
const hasActiveMCPServers = connectedServers.length > 0 || tools.length > 0
@@ -535,29 +541,41 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
535541
)}
536542
{/* File attachment - show only for models with mmproj */}
537543
{hasMmproj && (
538-
<div
539-
className="h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1"
540-
onClick={handleAttachmentClick}
541-
>
542-
<IconPhoto size={18} className="text-main-view-fg/50" />
543-
<input
544-
type="file"
545-
ref={fileInputRef}
546-
className="hidden"
547-
multiple
548-
onChange={handleFileChange}
549-
/>
550-
</div>
544+
<TooltipProvider>
545+
<Tooltip>
546+
<TooltipTrigger asChild>
547+
<div
548+
className="h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1"
549+
onClick={handleAttachmentClick}
550+
>
551+
<IconPhoto
552+
size={18}
553+
className="text-main-view-fg/50"
554+
/>
555+
<input
556+
type="file"
557+
ref={fileInputRef}
558+
className="hidden"
559+
multiple
560+
onChange={handleFileChange}
561+
/>
562+
</div>
563+
</TooltipTrigger>
564+
<TooltipContent>
565+
<p>{t('vision')}</p>
566+
</TooltipContent>
567+
</Tooltip>
568+
</TooltipProvider>
551569
)}
552570
{/* Microphone - always available - Temp Hide */}
553-
{/* <div className="h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
571+
{/* <div className="h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
554572
<IconMicrophone size={18} className="text-main-view-fg/50" />
555573
</div> */}
556574
{selectedModel?.capabilities?.includes('embeddings') && (
557575
<TooltipProvider>
558576
<Tooltip>
559577
<TooltipTrigger asChild>
560-
<div className="h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
578+
<div className="h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
561579
<IconCodeCircle2
562580
size={18}
563581
className="text-main-view-fg/50"
@@ -601,7 +619,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
601619
return (
602620
<div
603621
className={cn(
604-
'h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1 cursor-pointer relative',
622+
'h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1 cursor-pointer relative',
605623
isOpen && 'bg-main-view-fg/10'
606624
)}
607625
>
@@ -632,7 +650,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
632650
<TooltipProvider>
633651
<Tooltip>
634652
<TooltipTrigger asChild>
635-
<div className="h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
653+
<div className="h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
636654
<IconWorld
637655
size={18}
638656
className="text-main-view-fg/50"
@@ -649,7 +667,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
649667
<TooltipProvider>
650668
<Tooltip>
651669
<TooltipTrigger asChild>
652-
<div className="h-6 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
670+
<div className="h-7 p-1 flex items-center justify-center rounded-sm hover:bg-main-view-fg/10 transition-all duration-200 ease-in-out gap-1">
653671
<IconAtom
654672
size={18}
655673
className="text-main-view-fg/50"

web-app/src/containers/DropdownModelProvider.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,15 @@ const DropdownModelProvider = ({
414414
</span>
415415
</button>
416416
</PopoverTrigger>
417-
{currentModel?.settings && provider && (
418-
<ModelSetting
419-
model={currentModel as Model}
420-
provider={provider}
421-
smallIcon
422-
/>
423-
)}
417+
{currentModel?.settings &&
418+
provider &&
419+
provider.provider === 'llamacpp' && (
420+
<ModelSetting
421+
model={currentModel as Model}
422+
provider={provider}
423+
smallIcon
424+
/>
425+
)}
424426
<ModelSupportStatus
425427
modelId={selectedModel?.id}
426428
provider={selectedProvider}

web-app/src/containers/ModelInfoHoverCard.tsx

Lines changed: 15 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
} from '@/components/ui/hover-card'
66
import { IconInfoCircle } from '@tabler/icons-react'
77
import { CatalogModel, ModelQuant } from '@/services/models'
8-
import { extractDescription } from '@/lib/models'
98

109
interface ModelInfoHoverCardProps {
1110
model: CatalogModel
1211
variant?: ModelQuant
12+
isDefaultVariant?: boolean
1313
defaultModelQuantizations: string[]
1414
modelSupportStatus: Record<string, string>
1515
onCheckModelSupport: (variant: ModelQuant) => void
@@ -19,12 +19,12 @@ interface ModelInfoHoverCardProps {
1919
export const ModelInfoHoverCard = ({
2020
model,
2121
variant,
22+
isDefaultVariant,
2223
defaultModelQuantizations,
2324
modelSupportStatus,
2425
onCheckModelSupport,
2526
children,
2627
}: ModelInfoHoverCardProps) => {
27-
const isVariantMode = !!variant
2828
const displayVariant =
2929
variant ||
3030
model.quants.find((m) =>
@@ -95,8 +95,8 @@ export const ModelInfoHoverCard = ({
9595
{children || (
9696
<div className="cursor-pointer">
9797
<IconInfoCircle
98-
size={14}
99-
className="mt-0.5 text-main-view-fg/50 hover:text-main-view-fg/80 transition-colors"
98+
size={isDefaultVariant ? 20 : 14}
99+
className="mt-0.5 text-main-view-fg/80 hover:text-main-view-fg/80 transition-colors"
100100
/>
101101
</div>
102102
)}
@@ -106,10 +106,10 @@ export const ModelInfoHoverCard = ({
106106
{/* Header */}
107107
<div className="border-b border-main-view-fg/10 pb-3">
108108
<h4 className="text-sm font-semibold text-main-view-fg">
109-
{isVariantMode ? variant.model_id : model.model_name}
109+
{!isDefaultVariant ? variant?.model_id : model?.model_name}
110110
</h4>
111111
<p className="text-xs text-main-view-fg/60 mt-1">
112-
{isVariantMode
112+
{!isDefaultVariant
113113
? 'Model Variant Information'
114114
: 'Model Information'}
115115
</p>
@@ -118,57 +118,21 @@ export const ModelInfoHoverCard = ({
118118
{/* Main Info Grid */}
119119
<div className="grid grid-cols-2 gap-3 text-xs">
120120
<div className="space-y-2">
121-
{isVariantMode ? (
122-
<>
123-
<div>
124-
<span className="text-main-view-fg/50 block">
125-
File Size
126-
</span>
127-
<span className="text-main-view-fg font-medium mt-1 inline-block">
128-
{variant.file_size}
129-
</span>
130-
</div>
131-
<div>
132-
<span className="text-main-view-fg/50 block">
133-
Quantization
134-
</span>
135-
<span className="text-main-view-fg font-medium mt-1 inline-block">
136-
{variant.model_id.split('-').pop()?.toUpperCase() ||
137-
'N/A'}
138-
</span>
139-
</div>
140-
</>
141-
) : (
142-
<>
143-
<div>
144-
<span className="text-main-view-fg/50 block">
145-
Downloads
146-
</span>
147-
<span className="text-main-view-fg font-medium mt-1 inline-block">
148-
{model.downloads?.toLocaleString() || '0'}
149-
</span>
150-
</div>
151-
<div>
152-
<span className="text-main-view-fg/50 block">Variants</span>
153-
<span className="text-main-view-fg font-medium mt-1 inline-block">
154-
{model.quants?.length || 0}
155-
</span>
156-
</div>
157-
</>
158-
)}
159-
</div>
160-
161-
<div className="space-y-2">
162-
{!isVariantMode && (
121+
<>
163122
<div>
164123
<span className="text-main-view-fg/50 block">
165-
Default Size
124+
{isDefaultVariant
125+
? 'Maybe Default Quantization'
126+
: 'Quantization'}
166127
</span>
167128
<span className="text-main-view-fg font-medium mt-1 inline-block">
168-
{displayVariant?.file_size || 'N/A'}
129+
{variant?.model_id.split('-').pop()?.toUpperCase() || 'N/A'}
169130
</span>
170131
</div>
171-
)}
132+
</>
133+
</div>
134+
135+
<div className="space-y-2">
172136
<div>
173137
<span className="text-main-view-fg/50 block">
174138
Compatibility
@@ -204,21 +168,6 @@ export const ModelInfoHoverCard = ({
204168
</div>
205169
</div>
206170
)}
207-
208-
{/* Content Section */}
209-
<div className="border-t border-main-view-fg/10 pt-3">
210-
<h5 className="text-xs font-medium text-main-view-fg/70 mb-1">
211-
{isVariantMode ? 'Download URL' : 'Description'}
212-
</h5>
213-
<div className="text-xs text-main-view-fg/60 bg-main-view-fg/5 rounded p-2">
214-
{isVariantMode ? (
215-
<div className="font-mono break-all">{variant.path}</div>
216-
) : (
217-
extractDescription(model?.description) ||
218-
'No description available'
219-
)}
220-
</div>
221-
</div>
222171
</div>
223172
</HoverCardContent>
224173
</HoverCard>

0 commit comments

Comments
 (0)