âī¸ Introducing OpenThai 2.0 Legal
Announced 24 July 2026

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â

| Evaluation | OpenThai 2.0 Legal | Qwen3.6-35B | Nemotron-3-30B base |
|---|---|---|---|
| Closed-book: knows the law from memory | |||
| Civil & Commercial Code (n=3,729) | 0.07 | 0.02 | 0.001 |
| Tax â Revenue Code (n=50) | 0.40 | 0.36 | 0.31 |
| Open-book: uses provided law (RAG) | |||
| Civil & Commercial, cite from context (n=3,729) | 0.99 | 0.99 | 0.98 |
| Tax echo (n=50) | 0.84 | 0.84 | 0.64 |
| Tax selection among distractors (n=50) | 0.69 | 0.64 | 0.45 |
| Legal essays (Thai Supreme Court cases) | |||
| Correct citations (n=72) | 0.25 | 0.09 | 0.02 |
| Reaches the right holding (n=72) | 0.57 | 0.50 | 0.31 |
| Covers the key points (n=72) | 0.60 | 0.55 | 0.27 |
| Writing quality (n=72) | 0.46 | 0.43 | 0.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 name | openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b |
| Base model | NVIDIA Nemotron-3-Nano-Omni-30B-A3B-Reasoning (text core extracted; Mamba2-Transformer hybrid MoE) |
| Parameters | 30B total, ~3B active per token |
| Context length | 256k (262,144 tokens), prompt plus completion |
| Languages | Thai (primary), English (reasoning) |
| Precision | bfloat16 safetensors, 17 shards ¡ NVFP4 for single-GPU 24 GB serving |
| Training stack | NVIDIA NeMo (Megatron-Bridge for CPT/SFT, NeMo-RL for GRPO) |
| Serving | vLLM (verified) and NVIDIA NIM (OpenAI-compatible) |
| License | NVIDIA Open Model Agreement |
đŦ How it was trainedâ

Three stages on the NVIDIA NeMo stack:
- 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.
- SFT (supervised fine-tuning) â teaches grounded answering under a fixed JSON contract. 16,436 exam answers and āšā¸ā¸ā¸´ā¸ā¸ąā¸ā¸ā¸´ā¸ essays.
- 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
For the full 256k window, set --max-model-len 262144. No extra flag is needed â 262,144 is the model's own max_position_embeddings â but budget more VRAM for KV cache (~1.5 GiB per full-length sequence).
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)
đ Use it with RAG (strongly recommended)â
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.ai/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).