Closed
Conversation
Gemma 4 MLX provider for Arkavo Creator: - Primary provider (priority 0) with Apple Intelligence fallback - HuggingFace download on first use (~9 GB) - Both constrained (tool calls) and streaming (conversation) interfaces - ~74 tok/s generation on Apple Silicon Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6-task plan to integrate Gemma 4 MLX inference into Arkavo Creator: 1. Add dependencies (MLXHuggingFace, Tokenizers) 2. Create Gemma4Provider with HuggingFace model loading 3. Add LLMResponseProvider conformance (constrained generation) 4. Add streaming generation 5. Register in app's fallback chain 6. Integration test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds mlx-swift, mlx-swift-lm (feature/gemma4-text branch), swift-transformers, and swift-huggingface as dependencies to support on-device Gemma 4 inference. Exposes MLX, MLXNN, MLXLMCommon, MLXLLM, MLXHuggingFace, Tokenizers, and HuggingFace products to the MuseCore target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements LLMResponseProvider backed by mlx-community/gemma-4-e4b-it-8bit. Includes loadModel/unloadModel lifecycle, constrained JSON generation at temperature 0, and a streaming generate method at temperature 0.6/topP 0.95. State is managed by a Swift actor for Swift 6 strict-concurrency compliance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gemma 4 is now priority 0 (tried first) in the LLM fallback chain. Edge provider becomes the fallback when available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Contributor
Author
|
Merged into #239 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
Integrates Gemma 4 (gemma-4-e4b-it-8bit) as the primary on-device LLM provider in Arkavo Creator, running at 73.7 tok/s on Apple Silicon via MLX Swift.
Gemma4Providerconforming toLLMResponseProvider(priority 0, tried first)Key commits
MuseAvatarViewModel.setupLLMProviders()at priority 0Performance
Achieved 97.6% of Python MLX speed after discovering and fixing the float32 literal trap — where Swift's default float32 scalars inject 1046 AsType cast nodes into the bfloat16 computation graph, causing 237 MB of Metal cache churn per token. Full writeup in ml-explore/mlx-swift-lm#188.
Dependencies
arkavo-ai/mlx-swift-lmbranchfeature/gemma4-text(until upstream merges #188)ml-explore/mlx-swift0.31.3huggingface/swift-transformers1.2.1Test plan
swift build)xcodebuild -skipMacroValidation)🤖 Generated with Claude Code