OpenThai-SystemOne 新
OpenThai-SystemOne 是 iApp Technology 与 OpenThai 推出的开源(Apache 2.0)泰语与英语 System One 决策模型。它不生成文本。你发送一个 state(任意文本或 JSON:客服工单、评论、文档、界面无障碍树)和一个或多个结构化 问题,它在一次前向计算中返回每个问题每个选项的校准概率。HTTP 接口与 TypeSafe AI 的 Jev 所用的 POST /v1/systemone 形状一致,为该 API 编写的 SDK 代码无需修改即可指向本端点。
| 问题类型 | 你提供 | 你得到 |
|---|---|---|
choice | 指令和最多 255 个命名选项(可带描述) | 最佳选项、每个选项的概率、confidence、abstain |
score | 指令和 2 到 10 个有序等级 | 概率加权得分(可为小数)和每个等级的概率 |
noul | 一个是/否问题 | noul = P(是) |
- 模型页面:OpenThai-SystemOne
- 开放权重:huggingface.co/iapp/OpenThai-SystemOne
- 代码与训练方案:github.com/iapp-technology/openthai-systemone
快速开始
-
前提条件
- 免费的 iApp API key:注册,进入 API Keys,点击 Create New API Key
- 需要决策的状态,以及你想回答的问题
-
端点
端点 POST https://api.iapp.co.th/v3/store/openthai/systemone认证 apikey: <key>请求头请求体 JSON: state(字符串或任意 JSON)和questions(结构化问题的映射)限制 免费预览期间每个 key 每分钟 100 次请求、每天 1,000 次决策;每个 choice最多 255 个选项,每个score2 到 10 个等级,每次请求 64K token输出 每个问题一个答案的 JSON, usage.output_tokens始终为 0
请访问 API Key 管理 页面查看现有 API key 或申请新的 key。
在线体验
四个预设:泰语工单分流、泰语评论审核、为智能体选择界面元素、 英语 RAG 相关性判断。可编辑状态或问题,然后点击提问。登录后会自动填入你的 API key。
代码示例
同一个请求的各语言版本:一条泰语客服工单,三个问题,一次调用。
- cURL
- Python
- JavaScript
curl -s https://api.iapp.co.th/v3/store/openthai/systemone \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": {"ticket": "โดนหักเงินซ้ำสองครั้งเมื่อวานนี้ ขอเงินคืนด่วนนะครับ โทรไปสามรอบแล้วไม่มีใครรับ"},
"questions": {
"department": {"type": "choice", "instructions": "ทีมใดควรรับผิดชอบ",
"criteria": {"billing": "การเงิน/คืนเงิน", "technical": "ระบบใช้งานไม่ได้", "sales": null}},
"frustration": {"type": "score", "instructions": "ลูกค้าหงุดหงิดแค่ไหน",
"criteria": ["ใจเย็น", "หงุดหงิดแต่สุภาพ", "โกรธมาก"]},
"refund": {"type": "noul", "instructions": "ลูกค้าขอเงินคืนอย่างชัดเจนหรือไม่"}
}
}'
import requests
resp = requests.post(
"https://api.iapp.co.th/v3/store/openthai/systemone",
headers={"apikey": "YOUR_API_KEY"},
json={
"state": {"ticket": "โดนหักเงินซ้ำสองครั้งเมื่อวานนี้ ขอเงินคืนด่วนนะครับ โทรไปสามรอบแล้วไม่มีใครรับ"},
"questions": {
"department": {"type": "choice", "instructions": "ทีมใดควรรับผิดชอบ",
"criteria": {"billing": "การเงิน/คืนเงิน", "technical": "ระบบใช้งานไม่ได้", "sales": None}},
"frustration": {"type": "score", "instructions": "ลูกค้าหงุดหงิดแค่ไหน",
"criteria": ["ใจเย็น", "หงุดหงิดแต่สุภาพ", "โกรธมาก"]},
"refund": {"type": "noul", "instructions": "ลูกค้าขอเงินคืนอย่างชัดเจนหรือไม่"},
},
},
timeout=30,
)
answers = resp.json()["answers"]
print(answers["department"]["choice"], answers["frustration"]["score"], answers["refund"]["noul"])
# 将低置信度的结果交给更大的模型或人工
if answers["department"]["confidence"] < 0.6:
print("escalate")
const res = await fetch("https://api.iapp.co.th/v3/store/openthai/systemone", {
method: "POST",
headers: { apikey: "YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
state: { ticket: "โดนหักเงินซ้ำสองครั้งเมื่อวานนี้ ขอเงินคืนด่วนนะครับ โทรไปสามรอบแล้วไม่มีใครรับ" },
questions: {
department: { type: "choice", instructions: "ทีมใดควรรับผิดชอบ",
criteria: { billing: "การเงิน/คืนเงิน", technical: "ระบบใช้งานไม่ได้", sales: null } },
frustration: { type: "score", instructions: "ลูกค้าหงุดหงิดแค่ไหน",
criteria: ["ใจเย็น", "หงุดหงิดแต่สุภาพ", "โกรธมาก"] },
refund: { type: "noul", instructions: "ลูกค้าขอเงินคืนอย่างชัดเจนหรือไม่" },
},
}),
});
const { answers, usage } = await res.json();
console.log(answers.department.choice, answers.frustration.score, answers.refund.noul, usage);
响应
上述请求的实测输出(166 个输入 token,0 个输出 token,一次前向计算):
{
"model": "openthai-systemone",
"answers": {
"department": {"type": "choice", "choice": "billing",
"probabilities": {"billing": 0.963, "technical": 0.011, "sales": 0.026},
"confidence": 0.83, "abstain": 0.085},
"frustration": {"type": "score", "score": 1.95,
"legend": {"0": "ใจเย็น", "1": "หงุดหงิดแต่สุภาพ", "2": "โกรธมาก"},
"probabilities": {"0": 0.012, "1": 0.031, "2": 0.957}, "confidence": 0.82},
"refund": {"type": "noul", "noul": 0.946}
},
"usage": {"input_tokens": 166, "output_tokens": 0}
}
解读答案
choice:choice是最佳选项,probabilities在你提供的选项上求和为 1,confidence为 1 减去归一化熵,abstain是没有任何选项合适的概率(iApp 扩展)。score:score是概率加权的等级索引(可为小数),probabilities按等级给出,legend将索引映射到标签。noul:noul是 P(是)。- 将
confidence低的答案交给更大的模型或人工处理。模型不会输出你未提供的选项,但仍可能出错。
应用场景
工单分流、评论审核、检查 LLM 答案是否有依据、为智能体选择要操作的界面元素、文档与字段分类、评论打分。每一种都是一次请求同时回答所有问题,在服务器 GPU 上只需几十毫秒。
性能
| 设置 | 实测 |
|---|---|
| 网关往返,3 个问题的泰语工单(本页示例,2026 年 9 月 20 日) | 0.23 秒 |
| 服务器 GPU(H100),batch 1,3 个问题 | 40 至 70 毫秒 |
| 笔记本 GPU(MacBook M3 Max,MPS) | 154 毫秒 |
| 输出 token | 每次请求均为 0 |
基准测试
在 Bespoke Labs 公开的 13 子集 System One 基准上零样本评测,使用相同的子集、划分、指令和采样器。Nimble-9B 与 Jev 的数字为 Bespoke Labs 于 2026 年 9 月 18 日公布;我们的数字由随模型发布的评测脚本测得。choice 与 noul 报告准确率,score 报告等级完全匹配率。加粗表示 0.8B 模型领先 9B 模型的子集。
| Subset | Type | n | OpenThai-SystemOne 0.8B | Nimble-9B | Jev 1.13.0 |
|---|---|---|---|---|---|
| aegis2 | noul | 250 | 58.0 | 81.2 | 80.4 |
| boolq | noul | 300 | 63.7 | 86.0 | 89.7 |
| civil_comments | noul | 300 | 78.0 | 70.3 | 81.0 |
| helpsteer2 | score | 250 | 42.8 | 39.0 | 34.1 |
| massive-de-DE | choice | 350 | 64.6 | 83.4 | 86.9 |
| massive-en-US | choice | 350 | 75.7 | 86.9 | 87.4 |
| multinli | choice | 299 | 85.6 | 85.3 | 82.9 |
| paws | noul | 250 | 67.2 | 82.8 | 89.2 |
| pubmedqa | choice | 250 | 53.6 | 75.6 | 77.2 |
| squad2 | noul | 299 | 50.2 | 80.6 | 82.9 |
| summeval-consistency | score | 144 | 84.0 | 75.7 | 81.2 |
| summeval-relevance | score | 240 | 13.8 | 49.2 | 35.0 |
| vitaminc-dev | choice | 599 | 67.1 | 76.6 | 80.1 |
| Macro average | 61.9 | 74.8 | 76.0 |
原始 Qwen3.5-0.8B 以字母对数概率提示在同一基准上得 45.4。如实解读:0.8B 模型在 13 个子集中的 4 个领先 9B(NLI、摘要一致性、有用性评分、毒性),在阅读理解式是/否任务(squad2 接近随机、boolq、pubmedqa)和摘要相关性评分上明显落后,后者的评分头校准较差(ECE 0.79)。
泰语留出测试集,从未用于训练。ECE 为期望校准误差,越低越好:
| Set | Type | n | Accuracy | ECE |
|---|---|---|---|---|
| MASSIVE-th intent (60-way) | choice | 5,007 | 86.4 | 0.048 |
| Prachathai67k topics | choice | 3,501 | 97.7 | 0.005 |
| XNLI-th | choice | 2,490 | 76.5 | 0.028 |
| SIB-200 Thai topic (7-way), whole dataset held out | choice | 204 | 77.5 | 0.074 |
| Wongnai review stars (1 to 5) | score | 6,203 | 63.3 | 0.010 |
| xLAM tool selection (English) | choice | 884 | 99.4 | 0.007 |
| Wisesight sentiment (4-class), whole dataset held out | choice | 2,671 | 38.7 | 0.341 |
| banking77 intent (77-way, English), whole dataset held out | choice | 3,076 | 32.7 | 0.165 |
在泰语测试集以及 NLI 和主题任务上,置信度可靠(校准后 ECE 不超过 0.05)。在英语公开基准上 ECE 中位数为 0.15,因此请将低置信度的英语是/否决策交给更大的模型。完整表格、Brier 分数和校准前后对比见模型卡。
限制
- 0.1 版。0.8B 模型,不是推理模型。
- 只回答你提供的选项,且仍可能出错。用
confidence分流不确定的情况。 - v0.1 已知弱项(见上表):泰语社交媒体情感(Wisesight 38.7)、细粒度 77 类英语意图(banking77 32.7)、抽取式问答风格的是/否(squad2 接近随机)以及摘要相关性评分。v0.2 以第一项为目标。
- 仅支持文本,不支持图片。
- 每个
choice最多 255 个选项,每个score2 到 10 个等级,每次请求 64K token。
本地运行
权重开放。三行命令即可在自己的机器上得到同样的答案:
pip install "git+https://github.com/iapp-technology/openthai-systemone"
OPENTHAI_SYSTEMONE_MODEL=iapp/OpenThai-SystemOne uvicorn openthai_systemone.server:app --port 8000
curl -s http://localhost:8000/v1/systemone -H "Content-Type: application/json" -d '{"state": "...", "questions": {...}}'
技术参考
请求
POST https://api.iapp.co.th/v3/store/openthai/systemone,请求头 apikey,请求体 application/json:
| 字段 | 类型 | 说明 |
|---|---|---|
state | 字符串或 JSON | 决策的对象。接受任意 JSON 并序列化给模型。 |
questions | object | 问题名到问题的映射。所有问题在同一次前向计算中回答。 |
questions.<name>.type | choice、score 或 noul | 问题类型。 |
questions.<name>.instructions | 字符串 | 要决策的内容,泰语或英语。 |
questions.<name>.criteria | object 或数组 | choice:选项名到可选描述的对象(无描述用 null),最多 255 个。score:2 到 10 个按顺序排列的等级标签数组。noul 不使用。 |
响应
| 字段 | 说明 |
|---|---|
model | 模型标识。 |
answers.<name> | 每个问题一个对象,type 与请求一致。 见解读答案。 |
usage.input_tokens | 消耗的输入 token。 |
usage.output_tokens | 始终为 0。 |
错误
| 状态码 | 含义 |
|---|---|
| 401 | 缺少或无效的 apikey。 |
| 422 | 请求格式错误,例如 score 少于 2 个等级或 choice 超过 255 个选项。 |
| 429 | 速率限制:免费预览期间每个 key 每分钟 100 次请求或每天 1,000 次决策。 |
架构
模型是 Qwen3.5-0.8B 的文本塔,在约 50 亿泰语 token 上继续预训练,并将语言模型头替换为 256 路槽位头。选项由控制 token 引入;每个答案位置投影为 256 个 logit,超出选项数的槽位被屏蔽,softmax 给出分布。第 255 号槽位表示"均不适用"。训练时打乱选项顺序,因此没有位置偏差。
更新日志
| 日期 | 版本 | 变更 |
|---|---|---|
| 2026 年 9 月 20 日 | v0.1-20260920 | 公开发布。托管 API 上线 api.iapp.co.th,免费预览每个 key 每天限 1,000 次决策。开放权重和训练方案以 Apache 2.0 发布。 |