96 lines
2.3 KiB
JavaScript
96 lines
2.3 KiB
JavaScript
/**
|
|
* QVAC model profiles for PearData onboarding.
|
|
* Constants match @qvac/sdk registry names (string form when SDK not loaded).
|
|
*/
|
|
|
|
/** @typedef {'lite'|'recommended'|'strong'|'tool-tiny'} QvacProfileId */
|
|
|
|
/**
|
|
* @typedef {{
|
|
* id: QvacProfileId,
|
|
* label: string,
|
|
* description: string,
|
|
* chatModel: string,
|
|
* embedModel: string|null,
|
|
* tools: boolean,
|
|
* minRamGb: number,
|
|
* minDiskGb: number,
|
|
* approxDownloadGb: number,
|
|
* ctxSize: number,
|
|
* }} QvacProfile
|
|
*/
|
|
|
|
/** @type {Record<QvacProfileId, QvacProfile>} */
|
|
export const QVAC_PROFILES = {
|
|
lite: {
|
|
id: 'lite',
|
|
label: 'Lite',
|
|
description: 'Smallest download. Good for weak machines; limited tool use.',
|
|
chatModel: 'QWEN3_600M_INST_Q4',
|
|
embedModel: null,
|
|
tools: false,
|
|
minRamGb: 4,
|
|
minDiskGb: 2,
|
|
approxDownloadGb: 0.5,
|
|
ctxSize: 4096,
|
|
},
|
|
recommended: {
|
|
id: 'recommended',
|
|
label: 'Recommended',
|
|
description: 'Best balance for host monitoring with tool calling.',
|
|
chatModel: 'QWEN3_1_7B_INST_Q4',
|
|
embedModel: 'GTE_LARGE_FP16',
|
|
tools: true,
|
|
minRamGb: 8,
|
|
minDiskGb: 5,
|
|
approxDownloadGb: 2.5,
|
|
ctxSize: 8192,
|
|
},
|
|
strong: {
|
|
id: 'strong',
|
|
label: 'Strong',
|
|
description: 'Better reasoning on incidents. Needs more RAM/disk.',
|
|
chatModel: 'QWEN3_4B_INST_Q4_K_M',
|
|
embedModel: 'GTE_LARGE_FP16',
|
|
tools: true,
|
|
minRamGb: 16,
|
|
minDiskGb: 8,
|
|
approxDownloadGb: 3.5,
|
|
ctxSize: 8192,
|
|
},
|
|
'tool-tiny': {
|
|
id: 'tool-tiny',
|
|
label: 'Tool-tiny',
|
|
description: 'Llama tool-calling 1B fallback if Qwen tools misbehave.',
|
|
chatModel: 'LLAMA_TOOL_CALLING_1B_INST_Q4_K',
|
|
embedModel: null,
|
|
tools: true,
|
|
minRamGb: 6,
|
|
minDiskGb: 3,
|
|
approxDownloadGb: 1,
|
|
ctxSize: 4096,
|
|
},
|
|
}
|
|
|
|
/**
|
|
* @param {{ totalRamBytes?: number, freeDiskBytes?: number }} hw
|
|
* @returns {QvacProfileId}
|
|
*/
|
|
export function suggestProfile(hw = {}) {
|
|
const ramGb = (Number(hw.totalRamBytes) || 0) / 1e9
|
|
if (ramGb >= 16) return 'strong'
|
|
if (ramGb >= 8) return 'recommended'
|
|
if (ramGb >= 4) return 'lite'
|
|
return 'lite'
|
|
}
|
|
|
|
/**
|
|
* @param {QvacProfileId|string} id
|
|
* @returns {QvacProfile}
|
|
*/
|
|
export function getProfile(id) {
|
|
return QVAC_PROFILES[id] || QVAC_PROFILES.recommended
|
|
}
|
|
|
|
export const PROFILE_LIST = Object.values(QVAC_PROFILES)
|