feat: add support for mmproj offload setting

Expose the new `mmproj_offload` option in the model settings UI and include it in the `ModelPlan` type. The component now collects the offload flag (`result.offloadMmproj`) and queues it with other setting updates to ensure a single atomic change, preventing race conditions when toggling this feature. This enables users to control MMProj offloading directly from the app.
This commit is contained in:
Akarshan 2025-09-11 13:08:01 +05:30
parent 14c7fc0450
commit 8f67f29317
No known key found for this signature in database
GPG Key ID: D75C9634A870665F
2 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,16 @@ export function ModelSetting({
}) })
} }
if (
model.settings?.mmproj_offload &&
result.offloadMmproj !== undefined
) {
settingsToUpdate.push({
key: 'mmproj_offload',
value: result.offloadMmproj,
})
}
// Apply all settings in a single update to avoid race conditions // Apply all settings in a single update to avoid race conditions
if (settingsToUpdate.length > 0) { if (settingsToUpdate.length > 0) {
handleMultipleSettingsChange(settingsToUpdate) handleMultipleSettingsChange(settingsToUpdate)

View File

@ -85,6 +85,7 @@ export interface ModelPlan {
gpuLayers: number gpuLayers: number
maxContextLength: number maxContextLength: number
noOffloadKVCache: boolean noOffloadKVCache: boolean
offloadMmproj: boolean
mode: 'GPU' | 'Hybrid' | 'CPU' | 'Unsupported' mode: 'GPU' | 'Hybrid' | 'CPU' | 'Unsupported'
} }