Analysis updated 2026-05-18
Convert Google DeepMind's Magenta RealTime 2 music model into Apple's Core ML format for iPhone.
Run continuous real time AI music generation on iPhone hardware without draining the GPU.
Study the documented Core ML export decisions and measurements before converting your own model.
Use the pre converted model files hosted on Hugging Face directly in an iOS app.
| mattmireles/magenta-realtime-2-iphone | 16nic/comfyui-agnes-ai | 6c696e68/gpt_signup_hybrid | |
|---|---|---|---|
| Stars | 19 | 19 | 19 |
| Language | Python | Python | Python |
| Setup difficulty | hard | moderate | hard |
| Complexity | 5/5 | 2/5 | 4/5 |
| Audience | developer | vibe coder | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires converting or downloading Core ML model files and integrating them into an iOS app.
This project takes Google DeepMind's Magenta RealTime 2 music generation model and makes it run on an iPhone without using the GPU. That matters because music generation is continuous: the model has to produce a new frame of audio every 40 milliseconds and keep doing so indefinitely. A phone's GPU can handle that pace for short bursts, but over ten minutes of sustained use it draws too much power and heats up. Apple's Neural Engine, a separate chip inside iPhones designed for machine learning tasks, can run the same work at a fraction of the power draw. The challenge is that Apple's Neural Engine has strict requirements: it only accepts fixed input shapes, it does not tolerate branching logic, and its compiler can silently appear to accept a model while actually routing it to the CPU instead, where it runs 16 times too slow without any error message. The author hit that limit, measured it carefully, and published the result. The solution was to split the model into three separate graphs and route each one to the chip that suits it best. The outcome on an iPhone 12 Pro from 2020: ten unbroken minutes of 48 kHz stereo audio at 25 frames per second, with zero recorded GPU usage from the music process. The project includes validation measurements comparing the output numerically against Google's own reference implementation, showing an output correlation of 0.999985 and a signal quality of 118.85 dB. This repository contains the Python exporter scripts that convert the original model into Apple's Core ML format, along with documentation of the decisions made, including several approaches that were tried and rejected with measurements attached. Pre-converted model files ready to use in an iOS app are hosted separately on Hugging Face. The README is unusually detailed about what was proven versus what remains unvalidated.
Python scripts that convert Google's Magenta RealTime 2 music generation model to run continuously on an iPhone's Neural Engine instead of its GPU.
Mainly Python. The stack also includes Python, Core ML, Apple Neural Engine.
Setup difficulty is rated hard, with roughly 1day+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.