Downloads · 30 days
59
14% of all-time downloads
jamescallander/gemma-2-2b-it_w8a8_g128_rk3588.rkllm
gemma-2-2b-it_w8a8_g128_rk3588.rkllm is a text generation model from jamescallander. Use it when you need the model to write or continue text. It is set up for rkllm. The card lists the license as gemma.
Gemma-2-2B-It — RKLLM build for RK3588 boards
Downloads · 30 days
59
14% of all-time downloads
All-time downloads
437
Public
Repo size
4.1 GB
Likes
0
Public
Click a slice to open those files.
.rkllm4.1 GB · 100%
From the Hugging Face model README
Gemma-2-2B-It — RKLLM build for RK3588 boards
Author: @jamescallander
Source model: google/gemma-2-2b-it · Hugging Face
Target: Rockchip RK3588 NPU via RKNN-LLM Runtime
This repository hosts a conversion of
gemma-2-2b-itfor use on Rockchip RK3588 single-board computers (Orange Pi 5 plus, Radxa Rock 5b+, Banana Pi M7, etc.). Conversion was performed using the RKNN-LLM toolkit
RKLLM-Toolkit version: v1.2.1
NPU driver: v0.9.8
Python: 3.10
Quantization: w8a8_g128
Output: single-file .rkllm artifact
Modifications: quantization (w8a8_g128), export to .rkllm format for RK3588 SBCs
Tokenizer: not required at runtime (UI handles prompt I/O)
w8a8_g128) may show small quality differences vs. full-precision upstream.The RKNN-LLM toolkit and instructions can be found on the specific development board's manufacturer website or from airockchip's github page.
Download and install the required packages as per the toolkit's instructions.
The simplest way the deploy the .rkllm converted model is using an example script provided in the toolkit in this directory: rknn-llm/examples/rkllm_server_demo
python3 <TOOLKIT_PATH>/rknn-llm/examples/rkllm_server_demo/flask_server.py \
--rkllm_model_path <MODEL_PATH>/gemma-2-2b-it_w8a8_g128_rk3588.rkllm \
--target_platform rk3588
A basic format for message request is:
{
"model":"gemma-2-2b-it",
"messages":[{
"role":"user",
"content":"<YOUR_PROMPT_HERE>"}],
"stream":false
}
Example request using curl:
curl -s -X POST <SERVER_IP_ADDRESS>:8080/rkllm_chat \
-H 'Content-Type: application/json' \
-d '{"model":"gemma-2-2b-it","messages":[{"role":"user","content":"Explain who Napoleon Bonaparte is in two or three sentences."}],"stream":false}'
The response is formated in the following way:
{
"choices":[{
"finish_reason":"stop",
"index":0,
"logprobs":null,
"message":{
"content":"<MODEL_REPLY_HERE">,
"role":"assistant"}}],
"created":null,
"id":"rkllm_chat",
"object":"rkllm_chat",
"usage":{
"completion_tokens":null,
"prompt_tokens":null,
"total_tokens":null}
}
Example response:
{"choices":[{"finish_reason":"stop","index":0,"logprobs":null,"message":{"content":"Napoleon Bonaparte was a French military and political leader who rose to prominence during the French Revolution. He became Emperor of France in 1804, leading his armies to conquer much of Europe before being defeated at the Battle of Waterloo in 1815. His legacy is complex, marked by both military brilliance and authoritarian rule, leaving a lasting impact on European history. ","role":"assistant"}}],"created":null,"id":"rkllm_chat","object":"rkllm_chat","usage":{"completion_tokens":null,"prompt_tokens":null,"total_tokens":null}}
This server exposes an OpenAI-compatible Chat Completions API.
You can connect it to any OpenAI-compatible client or UI (for example: Open WebUI)
http://<SERVER_IP_ADDRESS>:8080 and use the endpoint: /rkllm_chatmodel field matches the converted model’s name, for example:{
"model": "gemma-2-2b-it",
"messages": [{"role":"user","content":"Hello!"}],
"stream": false
}
This conversion follows the license of the source model:
Gemma Terms of Use
NOTICE