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
fix(models): share the 16 GiB hardware recommendation across setup and settings
altic-dev13f297ccd7e7
diff --git a/Sources/Fluid/Services/PrivateAIHardwareRecommendation.swift b/Sources/Fluid/Services/PrivateAIHardwareRecommendation.swiftindex 34a90445..2138b762 100644--- a/Sources/Fluid/Services/PrivateAIHardwareRecommendation.swift+++ b/Sources/Fluid/Services/PrivateAIHardwareRecommendation.swift@@ -48,7 +48,7 @@ enum PrivateAIHardwareRecommendation {static func recommend(for hardware: Hardware) -> Recommendation {let bandwidth = self.bandwidth(chip: hardware.chip, gpuCores: hardware.gpuCoreCount)- guard hardware.memoryBytes >= 18 * 1024 * 1024 * 1024 else {+ guard hardware.memoryBytes >= 16 * 1024 * 1024 * 1024 else {return Recommendation(model: .pico, reason: .insufficientMemory, bandwidthGBps: bandwidth)}guard let bandwidth else {diff --git a/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift b/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swiftindex 0765dc6e..e5a2ee3a 100644--- a/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift+++ b/Sources/Fluid/UI/AISettings/FluidIntelligenceLiveSection.swift@@ -63,11 +63,9 @@ struct FluidIntelligenceLiveSection<Management: View>: View {.padding(20).background(self.theme.palette.cardBackground, in: RoundedRectangle(cornerRadius: AppTheme.Metrics.Showcase.cardRadius)).task {- let recommendation = await Task.detached(priority: .utility) {- PrivateAIModelRecommendation.currentModelID- }.value+ let recommendation = await PrivateAIHardwareRecommendation.current()guard !Task.isCancelled else { return }- self.recommendedModelID = recommendation+ self.recommendedModelID = recommendation.model.rawValue}.task(id: self.readIdentity) {self.snapshots = [:]diff --git a/Sources/Fluid/UI/AISettings/PrivateAIModelPresentation.swift b/Sources/Fluid/UI/AISettings/PrivateAIModelPresentation.swiftindex 9a65bf26..a6747c7c 100644--- a/Sources/Fluid/UI/AISettings/PrivateAIModelPresentation.swift+++ b/Sources/Fluid/UI/AISettings/PrivateAIModelPresentation.swift@@ -1,15 +1,5 @@import Foundation-/// A RAM-based suggestion only; never selects, loads, downloads, or persists a model.-enum PrivateAIModelRecommendation {- // First accessed from the settings background task; physical RAM cannot change during this process.- static let currentModelID = modelID(physicalMemory: ProcessInfo.processInfo.physicalMemory)-- static func modelID(physicalMemory: UInt64) -> String {- physicalMemory >= 16 * 1024 * 1024 * 1024 ? "fluid-1-mini-96k-dflash" : "fluid-1-pico-96k-dflash"- }-}-/// UI-only previews. These identifiers are never registered with a runtime or download provider.enum PrivateAIUpcomingModel: String, CaseIterable, Identifiable {case quad = "preview-upcoming-quad"diff --git a/Tests/PrivateAIHardwareRecommendationTests.swift b/Tests/PrivateAIHardwareRecommendationTests.swiftindex 6450dba9..76876a5f 100644--- a/Tests/PrivateAIHardwareRecommendationTests.swift+++ b/Tests/PrivateAIHardwareRecommendationTests.swift@@ -18,8 +18,10 @@ struct PrivateAIHardwareRecommendationTests {("Apple M5 Pro", 20, 64, .mini), ("Apple M5 Max", 32, 36, .mini),("Apple M5 Max", 40, 128, .mini), ("Apple M1 Ultra", 48, 64, .mini),("Apple M2 Ultra", 60, 64, .mini), ("Apple M3 Ultra", 60, 96, .mini),- ("Apple M5 Max", 40, 8, .pico), ("Apple M5 Max", 40, 16, .pico), ("Apple M5 Max", 40, 24, .mini),+ ("Apple M5 Max", 40, 8, .pico), ("Apple M5 Max", 40, 16, .mini), ("Apple M5 Max", 40, 24, .mini),("Apple M3 Pro", 18, 18, .mini),+ ("Apple M1 Pro", 16, 16, .mini), ("Apple M2 Pro", 19, 16, .mini),+ ("Apple M4 Pro", 20, 18, .mini), ("Apple M4", 10, 16, .pico),("Intel Core i9", nil, 64, .pico), ("Apple M99 Max", 40, 128, .pico),("", nil, 0, .pico), (" APPLE M1 MAX ", nil, 32, .mini),]@@ -27,7 +29,7 @@ struct PrivateAIHardwareRecommendationTests {let hardware = Policy.Hardware(chip: chip, memoryBytes: ram * gib, gpuCoreCount: cores)precondition(Policy.recommend(for: hardware).model == expected, "Unexpected recommendation: \(chip), \(ram) GB")}- let belowBoundary = Policy.Hardware(chip: "Apple M1 Max", memoryBytes: 18 * gib - 1, gpuCoreCount: nil)+ let belowBoundary = Policy.Hardware(chip: "Apple M1 Max", memoryBytes: 16 * gib - 1, gpuCoreCount: nil)precondition(Policy.recommend(for: belowBoundary).reason == .insufficientMemory)let unknown = Policy.Hardware(chip: "unknown", memoryBytes: 128 * gib, gpuCoreCount: nil)precondition(Policy.recommend(for: unknown).reason == .unknownHardware)diff --git a/Tests/PrivateAISettingsBoundaryTests.swift b/Tests/PrivateAISettingsBoundaryTests.swiftindex 36ea4186..d2c086dc 100644--- a/Tests/PrivateAISettingsBoundaryTests.swift+++ b/Tests/PrivateAISettingsBoundaryTests.swift@@ -12,14 +12,6 @@ struct PrivateAISettingsBoundaryTests {precondition(condition, message)checks += 1}- for gigabytes: UInt64 in [4, 8, 12] {- check(PrivateAIModelRecommendation.modelID(physicalMemory: gigabytes * 1024 * 1024 * 1024) == "fluid-1-pico-96k-dflash", "Below 16 GB recommends Pico")- }- for gigabytes: UInt64 in [16, 24, 32, 64, 128] {- check(PrivateAIModelRecommendation.modelID(physicalMemory: gigabytes * 1024 * 1024 * 1024) == "fluid-1-mini-96k-dflash", "16 GB and above recommends Mini")- }- check(PrivateAIModelRecommendation.modelID(physicalMemory: 16 * 1024 * 1024 * 1024 - 1) == "fluid-1-pico-96k-dflash", "Recommendation uses the exact 16 GB boundary")-check(PrivateAIModelCarouselNavigation.next(in: [], current: "missing", forward: true) == nil, "Empty catalog has no navigation target")check(PrivateAIModelCarouselNavigation.next(in: ["mini"], current: "mini", forward: false) == "mini", "One model never fabricates a neighbor")check(PrivateAIModelCarouselNavigation.next(in: ["pico", "mini"], current: "mini", forward: true) == "pico", "Two-model carousel wraps forward")