Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more
feat(private-ai): add deactivate model action
altic-dev7246c052cfec
diff --git a/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift b/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swiftindex 18c6d71a..a204066b 100644--- a/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift+++ b/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift@@ -2081,6 +2081,25 @@ final class AIEnhancementSettingsViewModel: ObservableObject {// Intentionally empty. Selection is sticky.}+ /// True while any dictation shortcut still routes through Fluid Intelligence, even when+ /// the runtime has been freed by the idle unloader.+ var routesDictationThroughPrivateAI: Bool {+ SettingsStore.DictationShortcutSlot.allCases.contains { slot in+ DictationProviderRoute.resolve(settings: self.settings, dictationSlot: slot).usesPrivateAI+ }+ }++ /// Turns off every dictation shortcut currently routed through Fluid Intelligence.+ /// Slots bound to a cloud provider keep their own selection.+ func turnOffPrivateAIDictationSlots() {+ for slot in SettingsStore.DictationShortcutSlot.allCases+ where DictationProviderRoute.resolve(settings: self.settings, dictationSlot: slot).usesPrivateAI+ {+ self.settings.setDictationPromptSelection(.off, for: slot)+ }+ self.refreshPromptSelectionState()+ }+func selectPrimaryDictationPromptOff() {self.settings.setDictationPromptSelection(.off)self.refreshPromptSelectionState()diff --git a/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift b/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swiftindex e5a2ee3a..2fd00108 100644--- a/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift+++ b/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift@@ -173,6 +173,10 @@ struct FluidIntelligenceLiveSection<Management: View>: View {})}.disabled(!selected || files?.installed != true || self.controller.isBusy)+ Button("Deactivate model") {+ self.controller.deactivateSelectedModel()+ }+ .disabled(!selected || !self.controller.routesDictationThroughPrivateAI || self.controller.isBusy)if !selected {Text("Activate this model to manage it")}diff --git a/Sources/Fluid/UI/AISettings/PrivateAISettingsController.swift b/Sources/Fluid/UI/AISettings/PrivateAISettingsController.swiftindex 66a30b01..9825767d 100644--- a/Sources/Fluid/UI/AISettings/PrivateAISettingsController.swift+++ b/Sources/Fluid/UI/AISettings/PrivateAISettingsController.swift@@ -92,6 +92,21 @@ final class PrivateAISettingsController: ObservableObject {}}+ /// Drives the Deactivate affordance: stays true after the idle unloader frees the runtime,+ /// because dictation would still reload Fluid Intelligence on the next run.+ var routesDictationThroughPrivateAI: Bool { self.viewModel.routesDictationThroughPrivateAI }++ /// Inverse of `usePreviewModel`: stops routing dictation through Fluid Intelligence+ /// and frees the loaded runtime. The model stays installed and selected.+ func deactivateSelectedModel() {+ guard !self.isBusy else { return }+ self.viewModel.turnOffPrivateAIDictationSlots()+ Task { @MainActor in+ await PrivateAIIntegrationService.shared.unloadCachedRuntime(reason: "user deactivated")+ self.refreshPrivateAILoadState()+ }+ }+func synchronizeSelection() {guard !self.isBusy else { return }self.session.select(PrivateAIIntegrationService.configuredModelID)