iapp-technology/openthai-systemone

OpenThai-SystemOne: open Thai + English System One decision model (0.8B, 256-way slot head, Apache-2.0)

Python

68

21 commits

updated Sep 21, 2026

See the code

README

OpenThai-SystemOne

OpenThai-SystemOne launch: Jev ภาษาไทยมาแล้ว — open Thai + English System One decision model

Open-source Thai + English System One decision model: a Qwen3.5-0.8B text tower whose LM head is replaced by a 256-way slot softmax, continued-pretrained on Thai, and trained to answer typed questions (choice / score / noul) about an arbitrary state in a single forward pass with calibrated probabilities. The request/response contract mirrors TypeSafe AI's POST /v1/systemone (Jev), so SDK code written for TypeSafe can point at this model.

Quickstart

pip install "git+https://github.com/iapp-technology/openthai-systemone"      # or: pip install openthai-systemone
from openthai_systemone import SystemOneClient, Choice, Score, Noul

client = SystemOneClient("iapp/OpenThai-SystemOne")          # CUDA, MPS or CPU
resp = client.system_one(
    state={"ticket": "โดนหักเงินซ้ำสองครั้ง ขอเงินคืนด่วน โทรไปสามรอบแล้วไม่มีใครรับ"},
    questions={
        "department": Choice(instructions="ทีมใดควรรับผิดชอบ", criteria={"billing": "การเงิน/คืนเงิน", "technical": "ระบบใช้งานไม่ได้", "sales": None}),
        "frustration": Score(instructions="ลูกค้าหงุดหงิดแค่ไหน", criteria=["ใจเย็น", "หงุดหงิดแต่สุภาพ", "โกรธมาก"]),
        "refund": Noul(instructions="ลูกค้าขอเงินคืนอย่างชัดเจนหรือไม่"),
    },
)
print(resp.answers["department"].choice, resp.answers["department"].probabilities)
print(resp.answers["frustration"].score, resp.answers["refund"].noul)

HTTP server with the same JSON contract as TypeSafe's POST /v1/systemone:

OPENTHAI_SYSTEMONE_MODEL=iapp/OpenThai-SystemOne uvicorn openthai_systemone.server:app --port 8000

Model card with benchmark tables: https://huggingface.co/iapp/OpenThai-SystemOne.

Layout

