-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement concurrency guards for GGUF engines, optimize context windows, and add spoken-word system prompts to prevent self-triggering VAD feedback. #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e5b5a40
feat: Implement concurrency guards for GGUF engines, optimize context…
kevinliddel 4124938
refactor: rename persona from Dedicatus to Sonya to match the model's…
kevinliddel 4ef7ec1
feat: implement separate local LLM system prompt storage and add manu…
kevinliddel 6860768
docs: update voice quality guides and npu diagrams [skip ci]
kevinliddel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // | ||
| // LocalLLMManager+TTS.swift | ||
| // NeuraLink | ||
| // | ||
| // TTS helpers split out to keep LocalLLMManager.swift. | ||
| // - localLLMSystemPrompt: minimal spoken-word prompts for local 1–2B models | ||
| // - bestAvailableVoice: voice picker that searches installed voices by name/pattern | ||
| // | ||
| // Created by Dedicatus on 30/04/2026. | ||
| // | ||
|
|
||
| import AVFoundation | ||
|
|
||
| extension LocalLLMManager { | ||
|
|
||
| /// Returns the active local LLM system prompt for the character — | ||
| /// user-saved override if one exists, otherwise the built-in default. | ||
| func localLLMSystemPrompt(for characterName: String) -> String { | ||
| LocalLLMPromptStore.shared.effectivePrompt(for: characterName) | ||
| } | ||
|
|
||
| /// Picks the best installed voice for a character by searching `speechVoices()` by name | ||
| /// pattern and quality tier, rather than relying on a hardcoded identifier string. | ||
| /// `AVSpeechSynthesisVoice(identifier:)` silently returns nil when the voice isn't | ||
| /// downloaded, which causes every call to fall through to the same generic system default. | ||
| func bestAvailableVoice(for characterName: String) -> AVSpeechSynthesisVoice? { | ||
| let all = AVSpeechSynthesisVoice.speechVoices() | ||
|
|
||
| if !voicesLogged { | ||
| voicesLogged = true | ||
| print("[TTS] Installed voices (\(all.count)):") | ||
| for v in all.sorted(by: { $0.language < $1.language }) { | ||
| print(" [\(v.language) q=\(v.quality.rawValue)] \(v.name) — \(v.identifier)") | ||
| } | ||
| } | ||
|
|
||
| switch characterName.lowercased() { | ||
| case "ekaterina": | ||
| return all.first { $0.name == "Ava" } | ||
| ?? all.first { $0.identifier.contains("Ava") } | ||
| ?? all.filter { $0.language.hasPrefix("en-US") }.max { $0.quality.rawValue < $1.quality.rawValue } | ||
| ?? AVSpeechSynthesisVoice(language: "en-US") | ||
| case "sonya": | ||
| return all.first { $0.name == "Joelle" } | ||
| ?? all.first { $0.identifier.contains("Joelle") } | ||
| ?? all.filter { $0.language.hasPrefix("en-US") }.max { $0.quality.rawValue < $1.quality.rawValue } | ||
| ?? AVSpeechSynthesisVoice(language: "en-US") | ||
| default: | ||
| return all.filter { $0.language.hasPrefix("en-US") }.max { $0.quality.rawValue < $1.quality.rawValue } | ||
| ?? AVSpeechSynthesisVoice(language: "en-US") | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.