NexaSDK如何实现高性能端侧AI?2026年跨平台推理框架解析
NexaSDK is a high-performance local inference framework that enables developers to run the latest multimodal AI models on NPU, GPU, and CPU across multiple platforms with minimal energy consumption and maximum speed.
原文翻译: NexaSDK是一个高性能本地推理框架,让开发者能够在NPU、GPU和CPU上以最低能耗和最高速度运行最新的多模态AI模型,支持跨多个平台。
引言
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 让您能够以最低的能耗,构建最智能、最快速的端侧人工智能应用。 它是一个高性能的本地推理框架,只需几行代码,即可在 NPU、GPU 和 CPU 上跨 Android、Windows、Linux、macOS 和 iOS 设备本地运行最新的多模态 AI 模型。
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 enables you to build the smartest and fastest on-device AI applications with minimal energy consumption. It is a high-performance local inference framework that runs the latest multimodal AI models locally on NPU, GPU, and CPU across Android, Windows, Linux, macOS, and iOS devices with just a few lines of code.
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 支持最新模型的速度领先业界数周甚至数月——例如 Qwen3-VL、DeepSeek-OCR、Gemma3n (Vision) 等。
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 supports the latest models weeks or even months ahead of the industry — such as Qwen3-VL, DeepSeek-OCR, Gemma3n (Vision), and more.
⭐ 为这个仓库点星,以获取关于最新端侧AI能力和新版本发布的最激动人心的更新。
🏆 业界认可与里程碑
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 的卓越性能和创新能力已获得众多行业巨头的认可:
The exceptional performance and innovative capabilities of NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 have been recognized by numerous industry leaders:
- 高通 (Qualcomm) 在其官方博客中三次专题报道我们。
- 在 Qualcomm Hexagon NPU 上创新多模态 AI。
- 为计算、移动平台、汽车和物联网提供首个 Day-0 模型支持。
- 通过 Snapdragon 将端侧AI轻松带入智能手机。
- Qualcomm has featured us three times in their official blogs.
- Qwen 因我们提供 Day-0 Qwen3-VL 在 NPU、GPU 和 CPU 上的支持 而专题报道。我们在 GGUF 格式支持上领先 Ollama 和 llama.cpp 三周,并且至今仍是唯一支持其在 NPU 上运行的框架。
- Qwen featured us for Day-0 Qwen3-VL support on NPU, GPU, and CPU. We were 3 weeks ahead of Ollama and llama.cpp on GGUF support, and remain the only framework supporting it on NPU to date.
- IBM 在其官方博客中将我们的 NexaML 推理引擎与 vLLM、llama.cpp 和 MLX 并列提及,并认可了我们对 Day-0 Granite 4.0 的支持。
- IBM featured our NexaML inference engine alongside vLLM, llama.cpp, and MLX in their official blog and acknowledged our Day-0 Granite 4.0 support.
- 谷歌 (Google) 因我们提供 EmbeddingGemma 的 Day-0 NPU 支持 而专题报道。
- Google featured us for EmbeddingGemma Day-0 NPU support.
- AMD 因我们 在 AMD NPU 上实现 SDXL-turbo 图像生成 而专题报道。
- AMD featured us for enabling SDXL-turbo image generation on AMD NPU.
- 英伟达 (NVIDIA) 在其官方博客中介绍了由 NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 驱动的热门本地AI应用 Hyperlink。
- NVIDIA featured Hyperlink, a popular local AI app powered by NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。, in their official blog.
- 微软 (Microsoft) 在 Microsoft Ignite 2025 大会上将我们作为官方合作伙伴进行展示。
- Microsoft presented us on stage at Microsoft Ignite 2025 as an official partner.
- 英特尔 (Intel) 因我们在 NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。 中提供 Intel NPU 支持 而专题报道。
- Intel featured us for Intel NPU support in NexaSDK.
🚀 快速开始
您可以根据目标平台选择最合适的入门方式:
You can choose the most suitable way to get started based on your target platform:
| 平台 / Platform | 链接 / Links |
|---|---|
| 🖥️ CLI | 快速开始 | 文档 |
| 🐍 Python | 快速开始 | 文档 |
| 🤖 Android | 快速开始 | 文档 |
| 🐳 Linux Docker | 快速开始 | 文档 |
| 🍎 iOS | 快速开始 | 文档 |
🖥️ CLI
下载:
Download:
| Windows | macOS | Linux |
|---|---|---|
| arm64 (Qualcomm NPU) | arm64 (Apple Silicon) | arm64 |
| x64 (Intel/AMD NPU) | x64 | x64 |
运行您的第一个模型:
Run your first model:
# Chat with Qwen3
nexa infer ggml-org/Qwen3-1.7B-GGUF
# Multimodal: drag images into the CLI
nexa infer NexaAI/Qwen3-VL-4B-Instruct-GGUF
# NPU (Windows arm64 with Snapdragon X Elite)
nexa infer NexaAI/OmniNeural-4B
- 支持的模型类型: LLM、多模态、ASR、OCR、Rerank、目标检测、图像生成、Embedding
- Supported Model Types: LLM, Multimodal, ASR, OCR, Rerank, Object Detection, Image Generation, Embedding
- 支持的格式: GGUF、MLX、NEXA
- Supported Formats: GGUF, MLX, NEXA
- NPU 模型: 模型中心
- NPU Models: Model Hub
- 📖 CLI 参考文档
🐍 Python SDK
通过 pip 安装 SDK:
Install the SDK via pip:
pip install nexaai
使用 Python 代码加载并运行模型:
Load and run a model using Python code:
from nexaai import LLM, GenerationConfig, ModelConfig, LlmChatMessage
llm = LLM.from_(model="NexaAI/Qwen3-0.6B-GGUF", config=ModelConfig())
conversation = [
LlmChatMessage(role="user", content="Hello, tell me a joke")
]
prompt = llm.apply_chat_template(conversation)
for token in llm.generate_stream(prompt, GenerationConfig(max_tokens=100)):
print(token, end="", flush=True)
- 支持的模型类型: LLM、多模态、ASR、OCR、Rerank、目标检测、图像生成、Embedding
- Supported Model Types: LLM, Multimodal, ASR, OCR, Rerank, Object Detection, Image Generation, Embedding
- 支持的格式: GGUF、MLX、NEXA
- Supported Formats: GGUF, MLX, NEXA
- NPU 模型: 模型中心
- NPU Models: Model Hub
- 📖 Python SDK 文档
🤖 Android SDK
在您的 app/AndroidManifest.xml 中添加:
Add to your
app/AndroidManifest.xml:
<application android:extractNativeLibs="true">
在您的 build.gradle.kts 中添加依赖:
Add the dependency to your
build.gradle.kts:
dependencies {
implementation("ai.nexa:core:0.0.19")
}
初始化 SDK 并运行模型:
Initialize the SDK and run a model:
// Initialize SDK
NexaSdk.getInstance().init(this)
// Load and run model
VlmWrapper.builder()
.vlmCreateInput(VlmCreateInput(
model_name = "omni-neural",
model_path = "/data/data/your.app/files/models/OmniNeural-4B/files-1-1.nexa",
plugin_id = "npu",
config = ModelConfig()
))
.build()
.onSuccess { vlm ->
vlm.generateStreamFlow("Hello!", GenerationConfig()).collect { print(it) }
}
- 系统要求: Android minSdk 27,Qualcomm Snapdragon 8 Gen 4 芯片
- Requirements: Android minSdk 27, Qualcomm Snapdragon 8 Gen 4 Chip
- 支持的模型类型: LLM、多模态、ASR、OCR、Rerank、Embedding
- Supported Model Types: LLM, Multimodal, ASR, OCR, Rerank, Embedding
- NPU 模型: 支持的模型
- NPU Models: Supported Models
- 📖 Android SDK 文档
🐳 Linux Docker
拉取 Docker 镜像并运行:
Pull the Docker image and run:
docker pull nexa4ai/nexasdk:latest
export NEXA_TOKEN="your_token_here"
docker run --rm -it --privileged \
-e NEXA_TOKEN \
nexa4ai/nexasdk:latest infer NexaAI/Granite-4.0-h-350M-NPU
- 系统要求: Qualcomm Dragonwing IQ9,ARM64 系统
- Requirements: Qualcomm Dragonwing IQ9, ARM64 systems
- 支持的模型类型: LLM、VLM、ASR、CV、Rerank、Embedding
- Supported Model Types: LLM, VLM, ASR, CV, Rerank, Embedding
- NPU 模型: 支持的模型
- NPU Models: Supported Models
- 📖 Linux Docker 文档
🍎 iOS SDK
下载 NexaSdk.xcframework 并将其添加到您的 Xcode 项目中。
Download NexaSdk.xcframework and add it to your Xcode project.
使用 Swift 代码示例(如语音识别):
Example usage with Swift code (e.g., Speech Recognition):
import NexaSdk
// Example: Speech Recognition
let asr = try Asr(plugin: .ane)
try await asr.load(from: modelURL)
let result = try await asr.transcribe(options: .init(audioPath: "audio.wav"))
print(result.asrResult.transcript)
- 系统要求: iOS 17.0+ / macOS 15.0+, Swift 5.9+
- Requirements: iOS 17.0+ / macOS 15.0+, Swift 5.9+
- 支持的模型类型: LLM、
常见问题(FAQ)
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。支持哪些硬件平台和操作系统?
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。支持在NPU、GPU和CPU上运行,并跨Android、Windows、Linux、macOS和iOS等多个平台,实现高性能本地推理。
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。在模型支持方面有什么优势?
NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。能领先业界数周甚至数月支持最新多模态AI能够同时处理和整合多种类型数据(如文本、图像、音频)的人工智能系统模型,如Qwen3-VL、DeepSeek-OCR等,并提供Day-0支持在新模型发布当天或极短时间内提供支持的能力,体现技术响应速度和兼容性优势。,是唯一支持部分模型在NPU上运行的框架。
如何开始使用NexaSDK一个高性能的本地推理框架,能够在设备端运行最新的多模态AI模型,支持NPU、GPU和CPU硬件加速。进行开发?
开发者可通过CLI、Python SDK、Android SDK、iOS SDK或Linux Docker等多种方式快速开始,只需几行代码即可构建高性能、低功耗的端侧AI应用。
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。