能力标签
🛠
AI工具

RK AI工具

基于 Python · 开源免费,本地部署,数据完全自主可控
英文名:rkllama
⭐ 560 Stars 🍴 95 Forks 💻 Python 📄 GPL-3.0 🏷 AI 8.0分
8.0AI 综合评分
ainpurockchippython
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,RK AI工具 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。

📚 深度解析

RK AI工具 是一款基于 Python 的开源工具,在 GitHub 上收获 1k+ Star,是ai、npu、rockchip、python领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
RK AI工具 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 RK AI工具 的版本更新,及时通知重要功能变化。

📋 工具概览

高效的AI解决方案,支持Rockchip NPU

RK AI工具 是一款基于 Python 开发的开源工具,专注于 ai、npu、rockchip 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 560
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
GPL-3.0
AI 综合评分
8.0 分
工具类型
AI工具
Forks
95

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

高效的AI解决方案,支持Rockchip NPU

RK AI工具 是一款基于 Python 开发的开源工具,专注于 ai、npu、rockchip 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:pip 安装(推荐)
pip install rkllama

# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install rkllama

# 方式三:从源码安装(获取最新功能)
git clone https://github.com/NotPunchnox/rkllama
cd rkllama
pip install -e .

# 验证安装
python -c "import rkllama; print('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
rkllama --help

# 基本用法
rkllama input_file -o output_file

# Python 代码中调用
import rkllama

# 示例
result = rkllama.process("input")
print(result)
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# rkllama 配置文件示例(config.yml)
app:
  name: "rkllama"
  debug: false
  log_level: "INFO"

# 运行时指定配置文件
rkllama --config config.yml

# 或通过环境变量配置
export RKLLAMA_API_KEY="your-key"
export RKLLAMA_OUTPUT_DIR="./output"
📑 README 深度解析 真实文档 完整度 56/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

RKLLama: LLM Server and Client for Rockchip 3588/3576

Overview

A server to run and interact with LLM models optimized for Rockchip RK3588(S) and RK3576 platforms. The difference from other software of this type like Ollama or Llama.cpp is that RKLLama allows models to run on the NPU.

  • Version Lib rkllm-runtime: V 1.3.0.
  • Version Lib rknn-runtime: V 2.3.2.

