阿里开源的Android手机离线LLM应用,完全释放手机中的AI潜力!

随着 AI 技术的飞速发展,越来越多的应用和工具开始尝试将 AI 任务带到移动端。然而,尽管许多智能应用可以运行在手机上,通常都需要依赖云端计算,导致数据隐私问题以及网络延迟的困扰。

如果你手里的 Android 手机不仅能支持你日常的通讯、娱乐,甚至还能完成强大的人工智能任务,比如文本生成、图像生成,甚至实时音频转录。

所有这些强大的 AI 功能都能在本地离线运行,无需网络连接,也无需担心隐私问题。

而阿里巴巴最近通过开源 Mnn 框架上线的 MnnLlmApp 就可以实现。

MnnLlmApp 免费高速下载地址:​​https://pan.quark.cn/s/625e0421dbf6​

它可以将 AI 模型带到手机本地,支持各类大模型和多模态任务,实现真正的 离线运行,让 AI 助手随时随地为你服务。

图片

项目简介

MnnLlmApp 是阿里巴巴基于 MNN-LLM 框架开源的 Android 应用,能够让多种大型语言模型(LLM)在手机上实现离线运行,无需联网即可完成各种 AI 任务。

其强大的性能表现和灵活的多模态支持,使其成为智能手机上运行人工智能的全新尝试。

目前,MnnLlmApp 支持多种任务类型,包括:文本生成文本、图像生成文本、音频转文本、文本生成图像等。

该应用的亮点在于其支持多种流行的 AI 模型,并且全部运行在本地,不仅提高了隐私保护,还减少了对网络连接的依赖。

功能亮点
  • • 多模态支持:提供多种任务功能,包括文本生成文本、图像生成文本、音频转文本及文本生成图像(基于扩散模型)。

  • • CPU推理优化:预填充速度相较于llama.cpp提高了8.6倍,相较于fastllm提升了20.5倍,解码速度分别快了2.3倍和8.9倍。

  • 图片

  • • 广泛的模型兼容性:支持多种领先的模型提供商,包括Qwen、Gemma、Llama(涵盖TinyLlama与MobileLLM)、Baichuan、Yi、DeepSeek、InternLM、Phi、ReaderLM和Smolm。

  • • 本地运行:完全在设备本地运行,确保数据隐私,无需将信息上传至外部服务器。

快速使用

可以通过 Releases 页面直接下载应用,开发者也可以自行构建该应用。

安卓APK安装包可自行到项目页面下载,也可根据文末提示路径提取。

以下为自构建编译步骤:

① 克隆代码库

git clone https://github.com/alibaba/MNN.git

② 构建库

cd project/android
mkdir build_64
../build_64.sh "-DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DMNN_ARM82=true -DMNN_USE_LOGCAT=true -DMNN_OPENCL=true -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_BUILD_DIFFUSION=ON -DMNN_SEP_BUILD=ON"

③ 复制到 LLM Android 应用项目

find . -name "*.so" -exec cp {} ../apps/MnnLlmApp/app/src/main/jniLibs/arm64-v8a/  \;

④ 构建 Android 应用项目并安装

cd ../apps/MnnLlmApp/
./gradlew installDebug

安装应用后,就可以浏览所有支持的模型,下载中意的模型,就能直接在应用内与模型交互。再之后可以通过侧边栏访问聊天历史,轻松查看和管理之前的对话记录。

写在最后

MnnLlmApp 通过将大规模语言模型与多模态任务能力带入 Android 手机,也给移动端离线 AI 应用带来一种新途径。

无论是文本生成、图像生成,还是音频转文本,它都能提供强大、快速的支持。而且所有功能都可以在本地完成,保护用户隐私的同时,确保流畅的用户体验。

对于开发者、创作者和AI爱好者而言,这款应用无疑是一个极具价值的工具。

### Spring Framework ApplicationEventPublisher Example and Usage In the context of the Spring framework, `ApplicationEventPublisher` is an interface that allows beans to publish events to the application context. This mechanism facilitates a loosely coupled architecture where components can notify each other about significant occurrences without being directly dependent on one another. The core classes involved in this event-driven model include: - **ApplicationEvent**: A class extending from which all custom events should derive. - **ApplicationListener<E extends ApplicationEvent>**: An interface implemented by any bean wishing to listen for specific types of events. - **ApplicationEventMulticaster**: The component responsible for broadcasting events to registered listeners within the ApplicationContext[^1]. To demonstrate how these pieces work together using `ApplicationEventPublisher`, consider the following code snippets illustrating both publishing and listening capabilities. #### Publishing Events with ApplicationEventPublisher A service or repository layer might want to inform others when certain actions occur. For instance, after saving data into storage, it could broadcast such activity as shown below: ```java @Service public class MyService { private final ApplicationEventPublisher publisher; @Autowired public MyService(ApplicationEventPublisher publisher) { this.publisher = publisher; } void performAction() { // Action logic here... CustomEvent event = new CustomEvent(this); publisher.publishEvent(event); // Publishes the event through the context } } ``` Here, upon executing some action inside `performAction()`, a new `CustomEvent` gets created and published via injection of `ApplicationEventPublisher`. #### Listening for Specific Events Using ApplicationListener On the receiving end, interested parties implement `ApplicationListener<SpecificEventType>` to react accordingly whenever their targeted type occurs: ```java @Component public class EventConsumer implements ApplicationListener<MyCustomEvent> { @Override public void onApplicationEvent(MyCustomEvent event) { System.out.println("Received my custom event : " + event.getMessage()); } } ``` This listener will automatically receive notifications every time a matching event (`MyCustomEvent`) happens anywhere across different parts of your application[^2]. Additionally, annotations like `@EventListener` provide even more concise syntax while offering flexibility regarding method signatures and parameters used during handling processes. By leveraging these constructs effectively, developers gain powerful tools enabling robust communication patterns throughout complex systems built atop Spring's foundation.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值