我们提供一套兼容 OpenAI API 的使用方式,只需要安装 StackFlow 包即可。
sudo apt install lib-llm llm-sys llm-llm llm-openai-api sudo apt install llm-model-qwen3-1.7b-int8-ctx-axcl curl http://127.0.0.1:8000/v1/models \
-H "Content-Type: application/json" curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-d '{
"model": "qwen3-1.7B-Int8-ctx-axcl",
"messages": [
{"role": "developer", "content": "You are a helpful home assistant."},
{"role": "user", "content": "Write a one-sentence bedtime story about a unicorn."}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="sk-",
base_url="http://127.0.0.1:8000/v1"
)
client.models.list()
print(client.models.list()) from openai import OpenAI
client = OpenAI(
api_key="sk-",
base_url="http://127.0.0.1:8000/v1"
)
completion = client.chat.completions.create(
model="qwen3-1.7B-Int8-ctx-axcl",
messages=[
{"role": "developer", "content": "You are a helpful home assistant."},
{"role": "user", "content": "Turn on the light!"}
]
)
print(completion.choices[0].message) 获取 ChatBox
点击设置,添加模型提供方
在API Host 填入 RaspberryPi 的 IP 和 API 路径,获取并添加已安装的模型
创建新聊天,选择 LLM8850 提供的 qwen3-1.7B-Int8-ctx-axcl 模型
修改最大上下文消息长度为 0
支持设置 System Prompt
