enhancement: send params mmptoj_path for optimize setting

This commit is contained in:
Faisal Amir 2025-09-11 13:23:25 +07:00
parent 791563e6ba
commit bc29046c06
2 changed files with 12 additions and 3 deletions

View File

@ -46,15 +46,20 @@ export function ModelSetting({
}
setIsPlanning(true)
try {
// Read the model config to get the actual model path
// Read the model config to get the actual model path and mmproj path
const modelConfig = await serviceHub.app().readYaml<{
model_path: string
mmproj_path?: string
}>(`llamacpp/models/${model.id}/model.yml`)
if (modelConfig && modelConfig.model_path) {
const result = await serviceHub
.models()
.planModelLoad(modelConfig.model_path)
.planModelLoad(
modelConfig.model_path,
undefined,
modelConfig.mmproj_path
)
// Apply the recommended settings to the model sequentially to avoid race conditions
const settingsToUpdate: Array<{

View File

@ -136,5 +136,9 @@ export interface ModelsService {
ctxSize?: number
): Promise<'RED' | 'YELLOW' | 'GREEN' | 'GREY'>
validateGgufFile(filePath: string): Promise<ModelValidationResult>
planModelLoad(modelPath: string, requestedCtx?: number): Promise<ModelPlan>
planModelLoad(
modelPath: string,
requestedCtx?: number,
mmprojPath?: string
): Promise<ModelPlan>
}