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) setIsPlanning(true)
try { 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<{ const modelConfig = await serviceHub.app().readYaml<{
model_path: string model_path: string
mmproj_path?: string
}>(`llamacpp/models/${model.id}/model.yml`) }>(`llamacpp/models/${model.id}/model.yml`)
if (modelConfig && modelConfig.model_path) { if (modelConfig && modelConfig.model_path) {
const result = await serviceHub const result = await serviceHub
.models() .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 // Apply the recommended settings to the model sequentially to avoid race conditions
const settingsToUpdate: Array<{ const settingsToUpdate: Array<{

View File

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