> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI 工作流概览

> 在 Qualcomm Dragonwing 设备上训练、转换和部署模型所支持的 AI 工作流概览。

本节介绍了一种使用 Qualcomm® 支持的工具、运行时和框架进行 AI 开发的模块化实践方法。\
无论您是在训练模型、部署预训练网络，还是构建多模态 AI 工作流，本指南都提供了模块化的实践方法。

本文档涵盖：

* 使用 **Edge Impulse 和 Qualcomm® AI Hub** 创建和训练模型
* 使用 **TensorFlow、LiteRT / TensorFlow Lite** 和 **ONNX Runtime** 结合 NPU 加速进行模型转换和推理
* 使用 Qualcomm AI 工具通过\*\*上下文二进制文件（.bin）和 DLC（.dlc）\*\*文件运行优化后的 AI 模型
* 使用 **Llama.cpp** 在本地执行大语言模型和视觉语言模型
* 使用**容器化的 OpenAI 兼容 API 服务**部署 LLM/VLM 工作负载
* 使用 **Qualcomm® Genie** 进行工作流编排和多模态 AI 流水线
* 使用 **Whisper** 在 NPU 或 CPU 上进行语音转录、翻译和语言识别
* 使用 **Qualcomm® IMSDK** 构建示例应用程序和视觉流水线
* 使用 **Qualcomm® QIRP SDK** 进行机器人和智能系统开发

每个部分都设计为独立内容，您可以直接跳到符合您项目需求的工具和流程。目标是提供清晰、可复用的示例和实用见解，帮助您将 AI 集成到真实的边缘应用中。

## 选择您的路径

使用下面的流程图找到适合您应用的路径。它会引导您判断是否已有模型、如何准备模型以及如何运行推理，然后链接到相应的 Ubuntu 工作流页面。每个高亮的方框都可以点击。

```mermaid theme={null}
%%{init: {"flowchart": {"rankSpacing": 110, "nodeSpacing": 65}} }%%
flowchart TD
    Q1{"Do you already have<br/>a trained model?"}

    Q1 -->|"No, just show me what it can do"| RunPrebuilt["Run prebuilt AI models & apps<br/>Qdemo UI · prebuilt samples · IM SDK"]
    Q1 -->|"I want to fine tune a model<br/>with my own data"| EI["Edge Impulse"]
    Q1 -->|"Yes / bring my own<br/>ONNX · PyTorch · TF · LiteRT"| GenQ{"Generative AI?<br/>LLM · VLM"}

    GenQ -->|"Yes"| GenAI["On-device GenAI workflows<br/>Genie · Llama.cpp · OpenAI-compatible container"]
    GenQ -->|"No, classic ML / vision"| Prep{"Prepare the model"}

    Prep -->|"Ready model, or BYOM in the cloud"| AIHub["Qualcomm AI Hub<br/>ready models · BYOM<br/>(optimize in the cloud)"]
    Prep -->|"Use optimized Qualcomm model files"| Context["Context binaries / DLC<br/>QAI AppBuilder"]
    Prep -->|"Recover quantized accuracy"| AIMET["AIMET (PTQ / QAT)"]

    AIHub --> Runtime{"Run inference"}
    Context --> Runtime
    AIMET --> Runtime

    Runtime -->|"Python / quick .tflite"| LiteRT["LiteRT / TFLite<br/>AI Engine Direct delegate"]
    Runtime -->|"ONNX models"| ONNXRun["ONNX Runtime<br/>AI Engine Direct"]
    Runtime -->|"Optimized .bin / .dlc files"| ContextRun["Context binaries + QAI AppBuilder"]
    Runtime -->|"Camera / video + AI pipeline"| IMSDK["Qualcomm IM SDK<br/>GStreamer · zero-copy · GPU pre/post"]

    click RunPrebuilt "/zh/Ubuntu/sample-applications/overview"
    click GenAI "/zh/Ubuntu/ai-workflows/genie"
    click AIHub "/zh/Ubuntu/ai-workflows/ai-hub"
    click Context "/zh/Ubuntu/ai-workflows/context-binaries"
    click AIMET "https://quic.github.io/aimet-pages/releases/latest/index.html"
    click EI "/zh/Ubuntu/ai-workflows/edge-impulse"
    click LiteRT "/zh/Ubuntu/ai-workflows/lite-rt"
    click ONNXRun "/zh/Ubuntu/ai-workflows/onnxruntime"
    click ContextRun "/zh/Ubuntu/ai-workflows/context-binaries"
    click IMSDK "/zh/Ubuntu/ai-workflows/im-sdk"

    classDef prep fill:#31017D,stroke:#31017D,color:#fff;
    classDef run fill:#3253DC,stroke:#3253DC,color:#fff;
    class AIHub,Context,AIMET,EI,GenAI prep;
    class RunPrebuilt,LiteRT,ONNXRun,ContextRun,IMSDK run;
```

