Repository navigation
Conversation
Add CustomSpeechModel, the SpeechModel.customGGUF case, the stored list and selected entry, and selectedVoiceEngineID so two custom models are never treated as the same engine.
Store files in Application Support (not Caches, which macOS may purge), read capabilities from the GGUF at import, report missing or damaged files, and restore a file into an existing entry.
CustomGGUFProvider is bound to one entry, requests token or word timestamps when the model has them, and fails prepare with a message naming the model when its file is missing or damaged.
Route .customGGUF to a provider bound to the selected entry and key every "same model, keep it loaded" decision on selectedVoiceEngineID, so switching between two custom models always loads the new one. A missing custom file reads as not installed.
Accept owner/repo ids and huggingface.co repo, tree, resolve and blob links; reject other hosts, http, credentials, ports and dot segments before any request. Downloads go through the library's GGUF check.
Add a Custom Models section to Settings > Voice Engine: add a GGUF from disk or Hugging Face, use, remove, and recover a missing or damaged file by re-downloading or choosing it again. Selecting, removing or restoring the active model reloads the engine through the same path as built-in activation.
When the selected voice engine is a custom GGUF model that supports the meeting language with word timings, freeze it into the attempt and run it through CustomGGUFProvider; otherwise keep Parakeet. Saved meetings accept any catalog language so removing a model never makes them unreadable. Built-in fingerprints are unchanged.
The meeting language picker and retranscription choices list Parakeet's languages plus those of installed custom models with word timings. Language names resolve from the catalog, so a meeting keeps its label after its custom model is removed.
Meeting setup now accepts any catalog language because a custom voice engine can supply it; codes outside the catalog are still rejected. Update the computer-audio script stub for MeetingLanguageSupport.
- Meetings fall back to any installed custom model that handles the language with word timings when neither the selected engine nor Parakeet can, so offered languages always transcribe. - Removing the active custom model returns to the previous built-in engine and only loads it when installed, never starting a download. - Store each model's declared audio-length limit and split longer audio into consecutive runs, shifting word timings back.
…code Format with the version CI pins and fix the strict SwiftLint findings in the custom model downloader and tests.
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Visual files detected:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge, with one remaining non-blocking cancellation issue in model recovery. SummaryAdds custom GGUF speech models for dictation, file transcription, and meetings.
Reviews (2) · Last reviewed commit: "fix(models): address PR review of custom..." · Reviewed by Greptile |
| func cancel() { | ||
| self.task?.cancel() | ||
| self.task = nil | ||
| self.operation = .idle |
There was a problem hiding this comment.
Cancelled downloads still change state
cancel reports idle and releases the task before its work stops. During model inspection, the detached install keeps running and importFile still saves the model after cancellation. During network cancellation, the old task's error can also overwrite a newly started operation through the unguarded catch blocks in perform.
Keep ownership until the old task finishes, check cancellation before placing files and saving entries, and guard progress and completion updates with an operation ID.
Prompt To Fix With AI
This is a comment left during a code review.
Path: Sources/Fluid/UI/AISettings/CustomSpeechModelsController.swift
Line: 141-144
Comment:
**Cancelled downloads still change state**
`cancel` reports idle and releases the task before its work stops. During model inspection, the detached `install` keeps running and `importFile` still saves the model after cancellation. During network cancellation, the old task's error can also overwrite a newly started operation through the unguarded catch blocks in `perform`.
Keep ownership until the old task finishes, check cancellation before placing files and saving entries, and guard progress and completion updates with an operation ID.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 4f6561f:
cancel()now only cancels the running task and leaves ownership with it. The section stays busy until the work unwinds, so no newer operation can start that a late error or progress update could overwrite.performthen sets idle when the task was cancelled, or failed otherwise. With no task (the file chooser), cancel goes straight to idle.importFilechecks for cancellation after the detachedinstall. It removes the placed file and throwsCancellationErrorwithout saving an entry.- A repository listing that finishes after cancel is ignored.
I left restore-after-cancel as is: the file it replaces was already missing or damaged, so keeping the restored file is harmless. Tests: testCancelledImportSavesNothing and testCancelWhileChoosingReturnsToIdle.
- Block Use, Remove, Re-download and Restore while built-in engine actions are blocked (dictation, downloads, preparation), in the view and in the controller, so a recording never finishes on another engine and weights in use are never deleted. - Record the effective built-in engine before selecting a custom model, so upgraded users without LastBuiltInSpeechModel fall back to their previous engine instead of the default. - Cancel keeps task ownership until the work unwinds, so a late error or progress update cannot overwrite a newer operation; a cancelled import deletes its placed file and saves no entry; a late repository listing after cancel is ignored. - Keep the revision of huggingface.co tree/<revision> links through parsing, listing (api/models/<repo>/revision/<rev>), file choice and download. - Offer meeting and retranscription languages only from custom models whose file is present; saved meetings still validate independently.
Description
Adds custom GGUF speech models that run through the bundled transcribe.cpp, so users can bring a model for a language, dialect or vocabulary the built-in engines don't cover.
.gguffile or from Hugging Face (owner/repoor a huggingface.co repo, tree, resolve or blob link), use it, remove it, or recover a missing or damaged file by downloading it again or choosing it again.selectedVoiceEngineIDkeys every "same model, keep it loaded" decision, so switching between two custom models loads the new one.CustomGGUFProviderbinds to one model entry, requests token or word timestamps when the model has them, and splits audio longer than the model's declared limit into consecutive runs with word timings shifted back.Speaker attribution needs per-word timings. transcribe.cpp's Whisper architecture only returns segment timings, so a Whisper GGUF works for dictation while meetings fall back to Parakeet; Parakeet-architecture GGUFs return token timings and work for both.
Type of Change
Related Issue or Discussion
Closes #1455
Discussion: #1454 (maintainer acceptance pending). Related request: #1279.
Testing
Environment: FluidVoice 1.6.13 built from this branch, macOS 27.2.1, Apple Silicon (arm64).
Unit tests: 69 tests across
CustomSpeechModelSettingsTests,CustomSpeechModelLibraryTests,CustomGGUFProviderTests,CustomSpeechModelASRServiceTests,HuggingFaceGGUFReferenceTests,CustomSpeechModelsControllerTests,CustomSpeechModelMeetingTests,CustomSpeechModelMeetingLanguageTestsandCustomSpeechModelReviewFixTestspass (1 skipped: the real-model test needsFLUID_CUSTOM_GGUF_TEST_MODELandFLUID_CUSTOM_GGUF_TEST_AUDIO).Meeting suites:
MeetingSessionModelTests,SpeakerTurnMergingTestsandMeetingParakeetNemotronBackendTestspass excepttestHostBindsRuntimeFactoryToTheFrozenRequest, which reads the custom dictionary from the machine's UserDefaults and fails on any machine with dictionary entries. This branch doesn't change that test.Tests/run_meeting_model_policy_tests.py: 303 checks pass.Tests/run_meeting_computer_audio_tests.py: 33 checks pass.Real model:
velifurkan/parakeet-tdt-0.6b-tr-gguf(Q8_0, 0.73 GB, CC BY 4.0) runs on the bundled transcribe.cpp with Metal and returns accurate Turkish text with word timings.Not run yet: end-to-end checks in the app (Hugging Face download from Settings, Turkish dictation, a two-speaker Turkish meeting, switching between two custom models, missing-file recovery), Intel Mac, and any Whisper GGUF.
Tested on Intel Mac
Tested on Apple Silicon Mac
Tested on macOS version: 27.2.1
Ran linter locally:
swiftlint --strict --config .swiftlint.yml Sources Tests Package.swift(SwiftLint 0.63.2, the CI version)Ran formatter locally:
swiftformat --config .swiftformat Sources(SwiftFormat 0.61.1, the CI version)Ran tests locally: see above
Screenshots / Video
Downloaded model, it's ready to use