Skip to content

Commit 4194417

Browse files
authored
Merge pull request #184 from straff2002/fix/gemma4-agent-model-routing
Fix gemma-4 local agent crash: load it as text, not vision
2 parents 2448162 + aff3ec4 commit 4194417

6 files changed

Lines changed: 102 additions & 791 deletions

File tree

OpenGlasses/Sources/App/OpenGlassesApp.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -669,17 +669,10 @@ class AppState: ObservableObject, AppStateProtocol {
669669

670670
addDebugEvent("AppState initialized")
671671

672-
// Register Gemma 4 model type — not yet in the official mlx-swift-lm registry
673-
Task {
674-
await LLMTypeRegistry.shared.registerModelType("gemma4") { data in
675-
let config = try JSONDecoder().decode(Gemma4TextConfiguration.self, from: data)
676-
return Gemma4TextModel(config)
677-
}
678-
await LLMTypeRegistry.shared.registerModelType("gemma4_text") { data in
679-
let config = try JSONDecoder().decode(Gemma4TextConfiguration.self, from: data)
680-
return Gemma4TextModel(config)
681-
}
682-
}
672+
// (Gemma-4 is now supplied by mlx-swift-lm's own LLMModelFactory registration; the
673+
// former custom port + override here shadowed the library's tested model for every
674+
// "gemma4" text load and was only reached — never — because the model mistakenly
675+
// loaded through the vision factory. See LocalLLMService.visionModelIds.)
683676

684677
// Share the audio engine so transcription works in background
685678
transcriptionService.sharedAudioEngineProvider = wakeWordService

0 commit comments

Comments
 (0)