iOS集成指南
文档系统梳理 Gemma 4 E2B 在 iOS 上接入 LiteRT-LM 的关键链路,涵盖 LiteRT-LM、CLiteRTLM.framework、TensorFlow Lite runtime 与相关 dylib 的依赖关系,Bazel 构建 libLiteRTLMEngine.dylib、Bundle ID 与签名修复,以及模型版本、缓存与运行时挂起排障。同时补充 LiteRT-LM 升级到 v0.12.x 及后续版本的标准流程,强调按 tag 切换仓库、拉取 iOS prebuilt 加速器、检查 c/BUILD 中的 cc_binary patch,并确保引擎与 prebuilt 加速器严格同版以维持 ABI 兼容。
The AI summary is ready
SuccessYou can start an AI summary task here, and the generated summary will stay in this panel.
本文围绕 Gemma 4 E2B 在 iOS 的集成、构建、签名、模型配置与运行时排障展开。先说明 LiteRT-LM、CLiteRTLM.framework、TensorFlow Lite runtime 及 dylib 的配套关系,再介绍用 Bazel 构建 libLiteRTLMEngine.dylib 并修复 Bundle ID 与签名问题。模型侧需使用 HF pinned commit,按需更新 defaultModelURL,并依赖 .source 指纹避免缓存错配;若系统在 compiled_model.cc 后挂起,多为模型版本错误,应清理缓存后重下。升级 LiteRT-LM 至 v0.12.x 及后续版本时,应切换到目标 tag、同步 iOS prebuilt 加速器、检查 c/BUILD 的 cc_binary patch,核心是保证引擎与 prebuilt 加速器版本一致,确保 ABI 兼容。
Reader Notes
Supplementary notes appended by readers of this document.
Comments
Add context, follow-up thoughts, or corrections around this document.