<Note>
  设备端生成式 AI 的可用性取决于您的 Dragonwing 开发板和模型。请从[使用 Genie 运行 LLM](/zh/Ubuntu/ai-workflows/genie) 开始，在 Genie 不支持相应模型时使用 [Llama.cpp](/zh/Ubuntu/ai-workflows/llama-cpp) 作为备选方案。
</Note>

## 应用开发与执行流程摘要

| 流程                                   | 用途                                                                                                                   |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| [**Edge Impulse**](./edge-impulse)   | 使用音频、图像和其他传感器数据构建和训练 AI 模型——或以多种格式导入您自己的模型。                                                                          |
| [**Qualcomm® AI Hub**](./ai-hub)     | Qualcomm® AI Hub 简化了将视觉、音频和语音应用的 AI 模型部署到边缘设备的过程。您可以在几分钟内在托管的 Qualcomm 平台设备上优化、验证和部署您自己的 AI 模型。                      |
| [**转换 TensorFlow 模型**](./tensorflow) | 将 TensorFlow/Keras 模型（.keras、.h5）量化并转换为 `.tflite` 格式，以便部署到 NPU。                                                      |
| [**运行 LiteRT/TFLite 模型**](./lite-rt) | 使用 AI Engine Direct delegate 在 NPU 上执行 `.tflite` 模型（Python 或 C++）。适用于来自 TensorFlow、AI Hub 或 Edge Impulse 的模型。        |
| [**ONNX**](./onnxruntime)            | ONNX 通过导出模型实现跨平台 AI 部署。在 Dragonwing 设备上，搭配 AI Engine Direct 的 ONNX Runtime 可在 NPU 上执行以获得最佳性能。                        |
| [**运行上下文二进制文件**](./context-binaries) | 上下文二进制文件（.bin）和 .dlc 文件被 Genie、VoiceAI ASR 和 QAI AppBuilder 等 Qualcomm AI 工具用于在目标硬件上高效运行优化后的 AI 模型。                  |
| [**Llama.cpp**](./llama-cpp)         | 使用针对 GPU 和量化格式优化的 C++ 后端在本地执行大语言模型。                                                                                  |
| [**Qualcomm® Genie**](./genie)       | 使用 Qualcomm 的生成式 AI 运行时编排 AI 微服务和多模态工作流。                                                                             |
| [**Whisper**](./whisper)             | 在 Dragonwing 上使用 NPU（VoiceAI ASR）或 CPU（whisper.cpp）实现语音转录、翻译和语言识别。                                                   |
| [**Qualcomm® IMSDK**](./im-sdk)      | Qualcomm IMSDK 是一个多媒体和 AI SDK，用于在 Qualcomm Linux 平台上构建高性能视觉流水线。它包含 GStreamer 插件、AI 运行时集成和消息传递支持，可加速机器人、监控和嵌入式 AI 开发。 |
