Skip to main content

⚖️ Introducing OpenThai 2.0 Legal

Announced 24 July 2026

OpenThai 2.0 Legal — open-weight Thai legal LLM

The Thai legal AI that knows the law by heart — built by Thais, for Thailand.

The OpenThai project is releasing OpenThai 2.0 Legal, an open-weight large language model purpose-built for Thai law, with its full weights freely available on Hugging Face.

It is designed for lawyers, in-house counsel, compliance teams, legal-tech builders and public agencies that need reliable, source-grounded answers on Thai statutes and case law.

Try it live

Talk to the real model in your browser — nothing to install.

Live demo + full documentationiapp.co.th/openmodels/openthai2p0-legal

That page hosts an interactive demo covering all three modes (closed-book / citation-RAG / legal essay), plus a hosted API that is free until 24 August 2026 (a free iApp API key is required).

Download the model

OpenThai 2.0 Legal 30B-A3B — Hugging Facehuggingface.co

iapp/openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b

🌟 Highlights

  • Open weights, self-hostable — a 30B Mixture-of-Experts model activating only ~3B parameters per token, so it runs on a single GPU from 24 GB of VRAM in NVFP4 (4-bit).
  • Cites the law, not vibes — returns the exact law name and section (มาตรา) in a fixed JSON contract, ready for RAG pipelines and drafting tools.
  • Knows the statute book from memory — asked with no statute in the prompt, it recalls the right section: roughly 4× the closed-book recall of the much larger Qwen3.6-35B on the Civil and Commercial Code.
  • Writes like a lawyer — ahead of Qwen3.6-35B on all four legal-essay axes.
  • Grounded in real Thai legal sources — trained on published Thai statutes and Supreme Court rulings.

📊 Benchmark results

Benchmark scoreboard versus Qwen3.6-35B and the Nemotron base

EvaluationOpenThai 2.0 LegalQwen3.6-35BNemotron-3-30B base
Closed-book: knows the law from memory
Civil & Commercial Code (n=3,729)0.070.020.001
Tax — Revenue Code (n=50)0.400.360.31
Open-book: uses provided law (RAG)
Civil & Commercial, cite from context (n=3,729)0.990.990.98
Tax echo (n=50)0.840.840.64
Tax selection among distractors (n=50)0.690.640.45
Legal essays (Thai Supreme Court cases)
Correct citations (n=72)0.250.090.02
Reaches the right holding (n=72)0.570.500.31
Covers the key points (n=72)0.600.550.27
Writing quality (n=72)0.460.430.13

Scores run 0 to 1, higher is better. Citation rows use NitiBench's citation-F1 scorer; holding, coverage and fluency are judged by Gemini 3.1 Flash Lite. Every model was re-run end to end under one identical protocol — single pass, thinking off, citations checked by code.

ℹ️ Scope of the claim

This is the strongest closed-book Thai-law recall measured in a self-hostable model. A closed cloud API still scores higher.

🧾 Model details

Model nameopenthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b
Base modelNVIDIA Nemotron-3-Nano-Omni-30B-A3B-Reasoning (text core extracted; Mamba2-Transformer hybrid MoE)
Parameters30B total, ~3B active per token
Context length32,768 tested (architecture supports up to 256k)
LanguagesThai (primary), English (reasoning)
Precisionbfloat16 safetensors, 17 shards · NVFP4 for single-GPU 24 GB serving
Training stackNVIDIA NeMo (Megatron-Bridge for CPT/SFT, NeMo-RL for GRPO)
ServingvLLM (verified) and NVIDIA NIM (OpenAI-compatible)
LicenseNVIDIA Open Model Agreement

🔬 How it was trained

Training pipeline: Base 30B → CPT → SFT → GRPO → Released

Three stages on the NVIDIA NeMo stack:

  1. CPT (continued pretraining) — drills the full text of every section in both directions so the law lives in the weights. 360,985 drills, ~800M Thai-law tokens.
  2. SFT (supervised fine-tuning) — teaches grounded answering under a fixed JSON contract. 16,436 exam answers and เนติบัณฑิต essays.
  3. GRPO (reinforcement learning) — reward is the benchmark's own citation F1, penalizing wrong or missing citations. 8,568 graded questions, ~68,500 drafts.

🚀 Getting started

Serve with vLLM on 2 GPUs:

vllm serve iapp/openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b \
--tensor-parallel-size 2 --trust-remote-code \
--max-model-len 32768 --enforce-eager

Or call the hosted API (free until 24 Aug 2026 with a free iApp API key):

from openai import OpenAI
client = OpenAI(base_url="https://api.iapp.co.th/v3/llm/openthai2p0-legal",
api_key="YOUR_IAPP_API_KEY")

r = client.chat.completions.create(
model="openthai2.0-legal",
messages=[{"role": "user", "content": "ลักทรัพย์ในเวลากลางคืน ผิดมาตราใด"}],
max_tokens=1024,
)
print(r.choices[0].message.content)

The model is at its best when the law is in the prompt: open-book citation accuracy is 0.99 versus 0.07–0.40 from pure memory. Always pair it with retrieval for real work.

OpenThaiRAG — Thai-native RAG frameworkopenthai.aieat.or.th/openthairag

Tutorial: Open WebUI & OpenThaiRAGiapp.co.th

Recommended Thai legal datasets for your retrieval corpus: WangchanX-Legal-ThaiCCL-RAG, NitiBench, and authoritative statute text from the Office of the Council of State.

⚠️ Limitations and responsible use

  • Retrieval quality drives results — if the retriever supplies the wrong sections, the answer follows them.
  • Near-miss rejection is the hardest task — telling a governing section from a closely related one is the lowest-scoring axis for every model, ours included.
  • Scope — trained on Thai statutory law and Revenue Department rulings; niche areas and very recent amendments may be thinner.
  • Human oversight required — outputs are decision support, not legal advice. Verify every citation against the current law.

🙏 Credits

Built by the OpenThai team (AIEAT / iApp Technology) on the NVIDIA Nemotron and NeMo stack, together with the ThaiLLM initiative and NVIDIA.

Evaluation uses NitiBench (VISAI-AI, MIT); SFT data built from WangchanX-Legal-ThaiCCL (VISTEC, MIT).