openthai_systemone/     pip package: types (Choice/Score/Noul), formatting (prompt + slots), modeling (SlotHead), client, server
scripts/00..07_*.py    one script per pipeline stage (see below)
configs/*.yaml         CPT / SFT / calibration hyper-parameters (1x H100)
tests/                 CPU unit tests

Pipeline

stagescriptwhereoutput
0 surgeryscripts/00_prepare_base.pyCPUbase/qwen3.5-0.8b-text (vision encoder dropped)
1 CPT datascripts/01_cpt_data.pyCPU, needs internetdata/cpt/shard-*.bin (5B Thai-heavy tokens)
1 CPTscripts/02_cpt_train.py --config configs/cpt.yaml1x H100, ~1 dayruns/cpt/latest
2 decision datascripts/03_decision_data.py, scripts/03b_synth_generate.pyCPU + LLM endpointdata/decision/*.jsonl, data/synth/*.jsonl
2 SFTscripts/04_decision_train.py --config configs/sft.yaml1x H100, ~0.5 dayruns/sft/latest
3 calibrationscripts/04_decision_train.py --config configs/calib.yaml --init runs/sft/latest1x H100, hoursruns/calib/latest
4 evalscripts/06_eval.py --model runs/calib/latestGPUruns/eval.json
5 releasescripts/07_export_release.py --ckpt runs/calib/latest --out release/... --push iapp/OpenThai-SystemOne–HF Hub

Dev

uv venv -p 3.12 .venv && source .venv/bin/activate
uv pip install -e ".[server,train,dev]"
pytest -q

Synthetic data needs an OpenAI-compatible endpoint:

export SYNTH_BASE_URL=http://localhost:8000/v1 SYNTH_MODEL=<any-openai-compatible-chat-model> SYNTH_API_KEY=<key-or-none>
python scripts/03b_synth_generate.py --out data/synth --n 600000 --concurrency 32

Siam AI Corporation

Training, evaluation and the free hosted API for this model run on NVIDIA H100 GPUs generously provided by Siam AI Corporation. Thank you for backing open Thai AI.

iapp-technology/openthai-systemone

OpenThai-SystemOne: open Thai + English System One decision model (0.8B, 256-way slot head, Apache-2.0)

Python

68

21 commits

updated Sep 21, 2026

See the code

README

OpenThai-SystemOne

OpenThai-SystemOne launch: Jev ภาษาไทยมาแล้ว — open Thai + English System One decision model

Open-source Thai + English System One decision model: a Qwen3.5-0.8B text tower whose LM head is replaced by a 256-way slot softmax, continued-pretrained on Thai, and trained to answer typed questions (choice / score / noul) about an arbitrary state in a single forward pass with calibrated probabilities. The request/response contract mirrors TypeSafe AI's POST /v1/systemone (Jev), so SDK code written for TypeSafe can point at this model.

Quickstart

pip install "git+https://github.com/iapp-technology/openthai-systemone"      # or: pip install openthai-systemone
from openthai_systemone import SystemOneClient, Choice, Score, Noul

client = SystemOneClient("iapp/OpenThai-SystemOne")          # CUDA, MPS or CPU
resp = client.system_one(
    state={"ticket": "โดนหักเงินซ้ำสองครั้ง ขอเงินคืนด่วน โทรไปสามรอบแล้วไม่มีใครรับ"},
    questions={
        "department": Choice(instructions="ทีมใดควรรับผิดชอบ", criteria={"billing": "การเงิน/คืนเงิน", "technical": "ระบบใช้งานไม่ได้", "sales": None}),
        "frustration": Score(instructions="ลูกค้าหงุดหงิดแค่ไหน", criteria=["ใจเย็น", "หงุดหงิดแต่สุภาพ", "โกรธมาก"]),
        "refund": Noul(instructions="ลูกค้าขอเงินคืนอย่างชัดเจนหรือไม่"),
    },
)
print(resp.answers["department"].choice, resp.answers["department"].probabilities)
print(resp.answers["frustration"].score, resp.answers["refund"].noul)

HTTP server with the same JSON contract as TypeSafe's POST /v1/systemone:

OPENTHAI_SYSTEMONE_MODEL=iapp/OpenThai-SystemOne uvicorn openthai_systemone.server:app --port 8000

Model card with benchmark tables: https://huggingface.co/iapp/OpenThai-SystemOne.

Layout

openthai_systemone/     pip package: types (Choice/Score/Noul), formatting (prompt + slots), modeling (SlotHead), client, server
scripts/00..07_*.py    one script per pipeline stage (see below)
configs/*.yaml         CPT / SFT / calibration hyper-parameters (1x H100)
tests/                 CPU unit tests

Pipeline

stagescriptwhereoutput
0 surgeryscripts/00_prepare_base.pyCPUbase/qwen3.5-0.8b-text (vision encoder dropped)
1 CPT datascripts/01_cpt_data.pyCPU, needs internetdata/cpt/shard-*.bin (5B Thai-heavy tokens)
1 CPTscripts/02_cpt_train.py --config configs/cpt.yaml1x H100, ~1 dayruns/cpt/latest
2 decision datascripts/03_decision_data.py, scripts/03b_synth_generate.pyCPU + LLM endpointdata/decision/*.jsonl, data/synth/*.jsonl
2 SFTscripts/04_decision_train.py --config configs/sft.yaml1x H100, ~0.5 dayruns/sft/latest
3 calibrationscripts/04_decision_train.py --config configs/calib.yaml --init runs/sft/latest1x H100, hoursruns/calib/latest
4 evalscripts/06_eval.py --model runs/calib/latestGPUruns/eval.json
5 releasescripts/07_export_release.py --ckpt runs/calib/latest --out release/... --push iapp/OpenThai-SystemOne–HF Hub

Dev

uv venv -p 3.12 .venv && source .venv/bin/activate
uv pip install -e ".[server,train,dev]"
pytest -q

Synthetic data needs an OpenAI-compatible endpoint:

export SYNTH_BASE_URL=http://localhost:8000/v1 SYNTH_MODEL=<any-openai-compatible-chat-model> SYNTH_API_KEY=<key-or-none>
python scripts/03b_synth_generate.py --out data/synth --n 600000 --concurrency 32

Siam AI Corporation

Training, evaluation and the free hosted API for this model run on NVIDIA H100 GPUs generously provided by Siam AI Corporation. Thank you for backing open Thai AI.

Project health

Latest release

0.1.0 · Sep 20, 2026

Releases this year

1