Main Features

  • Running models on NPU.
  • Ollama API compatibility - Support for:
  • /api/chat
  • /api/generate
  • /api/ps
  • /api/tags
  • /api/embed (and legacy /api/embeddings)
  • /api/version
  • /api/pull
  • Partial OpenAI API compatibility - Support for:
  • /v1/completions
  • /v1/chat/completions
  • /v1/embeddings
  • /v1/images/generations
  • /v1/audio/speech
  • /v1/audio/transcriptions
  • /v1/audio/translations (to English only for now like OpenAI with Whisper models)
  • Tool/Function Calling - Complete support for tool calls with multiple LLM formats (Qwen, Llama 3.2+, others).
  • Pull models directly from Huggingface.
  • Include a API REST with documentation.
  • Listing available models.
  • Multiples RKLLM and RKNN models running in memory simultaniusly (parallels executions between distintct models in stream mode, FIFO if non stream)
  • Dynamic loading and unloading of models:
  • Load the model after new request (if not in memory already)
  • Unload when model expires after inactivity (default 30 min)
  • Unload the oldest model in memory if new model is required to be loaded and there is not memory available in the server
  • Automatically Prompt Cache file saving for each chat sessions of the same llm model:
  • Allow fast response in large context chat sessions when swiching between them for the same model. Usefull if you are using a model in Openclaw (large context chat sessions) and other agents or tools (like OpenWebui) with the same model without affecting performance in any chat session.
  • Allow to restore previous chat sessions for fast inference even if the model was unloaded previously from memory
  • Prompt cache files are saved for 7 days by default (configurable) and then deleted automatically if not used.
  • Inference requests with streaming and non-streaming modes.
  • Message history.
  • Simplified custom model naming - Use models with familiar names like "qwen2.5:3b".
  • CPU Model Auto-detection - Automatic detection of RK3588 or RK3576 platform.
  • Optional Debug Mode - Detailed debugging with --debug flag.
  • Multimodal Suport - Use Qwen2VL/Qwen2.5VL/Qwen3VL/MiniCPMV4/MiniCPMV4.5/InternVL3.5 vision models to ask questions about images (base64, local file or URL image address). More than one image in the same request is allowed.
  • Image Generation - Generate images with OpenAI Image generation endpoint using model LCM Stable Diffusion 1.5 RKNN models.
  • Text to Speech (TTS) - Generate speech with OpenAI Audio Speech endpoint using models for Piper TTS running encoder with ONNX and decoder with RKNN and MMS-TTS with RKNN.
  • Speech to Text (STT) - Generate transcriptions with OpenAI Audio Transcriptions endpoint using models for omniASR-CTC or whisper running the model with RKNN.
  • EXPERIMENTAL - Support for .GGUF models in NPU throught a great llama.cpp fork of user @invisiofficial (https://github.com/invisiofficial/rk-llama.cpp)

Upcoming Features

  • Add RKNN for onnx models (TTS, image classification/segmentation...)
  • GGUF/HF to RKLLM conversion software

---

System Monitor:

---

Installation

Docker Installation

Pull the RKLLama Docker image:

docker pull ghcr.io/notpunchnox/rkllama:main
run server
docker run -it --privileged -p 8080:8080 -v <local_models_dir>:/opt/rkllama/models ghcr.io/notpunchnox/rkllama:main 

Set up by: ichlaffterlalu

Docker Compose

Docker Compose facilities much of the extra flags declaration such as volumes:

docker compose up --detach --remove-orphans

**Manual Installation**

1. Download the Model - Download .rkllm models directly from Hugging Face. - Alternatively, convert your GGUF models into .rkllm format (conversion tool coming soon on my GitHub).

2. Place the Model - Create the models directory on your system. - Make a new subdirectory with model name. - Place the .rkllm files in this directory. - Create Modelfile and add this :

    FROM="file.rkllm"
    HUGGINGFACE_PATH="huggingface_repository"
    SYSTEM="Your system prompt"
    TEMPERATURE=1.0
    

Example directory structure:

   ~/RKLLAMA/models/
       └── TinyLlama-1.1B-Chat-v1.0
           |── Modelfile
           └── TinyLlama-1.1B-Chat-v1.0.rkllm
   

You must provide a link to a HuggingFace repository to retrieve the tokenizer and chattemplate. An internet connection is required for the tokenizer initialization (only once), and you can use a repository different from that of the model as long as the tokenizer is compatible and the chattemplate meets your needs. Tokenizer gets downloaded for the first time in the models directory

**For Multimodal Encoder Model (.rknn) Installation**

1. Download the encoder model .rknn - Download .rknn models directly from Hugging Face. - Alternatively, convert your ONNX models into .rknn format. - Place the .rknn model inside the models directory. RKLLama detected the encoder model present in the directory. - Include manually the following properties in the Modelfile according to the conversion properties used for the conversion of the vision encoder .rknn:

    IMAGE_WIDTH=448
    IMAGE_HEIGHT=
    N_IMAGE_TOKENS=
    IMG_START=
    IMG_END=
    IMG_CONTENT=

    # For example, for Qwen2VL/Qwen2.5VL:

    IMAGE_WIDTH=392
    IMAGE_HEIGHT=392
    N_IMAGE_TOKENS=196
    IMG_START=<|vision_start|>
    IMG_END=<|vision_end|>
    IMG_CONTENT=<|image_pad|>

    # For example, for MiniCPMV4:

    IMAGE_WIDTH=448
    IMAGE_HEIGHT=448
    N_IMAGE_TOKENS=64
    IMG_START=<image>
    IMG_END=</image>
    IMG_CONTENT=<unk>
   

Example directory structure for multimodal:

   ~/RKLLAMA/models/
       └── qwen2-vision\:2b
           |── Modelfile
           └── Qwen2-VL-2B-Instruct.rkllm
           └── Qwen2-VL-2B-Instruct.rknn
   

**For Image Generation Installation**

1. In a temporary folder, clone the repository https://huggingface.co/danielferr85/lcm-sd-1.5-rknn-2.3.2-rk3588 or https://huggingface.co/danielferr85/lcm-ssd-1b-rknn-2.3.2-rk3588 from Hugging Face for the desired SD model 2. Execute the ONNX to RKNN convertion of the models for your needs WITH RKNN TOOLKIT LIBRARY VERSION 2.3.2. For example: For LCM SD 1.5

    python convert-onnx-to-rknn.py --model-dir <directory_download_model> --resolutions 512x512 --components "text_encoder,unet,vae_decoder" --target_platform rk3588
   
or

For LCM SSD1B

    python convert-onnx-to-rknn.py --model-dir <directory_download_model> --resolutions 1024x1024 --components "text_encoder,text_encoder_2,unet,vae_decoder" --target_platform rk3588
   
3. Create a folder inside the models directory in RKLLAMA for the Stable Diffusion RKNN models, For example: lcm-stable-diffusion or lcm-segmind-stable-diffusion 4. Copy the folders: "scheduler, text_encoder, text_encoder_2 (for SSD1B only), unet, vae_decoder" from the cloned repo to the new directory model created in RKLLMA. Just copy the .json and .rknn files. 5. The structure of the model MUST be like this:

For LCM SD 1.5

   ~/RKLLAMA/models/
       └── lcm-stable-diffusion
           |── scheduler
              |── scheduler_config.json
           └── text_encoder
              |── config.json
              |── model.rknn
           └── unet
              |── config.json
              |── model.rknn
           └── vae_decoder
              |── config.json
              |── model.rknn
           
   

or

For LCM SSD1B

   ~/RKLLAMA/models/
       └── lcm-segmind-stable-diffusion
           |── scheduler
              |── scheduler_config.json
           └── text_encoder
              |── config.json
              |── model.rknn
           └── text_encoder_2
              |── config.json
              |── model.rknn
           └── unet
              |── config.json
              |── model.rknn
           └── vae_decoder
              |── config.json
              |── model.rknn
           
   

  1. Done! You are ready to test the OpenAI endpoint /v1/images/generations to generate images. You can add it to OpenWebUI in the Image Generation section.
  2. Available converted models for RK3588/RK3576 and RKNN 2.3.2 at: https://huggingface.co/danielferr85/lcm-sd-1.5-rknn-2.3.2-rk3588 (only 512x512 resolutions) and https://huggingface.co/danielferr85/lcm-ssd-1b-rknn-2.3.2-rk3588 (only 1024x1024 resolutions)

**For Speech Generation (TTS) Installation**

For Piper:

  1. Download a voice from https://huggingface.co/danielferr85/piper-checkpoints-rknn from Hugging Face. (You can convert new ones, see below)
  2. Create a folder inside the models directory in RKLLAMA for the piper Audio model, For example: es_AR-daniela-high
  3. Copy the encoder (.onnx), decoder (.rknn) and config (piper.json) file from the choosed voice to the new directory model created in RKLLMA.
  4. The structure of the model MUST be like this:
   ~/RKLLAMA/models/
       └── es_AR-daniela-high
           |── encoder.onnx
           └── decoder.rknn
           └── piper.json
          
   

For MMS-TTS:

  1. Download a voice from https://huggingface.co/danielferr85/mms-tts-rknn from Hugging Face. (You can convert new ones, see below)
  2. Create a folder inside the models directory in RKLLAMA for the piper Audio model, For example: mms_tts_spa
  3. Copy the encoder (.rknn), decoder (.rknn) and vocab (mms_tts.json) file from the choosed voice to the new directory model created in RKLLMA.
  4. The structure of the model MUST be like this:
   ~/RKLLAMA/models/
       └── mms_tts_spa
           |── encoder/
               |── encoder.rknn
           └── decoder/
               └── decoder.rknn
           └── mms_tts.json   
          
   
  1. Done! You are ready to test the OpenAI endpoint /v1/audio/speech to generate audio. You can add it to OpenWebUI in the Audio section for TTS.

IMPORTANT For Piper: - You must convert only your decoder (.rknn) for your specific platform (for example rk3588). - The encoder can have any name but must ended with extension .onnx - The decoder can have any name but must ended with extension .rknn - The config of the model must have the name piper.json - You must use rknn-toolkit 2.3.2 for RKNN conversion because is the one used by RKLLAMA - Always CHECK THE LICENSE of the voice that you are going to use. - In OpenAI request, the argument model is the name of the model folder that you create and the argument voice is the speaker of the voice if the voice is multispeaker (For example 'F' (Female) or 'M' (Male). Check the config of the model). If the model is monospeaker, then voice can be skipped. - You can convert any Piper TTS model (or create one, or finetuning one) creating first the encoder and decoder in ONNX format and then converting the decoder in RKNN: 1. Clone this repo and branch streaming: https://github.com/mush42/piper/tree/streaming 2. Create a virtual environemnt and install that repo 3. Clone the repository https://huggingface.co/danielferr85/piper-checkpoints-rknn from Hugging Face 4. Download the entire folder of the voice to convert from dataset: https://huggingface.co/datasets/rhasspy/piper-checkpoints and put it inside the repo piper-checkpoints-rknn (the structure must be for example: es/es_MX/ald/medium/). You can also use the script download_models.py from download automatically the model you want. 5. Execute the script export_encoder_decoder.py to export the encoder and decoder IN ONNX format. 6. Execute the script export_rknn.py to export the decoder in RKNN format (you must uhave installed the rknn-toolkit version 2.3.2).

For MMS-TTS: - You must convert your encoder and decoder (.rknn) for your specific platform (for example rk3588). - The encoder can have any name but must ended with extension .rknn and must be placed inside a folder called encoder - The decoder can have any name but must ended with extension .rknn and must be placed inside a folder called decoder - The vocab of the model must have the name mms_tts.json - You must use rknn-toolkit 2.3.2 for RKNN conversion because is the one used by RKLLAMA - Always CHECK THE LICENSE of the voice that you are going to use. - In OpenAI request, the argument model is the name of the model folder that you create and the argument voice is the speaker of the voice if the voice is multispeaker but in MMS-TTS always is monospeaker, then voice is skipped. - You can convert more mms_tts models. Check: https://github.com/airockchip/rknn_model_zoo/tree/main/examples/mms_tts

**For Transcriptions Generation (STT) Installation**

  • For OmniASR CTC models:
  1. Download a model from https://huggingface.co/danielferr85/omniASR-ctc-rknn from Hugging Face.
  2. Create a folder inside the models directory in RKLLAMA for the model, For example: omniasr-ctc:300m
  3. Copy the model (.rknn) and vocabulary (omniasr.txt) file from the choosed model to the new directory model created in RKLLMA.
  4. The structure of the model MUST be like this:
   ~/RKLLAMA/models/
       └── omniasr-ctc:300m
           └── model.rknn
           └── omniasr.txt
          
   

IMPORTANT - The model can have any name but must ended with extension .rknn - The vocabulary of the model must be the name omniasr.txt - You must use rknn-toolkit 2.3.2 for RKNN conversion because is the one used by RKLLAMA

  • For Whisper models:
  1. Download a model from https://huggingface.co/danielferr85/whisper-with_past-models-rknn from Hugging Face.
  2. Create a folder inside the models directory in RKLLAMA for the model, For example: whisper-large-v3-turbo
  3. Copy the encoder model (.rknn), decoder model (.rknn), decoder with past model (.rknn), whisper.ini and tokenizer folder from the choosed model to the new directory model created in RKLLMA.
  4. The structure of the model MUST be like this:

   ~/RKLLAMA/models/
       └── whisper-large-v3-turbo
           └── encoder
               └── model_encoder.rknn
           └── decoder
               └── model_decoder.rknn 
           └── decoder_with_past
               └── model_decoder_with_past.rknn
           └── tokenizer
              └── tokenizer_config.json
              └── tokenizer.json
           └── whisper.ini
          
   
IMPORTANT - The models can have any name but must ended with extension .rknn and must be in the correct folder structure - The tokenizer folder is the same as the original official Whisper model - The whisper.ini file can be modified to adjust the properties of the VAD if needed - You must use rknn-toolkit 2.3.2 for RKNN conversion because is the one used by RKLLAMA

Done! You are ready to test the OpenAI endpoint /v1/audio/transcriptions to generate transcriptions. You can add it to OpenWebUI in the Audio section for STT.

Uninstall

1. Remove the pyhton package rkllama

    pip uninstall rkllama
    
Output: Image

---

Usage

Tool Calling Quick Start

RKLLama supports advanced tool/function calling for enhanced AI interactions:

```bash

Example: Weather tool call

curl -X POST http://localhost:8080/api/chat \ -H "Content-Type: application/json" \ -d '{ "model": "qwen2.5:3b", "messages": [{"role": "user", "content": "What is the weather in Paris?"}], "tools": [{ "type": "function", "function": { "name": "get_weather", "description": "Get current weather", "parameters": { "type": "object", "properties": { "location": {"type": "string", "description": "City name"} }, "required": ["location"] } } }] }' ```

Features: - 🔧 Multiple model support (Qwen, Llama 3.2+, others) - 🌊 Streaming & non-streaming modes - 🎯 Robust JSON parsing with fallback methods - 🔄 Auto format normalization - 📋 Multiple tools in single request

For complete documentation: Tool Calling Guide

Tested Hardware and Environment

  • Hardware: Orange Pi 5 Pro: (Rockchip RK3588S, NPU 6 TOPS), 16GB RAM.
  • Hardware: Orange Pi 5 Plus: (Rockchip RK3588S, NPU 6 TOPS), 16GB RAM.
  • Hardware: Orange Pi 5 Max: (Rockchip RK3588S, NPU 6 TOPS), 16GB RAM.
  • Hardware: Radxa Rock 4d: (Rockchip RK3576, NPU 6 TOPS), 16GB RAM.
  • OS: Ubuntu 24.04 arm64.
  • OS: Armbian Linux 6.1.99-vendor-rk35xx (Debian stable bookworm), v25.2.2.

Configuration

RKLLAMA uses a flexible configuration system that loads settings from multiple sources in a priority order:

See the Configuration Documentation for complete details.

🎯 aiskill88 AI 点评 A 级 2026-06-24

高效的AI解决方案,支持Rockchip NPU

⚡ 核心功能

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +GPL-3.0 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

请参考项目文档和示例代码
💡 AI Skill Hub 点评

AI Skill Hub 点评:RK AI工具 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

📚 深入学习 RK AI工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 rkllama
Topics ainpurockchippython
GitHub https://github.com/NotPunchnox/rkllama
License GPL-3.0
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/NotPunchnox/rkllama

收录时间:2026-06-24 · 更新时间:2026-06-24 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →