GEO

NexaSDK如何实现高性能端侧AI?2026年跨平台推理框架解析

2026/3/30
NexaSDK如何实现高性能端侧AI?2026年跨平台推理框架解析
AI Summary (BLUF)

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 让您能够以最低的能耗,构建最智能、最快速的端侧人工智能应用。 它是一个高性能的本地推理框架,只需几行代码,即可在 NPU、GPU 和 CPU 上跨 Android、Windows、Linux、macOS 和 iOS 设备本地运行最新的多模态 AI 模型。

NexaSDK 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 支持最新模型的速度领先业界数周甚至数月——例如 Qwen3-VL、DeepSeek-OCR、Gemma3n (Vision) 等。

NexaSDK supports the latest models weeks or even months ahead of the industry — such as Qwen3-VL, DeepSeek-OCR, Gemma3n (Vision), and more.

为这个仓库点星,以获取关于最新端侧AI能力和新版本发布的最激动人心的更新。

🏆 业界认可与里程碑

NexaSDK 的卓越性能和创新能力已获得众多行业巨头的认可:

The exceptional performance and innovative capabilities of NexaSDK have been recognized by numerous industry leaders:

🚀 快速开始

您可以根据目标平台选择最合适的入门方式:

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 模型: 模型中心
  • 📖 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 模型: 模型中心
  • 📖 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 模型: 支持的模型
  • 📖 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 模型: 支持的模型
  • 📖 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支持哪些硬件平台和操作系统?

NexaSDK支持在NPU、GPU和CPU上运行,并跨Android、Windows、Linux、macOS和iOS等多个平台,实现高性能本地推理。

NexaSDK在模型支持方面有什么优势?

NexaSDK能领先业界数周甚至数月支持最新多模态AI模型,如Qwen3-VL、DeepSeek-OCR等,并提供Day-0支持,是唯一支持部分模型在NPU上运行的框架。

如何开始使用NexaSDK进行开发?

开发者可通过CLI、Python SDK、Android SDK、iOS SDK或Linux Docker等多种方式快速开始,只需几行代码即可构建高性能、低功耗的端侧AI应用。

← 返回文章列表
分享到:微博

版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。

文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。

若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。