PageSourceSearch

https://iapp.co.th/assets/js/6810293c.41328d14.js

js iapp.co.th collected 2026-10-02 05:26:35 UTC 89,967 bytes, 4 lines download raw bytes

1"use strict";(self.webpackChunkiapp_homepage_2025=self.webpackChunkiapp_homepage_2025||[]).push([["25088"],{34353:function(e,n,t){t.r(n),t.d(n,{metadata:()=>s,default:()=>p,frontMatter:()=>l,contentTitle:()=>o,toc:()=>c,assets:()=>d});var s=JSON.parse('{"type":"mdx","permalink":"/openmodels/openthai2p0-legal","source":"@site/src/pages/openmodels/openthai2p0-legal.md","title":"OpenThai 2.0 Legal \u2014 Open-Weight Thai Legal LLM (Nemotron-3-Nano-30B-A3B)","description":"OpenThai 2.0 Legal is a free, open-weight Thai legal LLM built on NVIDIA Nemotron-3-Nano-30B-A3B. It recalls Thai statutes from memory, cites the exact law and \u0E21\u0E32\u0E15\u0E23\u0E32 as machine-readable JSON, and self-hosts on a single 24 GB GPU. Download the weights on Hugging Face.","frontMatter":{"title":"OpenThai 2.0 Legal \u2014 Open-Weight Thai Legal LLM (Nemotron-3-Nano-30B-A3B)","description":"OpenThai 2.0 Legal is a free, open-weight Thai legal LLM built on NVIDIA Nemotron-3-Nano-30B-A3B. It recalls Thai statutes from memory, cites the exact law and \u0E21\u0E32\u0E15\u0E23\u0E32 as machine-readable JSON, and self-hosts on a single 24 GB GPU. Download the weights on Hugging Face.","keywords":["OpenThai 2.0 Legal","Thai legal LLM","open weight Thai model","Nemotron 30B A3B","Thai law AI","legal AI Thailand","NitiBench","RAG Thai law","self-hosted LLM","\u0E42\u0E21\u0E40\u0E14\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E44\u0E17\u0E22","AI \u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E44\u0E17\u0E22","OpenThaiGPT Legal"]},"unlisted":false}'),i=t(74848),r=t(84429),a=t(91035);let l={title:"OpenThai 2.0 Legal \u2014 Open-Weight Thai Legal LLM (Nemotron-3-Nano-30B-A3B)",description:"OpenThai 2.0 Legal is a free, open-weight Thai legal LLM built on NVIDIA Nemotron-3-Nano-30B-A3B. It recalls Thai statutes from memory, cites the exact law and \u0E21\u0E32\u0E15\u0E23\u0E32 as machine-readable JSON, and self-hosts on a single 24 GB GPU. Download the weights on Hugging Face.",keywords:["OpenThai 2.0 Legal","Thai legal LLM","open weight Thai model","Nemotron 30B A3B","Thai law AI","legal AI Thailand","NitiBench","RAG Thai law","self-hosted LLM","\u0E42\u0E21\u0E40\u0E14\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E44\u0E17\u0E22","AI \u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E44\u0E17\u0E22","OpenThaiGPT Legal"]},o="OpenThai 2.0 Legal",d={},c=[{value:"Try it live",id:"try-it-live",level:2},{value:"Free hosted API \u2014 free until 30 September 2026 (free iApp API key required)",id:"free-hosted-api--free-until-30-september-2026-free-iapp-api-key-required",level:2},{value:"Self-host it with RAG",id:"self-host-it-with-rag",level:2},{value:"Highlights",id:"highlights",level:2},{value:"<strong>1. Open weights, self-hostable</strong>",id:"1-open-weights-self-hostable",level:3},{value:"<strong>2. Cites the law, not vibes</strong>",id:"2-cites-the-law-not-vibes",level:3},{value:"<strong>3. Knows the statute book from memory</strong>",id:"3-knows-the-statute-book-from-memory",level:3},{value:"<strong>4. Writes like a lawyer</strong>",id:"4-writes-like-a-lawyer",level:3},{value:"<strong>5. Grounded in real Thai legal sources</strong>",id:"5-grounded-in-real-thai-legal-sources",level:3},{value:"Benchmark results",id:"benchmark-results",level:2},{value:"How it was trained",id:"how-it-was-trained",level:2},{value:"Model details",id:"model-details",level:2},{value:"How it is evaluated",id:"how-it-is-evaluated",level:2},{value:"What the model actually produces",id:"what-the-model-actually-produces",level:3},{value:"Deployment",id:"deployment",level:2},{value:"vLLM (2 GPUs, tensor parallel)",id:"vllm-2-gpus-tensor-parallel",level:3},{value:"NVIDIA NIM",id:"nvidia-nim",level:3},{value:"Quickstart",id:"quickstart",level:2},{value:"Grounded citation answering (RAG mode)",id:"grounded-citation-answering-rag-mode",level:3},{value:"Closed-book mode",id:"closed-book-mode",level:3},{value:"Essay mode",id:"essay-mode",level:3},{value:"Recommended generation settings",id:"recommended-generation-settings",level:2},{value:"Suitable for",id:"suitable-for",level:2},{value:"Limitations and responsible use",id:"limitations-and-responsible-use",level:2},{value:"Sources and acknowledgements",id:"sources-and-acknowledgements",level:2},{value:"Get in touch",id:"get-in-touch",level:2}];function h(e){let n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"openthai-20-legal",children:"OpenThai 2.0 Legal"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"OpenThai 2.0 Legal \u2014 open-weight Thai legal LLM built on NVIDIA Nemotron 30B-A3B",src:t(78899).A+"",width:"1920",height:"1080"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"The Thai legal AI that knows the law by heart \u2014 built by Thais, for Thailand."})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b"})}),"\n",(0,i.jsx)(n.p,{children:"An open-weight model exploring how far Thai legal knowledge and verifiable, section-level citation can be pushed on a self-hostable 30B base \u2014 with or without retrieval."}),"\n",(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.6rem",margin:"1.5rem 0"},children:[(0,i.jsx)("a",{className:"button button--primary button--lg",href:"https://huggingface.co/iapp/openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b",target:"_blank",rel:"noopener",children:"Download the weights"}),(0,i.jsx)("a",{className:"button button--secondary button--lg",href:"/blog/openthai2p0-legal-launch",children:"Read the launch story"})]}),"\n",(0,i.jsx)(n.admonition,{title:"Open weights, released 24 July 2026",type:"info",children:(0,i.jsx)(n.p,{children:"Built by the OpenThai team (AIEAT / iApp Technology) on the NVIDIA NeMo stack, in collaboration with the Big Data Institute (BDI), the ThaiLLM initiative and NVIDIA."})}),"\n",(0,i.jsx)(n.h2,{id:"try-it-live",children:"Try it live"}),"\n",(0,i.jsx)(n.admonition,{title:"RAG built in \u2014 answers grounded in real statute text",type:"tip",children:(0,i.jsxs)(n.p,{children:["The hosted API retrieves from a ",(0,i.jsx)(n.strong,{children:"39-law, 6,300-section Thai statute corpus"})," (hybrid BM25 + Qwen3 embedding search + reranker) and grounds each answer in the current law text. The demo shows the sections the system selected under every answer, so you can see the retrieval step working. Send ",(0,i.jsx)(n.code,{children:'"rag": false'})," to call the bare model instead (the Closed-book tab does exactly that)."]})}),"\n",(0,i.jsx)(a.A,{locale:"en"}),"\n",(0,i.jsx)(n.h2,{id:"free-hosted-api--free-until-30-september-2026-free-iapp-api-key-required",children:"Free hosted API \u2014 free until 30 September 2026 (free iApp API key required)"}),"\n",(0,i.jsxs)(n.p,{children:["Don't want to run GPUs? We host the model for you. The endpoint is ",(0,i.jsx)(n.strong,{children:"OpenAI-compatible"})," and ",(0,i.jsx)(n.strong,{children:"free until 30 September 2026"})," (extended from the original 24 August) \u2014 you just need a free iApp API key: ",(0,i.jsx)(n.a,{href:"https://iapp.co.th/register",children:"register"})," \u2192 ",(0,i.jsx)(n.strong,{children:"API Keys"})," \u2192 ",(0,i.jsx)(n.strong,{children:"Create New API Key"}),". Rate-limited to 30 requests/minute. After the promo it stays available at standard Thanoy-rate pricing: ",(0,i.jsx)(n.strong,{children:"0.01 / 0.02 IC per 1K input/output tokens"}),"."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Base URL"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"https://api.iapp.co.th/v3/llm/openthai2p0-legal"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Endpoint"}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"POST /chat/completions"})," (OpenAI-compatible)"]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Model"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"openthai2.0-legal"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Auth"}),(0,i.jsxs)(n.td,{children:["iApp API key (",(0,i.jsx)(n.code,{children:"apikey"})," header or ",(0,i.jsx)(n.code,{children:"Authorization: Bearer"}),") \xb7 ",(0,i.jsx)(n.strong,{children:"free registration, free usage to 30 Sep 2026"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"RAG"}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"on by default"})," \u2014 server-side hybrid retrieval over the Thai statute corpus; ",(0,i.jsx)(n.code,{children:'"rag": false'})," for the bare model, ",(0,i.jsx)(n.code,{children:'"rag_top_k"'})," (1\u201320, default 8) to tune depth, ",(0,i.jsx)(n.code,{children:'"rag_inject": "system"'})," for essay/long-form prompts (default ",(0,i.jsx)(n.code,{children:'"user"'})," fits the JSON citation contract)"]})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["Every RAG response includes a ",(0,i.jsx)(n.code,{children:"retrieved_documents"})," array \u2014 the exact sections (law name, \u0E21\u0E32\u0E15\u0E23\u0E32, current text, reranker score) the answer was grounded in, so you can display or audit the retrieval step in your own product:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'from openai import OpenAI\nclient = OpenAI(base_url="https://api.iapp.co.th/v3/llm/openthai2p0-legal", api_key="YOUR_IAPP_API_KEY")\n\nr = client.chat.completions.
1create(\n    model="openthai2.0-legal",\n    messages=[{"role": "user", "content": "\u0E25\u0E31\u0E01\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E43\u0E19\u0E40\u0E27\u0E25\u0E32\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19 \u0E1C\u0E34\u0E14\u0E21\u0E32\u0E15\u0E23\u0E32\u0E43\u0E14"}],\n    max_tokens=1024,\n    # extra_body={"rag": False}  # uncomment to call the bare model (closed-book)\n)\nprint(r.choices[0].message.content)\nprint(r.model_extra.get("retrieved_documents"))  # the law sections the answer used\n'})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:'curl -s https://api.iapp.co.th/v3/llm/openthai2p0-legal/chat/completions \\\n  -H "Content-Type: application/json" -H "apikey: YOUR_IAPP_API_KEY" \\\n  -d \'{"model":"openthai2.0-legal","messages":[{"role":"user","content":"\u0E25\u0E31\u0E01\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E43\u0E19\u0E40\u0E27\u0E25\u0E32\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19 \u0E1C\u0E34\u0E14\u0E21\u0E32\u0E15\u0E23\u0E32\u0E43\u0E14"}],"max_tokens":1024}\'\n'})}),"\n",(0,i.jsx)(n.h2,{id:"self-host-it-with-rag",children:"Self-host it with RAG"}),"\n",(0,i.jsxs)(n.p,{children:["This model is at its best when the law is ",(0,i.jsx)(n.strong,{children:"in the prompt"}),": open-book citation accuracy is 0.99 versus 0.07\u20130.40 from pure memory. That's why our hosted API ships with retrieval already built in. If you self-host the open weights, pair them with your own retrieval the same way:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"/openmodels/openthai2p0-legal-rag-tutorial",children:"Full tutorial: Open WebUI & OpenThaiRAG \u2192"})})," \u2014 connect the most popular self-hosted chat UI, or the Thai-native ",(0,i.jsx)(n.a,{href:"https://github.com/OpenThaiGPT/openthairag",children:"OpenThaiRAG"})," framework (",(0,i.jsx)(n.a,{href:"https://openthai.aieat.or.th/openthairag",children:"project page"}),"), in under an hour."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Recommended datasets:"})," ",(0,i.jsx)(n.a,{href:"https://huggingface.co/datasets/airesearch/WangchanX-Legal-ThaiCCL-RAG",children:"WangchanX-Legal-ThaiCCL-RAG"})," for training/eval pairs, ",(0,i.jsx)(n.a,{href:"https://huggingface.co/datasets/VISAI-AI/nitibench",children:"NitiBench"})," to score your pipeline, and ",(0,i.jsx)(n.a,{href:"https://www.krisdika.go.th",children:"krisdika.go.th"})," for authoritative statute text."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Chunk by \u0E21\u0E32\u0E15\u0E23\u0E32"})," \u2014 one section per chunk with ",(0,i.jsx)(n.code,{children:"law_name"})," + ",(0,i.jsx)(n.code,{children:"section"})," metadata matches the citation contract the model was RL-trained on."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Thinking is off by default, so you get a clean, direct answer. To see step-by-step legal reasoning, add ",(0,i.jsx)(n.code,{children:'"chat_template_kwargs": {"enable_thinking": true}'})," \u2014 the reasoning appears in ",(0,i.jsx)(n.code,{children:"content"}),", wrapped in ",(0,i.jsx)(n.code,{children:"<think>...</think>"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,i.jsx)(n.h3,{id:"1-open-weights-self-hostable",children:(0,i.jsx)(n.strong,{children:"1. Open weights, self-hostable"})}),"\n",(0,i.jsxs)(n.p,{children:["30B Mixture-of-Experts with only ~3B parameters active per token. Runs on a single GPU from ",(0,i.jsx)(n.strong,{children:"24 GB VRAM"})," in NVFP4 (4-bit), so law firms and agencies can keep sensitive matters entirely on their own infrastructure."]}),"\n",(0,i.jsx)(n.h3,{id:"2-cites-the-law-not-vibes",children:(0,i.jsx)(n.strong,{children:"2. Cites the law, not vibes"})}),"\n",(0,i.jsxs)(n.p,{children:["Every answer can return the exact law name and ",(0,i.jsx)(n.strong,{children:"\u0E21\u0E32\u0E15\u0E23\u0E32"})," in a fixed JSON contract \u2014 ready to drop straight into RAG pipelines, drafting tools and legal-tech products."]}),"\n",(0,i.jsx)(n.h3,{id:"3-knows-the-statute-book-from-memory",children:(0,i.jsx)(n.strong,{children:"3. Knows the statute book from memory"})}),"\n",(0,i.jsxs)(n.p,{children:["Asked with ",(0,i.jsx)(n.strong,{children:"no statute in the prompt"}),", it recalls and cites the right section: roughly ",(0,i.jsx)(n.strong,{children:"4\xd7 the closed-book recall of the much larger Qwen3.6-35B"})," on the Civil and Commercial Code."]}),"\n",(0,i.jsx)(n.h3,{id:"4-writes-like-a-lawyer",children:(0,i.jsx)(n.strong,{children:"4. Writes like a lawyer"})}),"\n",(0,i.jsxs)(n.p,{children:["Ahead of Qwen3.6-35B on ",(0,i.jsx)(n.strong,{children:"all four"})," legal-essay axes \u2014 citations, holding, coverage and fluency \u2014 graded on held-out Thai Supreme Court cases."]}),"\n",(0,i.jsx)(n.h3,{id:"5-grounded-in-real-thai-legal-sources",children:(0,i.jsx)(n.strong,{children:"5. Grounded in real Thai legal sources"})}),"\n",(0,i.jsx)(n.p,{children:"Trained on published Thai statutes and court rulings, with every answer tied back to its source section."}),"\n",(0,i.jsx)(n.h2,{id:"benchmark-results",children:"Benchmark results"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Benchmark scoreboard: closed-book, open-book (RAG) and legal-essay axes versus Qwen3.6-35B and the Nemotron base",src:t(70921).A+"",width:"2052",height:"742"})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Evaluation"}),(0,i.jsx)(n.th,{children:"OpenThai 2.0 Legal"}),(0,i.jsx)(n.th,{children:"Qwen3.6-35B"}),(0,i.jsx)(n.th,{children:"Nemotron-3-30B base"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Closed-book: knows the law from memory"})}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Civil & Commercial"}),": recall the Civil and Commercial Code (n=3,729)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.07"})}),(0,i.jsx)(n.td,{children:"0.02"}),(0,i.jsx)(n.td,{children:"0.001"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Tax"}),": recall the Revenue Code (n=50)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.40"})}),(0,i.jsx)(n.td,{children:"0.36"}),(0,i.jsx)(n.td,{children:"0.31"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Open-book: uses provided law (the RAG setting)"})}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Civil & Commercial"}),": cite the applicable sections from context (n=3,729)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.99"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.99"})}),(0,i.jsx)(n.td,{children:"0.98"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Tax echo"}),": cite the sections provided (n=50)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.84"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.84"})}),(0,i.jsx)(n.td,{children:"0.64"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Tax selection"}),": cite only the applicable sections among distractors (n=50)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.69"})}),(0,i.jsx)(n.td,{children:"0.64"}),(0,i.jsx)(n.td,{children:"0.45"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Legal essays (Thai Supreme Court cases)"})}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Citations"}),": correct citations inside the essay (n=72)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.25"})}),(0,i.jsx)(n.td,{children:"0.09"}),(0,i.jsx)(n.td,{children:"0.02"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Holding"}),": reaches the correct legal conclusion (n=72)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.57"})}),(0,i.jsx)(n.td,{children:"0.50"}),(0,i.jsx)(n.td,{children:"0.31"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Coverage"}),": covers the key legal points (n=72)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.60"})}),(0,i.jsx)(n.td,{children:"0.55"}),(0,i.jsx)(n.td,{children:"0.27"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"Fluency"}),": writing quality (n=72)"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"0.46"})}),(0,i.jsx)(n.td,{children:"0.43"}),(0,i.jsx)(n.td,{children:"0.13"})]})]})]}),"\n",(0,i.jsx)(n.admonition,{title:"Scoring",type:"info",children:(0,i.jsxs)(n.p,{children:["Scores run 0 to 1, higher is better. Citation rows use ",(0,i.jsx)(n.a,{href:"https://huggingface.co/datasets/VISAI-AI/nitibench",children:"NitiBench"}),"'s citation-F1 scorer (single pass, temperature 0, thinking off); essay holding, coverage and fluency are judged by Gemini 3.1 Flash Lite. Every model was re-run end to end under one identical protocol."]})}),"\n",(0,i.jsxs)(n.p,{children:["This is the strongest closed-book Thai-law recall we have measured in a ",(0,i.jsx)(n.strong,{children:"self-hostable"})," model, scored by code rather than by an AI judge. A closed cloud API still scores higher \u2014 the claim is scoped to models you can run on your own hardware."]}),"\n",(0,i.jsx)(n.h2,{id:"how-it-was-trained",children:"How it was trained"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Training pipeline: Base 30B \u2192 CPT \u2192 SFT \u2192 GRPO \u2192 Released",src:t(92472).A+"",width:"1546",height:"352"})}),"\n",(0,i.jsx)(n.p,{children:"Three stages on the NVIDIA NeMo stack, each solving one problem:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"CPT (continued pretraining)"})," teaches the law itself \u2014 the model drills the full text of every section in both directions, so the knowledge lives in the weights. 360,985 law drills, ~800M Thai-law tokens."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"SFT (supervised fine-tuning)"})," teaches grounded answering \u2014 every answer follows a fixed JSON contract that cites only the sections it was given. 16,436 exam answers and essays."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"GRPO (reinforcement learning)"})," teaches precision \u2014 the reward is the benchmark's own citation F1, penalizing wrong or missing citations. 8,568 graded questions, ~68,500 drafts."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"model-details",children:"Model details"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Base model"}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.a,{href:"https://huggingface.co/nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16",children:"nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning"})," (text core extracted; Mamba2-Transformer hybrid MoE)"]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Parameters"}),(0,i.jsx)(n.td,{children:"30B total, ~3B active per token"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Context length"}),(0,i.jsx)(n.td,{children:"256k (262,144 tokens)"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Languages"}),(0,i.jsx)(n.td,{children:"Thai (primary), English (reasoning)"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Precision"}),(0,i.jsx)(n.td,{children:"bfloat16 safetensors, 17 shards \xb7 NVFP4 for 24 GB single-GPU serving"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Training stack"}),(0,i.jsx)(n.td,{children:"NVIDIA NeMo (Megatron-Bridge for CPT/SFT, NeMo-RL for GRPO)"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Serving"}),(0,i.jsx)(n.td,{children:"vLLM (verified) and NVIDIA NIM (OpenAI-compatible)"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"License"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://www.nvidia.com/en-us
1/agreements/enterprise-software/nvidia-open-model-agreement/",children:"NVIDIA Open Model Agreement"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Status"}),(0,i.jsx)(n.td,{children:"Open-weight release"})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"how-it-is-evaluated",children:"How it is evaluated"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"RAG mode"})," means you put candidate law sections in the prompt and the model cites only the ones that apply. It works with any retriever you already have and needs no particular embedding or rerank model. Because it is also strong closed-book, many questions need no retrieval at all."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Mode"}),(0,i.jsx)(n.th,{children:"What it tests"}),(0,i.jsx)(n.th,{children:"Setup"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:'Open-book "echo"'})}),(0,i.jsx)(n.td,{children:"RAG best case: uses exactly the right documents"}),(0,i.jsx)(n.td,{children:"Only the relevant sections are provided; cite them all"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:'Open-book "selection"'})}),(0,i.jsx)(n.td,{children:"RAG realistic case: rejects near-miss documents"}),(0,i.jsx)(n.td,{children:"Relevant sections mixed with inapplicable ones; cite only the right subset"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Closed-book"})}),(0,i.jsx)(n.td,{children:"Pure memory, no retrieval"}),(0,i.jsx)(n.td,{children:"The question alone; recall law name and section from weights"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Legal essays"})}),(0,i.jsx)(n.td,{children:"Long-form legal writing"}),(0,i.jsx)(n.td,{children:"72 held-out Thai Supreme Court cases reformatted as essay questions, graded on citations, holding, coverage and fluency"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"what-the-model-actually-produces",children:"What the model actually produces"}),"\n",(0,i.jsx)(n.p,{children:"All examples below are verbatim model output on held-out benchmark questions."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Open-book selection"})," \u2014 the hardest mode. Five sections supplied, three applicable."]}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Question (TH):"})," \u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E08\u0E31\u0E14\u0E15\u0E31\u0E49\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E32\u0E21\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22 ... \u0E44\u0E14\u0E49\u0E41\u0E15\u0E48\u0E07\u0E15\u0E31\u0E49\u0E07\u0E43\u0E2B\u0E49\u0E1C\u0E39\u0E49\u0E1A\u0E23\u0E34\u0E2B\u0E32\u0E23\u0E2B\u0E23\u0E37\u0E2D\u0E1E\u0E19\u0E31\u0E01\u0E07\u0E32\u0E19\u0E44\u0E1B\u0E14\u0E33\u0E23\u0E07\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E01\u0E23\u0E23\u0E21\u0E01\u0E32\u0E23\u0E43\u0E19\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E25\u0E39\u0E01\u0E43\u0E19\u0E15\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 \u0E42\u0E14\u0E22\u0E08\u0E30\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E04\u0E48\u0E32\u0E15\u0E2D\u0E1A\u0E41\u0E17\u0E19\u0E40\u0E07\u0E34\u0E19\u0E40\u0E14\u0E37\u0E2D\u0E19 \u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E34\u0E01\u0E32\u0E23\u0E15\u0E48\u0E32\u0E07 \u0E4
16"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (TH):"})," 1. \u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E21\u0E35\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E19\u0E33\u0E40\u0E07\u0E34\u0E19\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E08\u0E48\u0E32\u0E22\u0E08\u0E32\u0E01\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E19\u0E32\u0E22\u0E08\u0E49\u0E32\u0E07\u0E43\u0E19\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22\u0E21\u0E32\u0E23\u0E27\u0E21\u0E04\u0E33\u0E19\u0E27\u0E13\u0E40\u0E1B\u0E47\u0E19\u0E23\u0E32\u0E22\u0E44\u0E14\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E19\u0E33\u0E2A\u0E48\u0E07\u0E20\u0E32\u0E29\u0E35\u0E2B\u0E31\u0E01 \u0E13 \u0E17\u0E35\u0E48\u0E08\u0E48\u0E32\u0E22 \u0E15\u0E32\u0E21\u0E21\u0E32\u0E15\u0E23\u0E32 50 (1) \u0E41\u0E2B\u0E48\u0E07\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E23\u0E31\u0E29\u0E0E\u0E32\u0E01\u0E23 ... 2. ... \u0E2B\u0E32\u0E01\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E19\u0E33\u0E40\u0E07\u0E34\u0E19\u0E04\u0E48\u0E32\u0E15\u0E2D\u0E1A\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E40\u0E02\u0E49\u0E32\u0E21\u0E32\u0E43\u0E19\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22\u0E43\u0E19\u0E1B\u0E35\u0E20\u0E32\u0E29\u0E35\u0E40\u0E14\u0E35\u0E22\u0E27\u0E01\u0E31\u0E19 \u0E1C\u0E39\u0E49\u0E1A\u0E23\u0E34\u0E2B\u0E32\u0E23\u0E2B\u0E23\u0E37\u0E2D\u0E1E\u0E19\u0E31\u0E01\u0E07\u0E32\u0E19\u0E14\u0E31\u0E07\u0E01\u0E25\u0E48\u0E32\u0E27\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E2A\u0E35\u0E22\u0E20\u0E32\u0E29\u0E35\u0E40\u0E07\u0E34\u0E19\u0E44\u0E14\u0E49\u0E1A\u0E38\u0E04\u0E04\u0E25\u0E18\u0E23\u0E23\u0E21\u0E14\u0E32"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (EN):"})," The company must include income paid for duties performed for the Thai employer when computing withholding tax under Revenue Code section 50(1). An executive paid for the overseas directorship is not liable to Thai personal income tax if the money is not brought into Thailand in the same tax year."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Cited 41, 50 and 56; left out 40 and 48. Citation F1 1.00."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Closed-book"})," \u2014 no statute text in the prompt at all."]}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Question (TH):"}),' \u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E2F \u0E44\u0E14\u0E49\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E0A\u0E37\u0E48\u0E2D\u0E27\u0E48\u0E32 "C." \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E43\u0E0A\u0E49\u0E17\u0E14\u0E41\u0E17\u0E19 Choline Chloride \u0E43\u0E19\u0E2D\u0E32\u0E2B\u0E32\u0E23\u0E2A\u0E31\u0E15\u0E27\u0E4C \u0E42\u0E14\u0E22\u0E21\u0E35\u0E2A\u0E23\u0E23\u0E1E\u0E04\u0E38\u0E13\u0E43\u0E0A\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E0A\u0E48\u0E27\u0E22\u0E43\u0E19\u0E01\u0E32\u0E23\u0E17\u0E33\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E15\u0E31\u0E1A ... \u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E22\u0E01\u0E40\u0E27\u0E49\u0E19\u0E20\u0E32\u0E29\u0E35\u0E21\u0E39\u0E25\u0E04\u0E48\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48']}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (TH):"}),' \u0E01\u0E32\u0E23\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E0A\u0E37\u0E48\u0E2D "C." ... \u0E42\u0E14\u0E22\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E2F \u0E40\u0E1B\u0E47\u0E19\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E43\u0E1A\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2D\u0E32\u0E2B\u0E32\u0E23\u0E2A\u0E31\u0E15\u0E27\u0E4C\u0E04\u0E27\u0E1A\u0E04\u0E38\u0E21\u0E40\u0E09\u0E1E\u0E32\u0E30 \u0E16\u0E37\u0E2D\u0E40\u0E1B\u0E47\u0E19\u0E01\u0E32\u0E23\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2D\u0E32\u0E2B\u0E32\u0E23\u0E2A\u0E31\u0E15\u0E27\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E22\u0E01\u0E40\u0E27\u0E49\u0E19\u0E20\u0E32\u0E29\u0E35\u0E21\u0E39\u0E25\u0E04\u0E48\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E15\u0E32\u0E21\u0E21\u0E32\u0E15\u0E23\u0E32 81 (1) (\u0E07) \u0E41\u0E25\u0E30\u0E21\u0E32\u0E15\u0E23\u0E32 81 (2) (\u0E01) \u0E41\u0E2B\u0E48\u0E07\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E23\u0E31\u0E29\u0E0E\u0E32\u0E01\u0E23']}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (EN):"})," The import qualifies as an import of animal feed exempt from VAT under Revenue Code section 81(1)(d) and section 81(2)(a), the company holding the controlled animal-feed import licence."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Section and both sub-paragraphs recalled from weights, with no statute provided. Citation F1 1.00."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Legal essay"})," \u2014 graded on four axes."]}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Question (TH):"})," \u0E08\u0E33\u0E40\u0E25\u0E22\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E35\u0E49\u0E40\u0E07\u0E34\u0E19\u0E01\u0E39\u0E49\u0E22\u0E37\u0E21\u0E41\u0E25\u0E30\u0E40\u0E07\u0E34\u0E19\u0E40\u0E25\u0E48\u0E19\u0E41\u0E0A\u0E23\u0E4C\u0E08\u0E33\u0E19\u0E27\u0E19 95,600 \u0E1A\u0E32\u0E17\u0E41\u0E01\u0E48\u0E42\u0E08\u0E17\u0E01\u0E4C\u0E23\u0E48\u0E27\u0E21 \u0E0B\u0E36\u0E48\u0E07\u0E44\u0E14\u0E49\u0E08\u0E14\u0E17\u0E30\u0E40\u0E1A\u0E35\u0E22\u0E19\u0E44\u0E27\u0E49\u0E43\u0E19\u0E2A\u0E21\u0E38\u0E14\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E02\u0E2D\u0E07\u0E42\u0E08\u0E17\u0E01\u0E4C\u0E23\u0E48\u0E27\u0E21 \u0E42\u0E14\u0E22\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E25\u0E31\u0E01\u0E10\u0E32\u0E19\u0E41\u0E2B\u0E48\u0E07\u0E2B\u0E19\u0E35\u0E49 \u0E41\u0E25\u0E30\u0E08\u0E33\u0E40\u0E25\u0E22\u0E44\u0E14\u0E49\u0E25\u0E07\u0E25\u0E32\u0E22\u0E21\u0E37\u0E2D\u0E0A\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E23\u0E2D\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E43\u0E19\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E19\u0E31\u0E49\u0E19\u0E44\u0E27\u0E49 \u0E15\u0E48\u0E2D\u0E21\u0E32\u0E08\u0E33\u0E40\u0E25\u0E22\u0E44\u0E14\u0E49\u0E43\u0E0A\u0E49\u0E1B\u0E32\u0E01\u0E01\u0E32\u0E02\u0E35\u0E14\u0E06\u0E48\u0E32\u0E40\u0E1B\u0E47\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E2B\u0E21\u0E32\u0E22\u0E01\u0E32\u0E01\u0E1A\u0E32\u0E17\u0E41\u0E25\u0E30\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E2B\u0E21\u0E32\u0E22\u0E27\u0E07\u0E01\u0E25\u0E21\u0E25\u0E07\u0E1A\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (TH, excerpt):"})," \u0E28\u0E32\u0E25\u0E0E\u0E35\u0E01\u0E32\u0E1E\u0E34\u0E1E\u0E32\u0E01\u0E29\u0E32\u0E22\u0E37\u0E19\u0E15\u0E32\u0E21\u0E28\u0E32\u0E25\u0E2D\u0E38\u0E17\u0E18\u0E23\u0E13\u0E4C \u0E42\u0E14\u0E22\u0E27\u0E34\u0E19\u0E34\u0E08\u0E09\u0E31\u0E22\u0E27\u0E48\u0E32 \u0E01\u0E32\u0E23\u0E01\u0E23\u0E30\u0E17\u0E33\u0E02\u0E2D\u0E07\u0E08\u0E33\u0E40\u0E25\u0E22\u0E40\u0E1B\u0E47\u0E19\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E10\u0E32\u0E19\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E2B\u0E23\u0E37\u0E2D\u0E17\u0E33\u0E25\u0E32\u0E22\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E43\u0E19\u0E1B\u0E23\u0E30\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E19\u0E48\u0E32\u0E08\u0E30\u0E40\u0E01\u0E34\u0E14\u0E04\u0E27\u0E32\u0E21\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E41\u0E01\u0E48\u0E1C\u0E39\u0E49\u0E2D\u0E37\u0E48\u0E19 \u0E15\u0E32\u0E21\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E2D\u0E32\u0E0D\u0E32 \u0E21\u0E32\u0E15\u0E23\u0E32 188 ... \u0E41\u0E21\u0E49\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E17\u0E35\u0E48\u0E22\u0E31\u0E07\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E2D\u0E22\u0E39\u0E48\u0E08\u0E30\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E2D\u0E48\u0E32\u0E19\u0E40\u0E02\u0E49\u0E32\u0E43\u0E08\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E14\u0E34\u0E21\u0E44\u0E14\u0E49 \u0E01\u0E47\u0E16\u0E37\u0E2D\u0E40\u0E1B\u0E47\u0E19\u0E01\u0E32\u0E23\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E2B\u0E23\u0E37\u0E2D\u0E17\u0E33\u0E25\u0E32\u0E22\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E43\u0E19\u0E1B\u0E23\u0E30\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E19\u0E48\u0E32\u0E08\u0E30\u0E40\u0E01\u0E34\u0E14\u0E04\u0E27\u0E32\u0E21\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E41\u0E01\u0E48\u0E1C\u0E39\u0E49\u0E2D\u0E37\u0E48\u0E19\u0E41\u0E25\u0E49\u0E27"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Answer (EN, excerpt):"})," The Supreme Court affirmed the Court of Appeal, holding the defendant guilty of damaging or destroying a document in a manner likely to cause injury to another, under Criminal Code section 188 ... Striking out the text and figures and then tearing the document apart constitutes damage or destruction likely to cause injury, even though the remaining fragments can still be read."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"deployment",children:"Deployment"}),"\n",(0,i.jsx)(n.p,{children:"The model exposes an OpenAI-compatible API under both serving paths below, so the Python examples that follow work unchanged either way."}),"\n",(0,i.jsx)(n.h3,{id:"vllm-2-gpus-tensor-parallel",children:"vLLM (2 GPUs, tensor parallel)"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"vllm serve iapp/openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b \\\n  --tensor-parallel-size 2 --trust-remote-code \\\n  --max-model-len 32768 --enforce-eager\n"})}),"\n",(0,i.jsx)(n.h3,{id:"nvidia-nim",children:"NVIDIA NIM"}),"\n",(0,i.jsx)(n.p,{children:"The base is an NVIDIA Nemotron, so it fits the NIM for LLMs path:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker run --rm --gpus all --shm-size=16g \\\n  -v <path-to-model>:/model \\\n  -e NIM_MODEL_NAME=/model \\\n  -e NIM_SERVED_MODEL_NAME=openthai2.0-legal \\\n  -p 8000:8000 \\\n  nvcr.io/nim/nvidia/llm-nim:latest\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Use the current container tag and configuration from the ",(0,i.jsx)(n.a,{href:"https://catalog.ngc.nvidia.com/",children:"NVIDIA NIM for LLMs catalog"}),"; NIM exposes the same OpenAI-compatible endpoint."]}),"\n",(0,i.jsx)(n.admonition,{title:"Tested configuration",type:"tip",children:(0,i.jsxs)(n.p,{children:["vLLM 0.19.1, tensor-parallel 2 on 2\xd7 H100 (80 GB), ",(0,i.jsx)(n.code,{children:"--max-model-len 32768"}),", ",(0,i.jsx)(n.code,{children:"--gpu-memory-utilization 0.90"}),", ",(0,i.jsx)(n.code,{children:"--enforce-eager"}),", ",(0,i.jsx)(n.code,{children:"--trust-remote-code"}),". Thinking on and off, and temperatures 0.0 and 0.7, all verified. For single-GPU deployment, serve the NVFP4 (4-bit) weights on a card with at least 24 GB of VRAM."]})}
1),"\n",(0,i.jsx)(n.h2,{id:"quickstart",children:"Quickstart"}),"\n",(0,i.jsx)(n.h3,{id:"grounded-citation-answering-rag-mode",children:"Grounded citation answering (RAG mode)"}),"\n",(0,i.jsx)(n.p,{children:"This exact example was run against the released weights; the output shown is the model's real response."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'from openai import OpenAI\nclient = OpenAI(base_url="http://localhost:8000/v1", api_key="none")\n\nSYSTEM = ("You are OpenThaiGPT-Legal, an expert assistant on Thai law. You are given a legal "\n          "question and the exact statutory sections needed to answer it. Reason step by step in "\n          "English, then give the final answer in Thai. Cite ONLY sections present in the provided "\n          "context, using each section\'s exact law_name and bare section number (e.g. 132, 77/1). "\n          \'Output the final answer as JSON: {"answer": "<Thai answer>", \'\n          \'"citations": [{"law": "<law_name>", "section": "<bare id>"}]}.\')\n\nUSER = """Provided context:\n<law law_name="\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E1E\u0E48\u0E07\u0E41\u0E25\u0E30\u0E1E\u0E32\u0E13\u0E34\u0E0A\u0E22\u0E4C" section="420">\n\u0E1C\u0E39\u0E49\u0E43\u0E14\u0E08\u0E07\u0E43\u0E08\u0E2B\u0E23\u0E37\u0E2D\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E17\u0E40\u0E25\u0E34\u0E19\u0E40\u0E25\u0E48\u0E2D \u0E17\u0E33\u0E15\u0E48\u0E2D\u0E1A\u0E38\u0E04\u0E04\u0E25\u0E2D\u0E37\u0E48\u0E19\u0E42\u0E14\u0E22\u0E1C\u0E34\u0E14\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E43\u0E2B\u0E49\u0E40\u0E02\u0E32\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22 ... \u0E08\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E0A\u0E49\u0E04\u0E48\u0E32\u0E2A\u0E34\u0E19\u0E44\u0E2B\u0E21\u0E17\u0E14\u0E41\u0E17\u0E19\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E32\u0E23\u0E19\u0E31\u0E49\u0E19\n</law>\n\nQuestion (\u0E15\u0E2D\u0E1A\u0E40\u0E1B\u0E47\u0E19\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22):\n\u0E19\u0E32\u0E22 \u0E01. \u0E02\u0E31\u0E1A\u0E23\u0E16\u0E42\u0E14\u0E22\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E17\u0E0A\u0E19\u0E23\u0E16\u0E02\u0E2D\u0E07\u0E19\u0E32\u0E22 \u0E02. \u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22 \u0E19\u0E32\u0E22 \u0E01. \u0E15\u0E49\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E43\u0E14"""\n\nr = client.chat.completions.create(\n    model="openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b",\n    messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": USER}],\n    temperature=0.0, max_tokens=1024,\n    extra_body={"chat_template_kwargs": {"enable_thinking": False}})\nprint(r.choices[0].message.content)\n'})}),"\n",(0,i.jsx)(n.p,{children:"Actual model output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{"answer": "\u0E19\u0E32\u0E22 \u0E01. \u0E15\u0E49\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E1E\u0E48\u0E07\u0E41\u0E25\u0E30\u0E1E\u0E32\u0E13\u0E34\u0E0A\u0E22\u0E4C \u0E21\u0E32\u0E15\u0E23\u0E32 420",\n "citations": [{"law": "\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E1E\u0E48\u0E07\u0E41\u0E25\u0E30\u0E1E\u0E32\u0E13\u0E34\u0E0A\u0E22\u0E4C", "section": "420"}]}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"closed-book-mode",children:"Closed-book mode"}),"\n",(0,i.jsx)(n.p,{children:"No context at all \u2014 the model recalls the section from its weights."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'SYSTEM = ("You are an expert on Thai law. You are given ONLY a legal question, with NO reference "\n          "material provided. Using your OWN knowledge of Thai statutes, answer in Thai and cite the "\n          "specific sections that apply (law name + bare section number, \u0E21\u0E32\u0E15\u0E23\u0E32). "\n          \'Output ONLY a JSON object: {"answer":"<Thai answer>","citations":[{"law":"<law name>",\'\n          \'"section":"<bare section number e.g. 40 or 77/1>"}]}.\')\n\nUSER = """\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17 \u0E01. (\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E2F) \u0E44\u0E14\u0E49\u0E2B\u0E32\u0E23\u0E37\u0E2D\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E20\u0E32\u0E29\u0E35\u0E21\u0E39\u0E25\u0E04\u0E48\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21 \u0E01\u0E23\u0E13\u0E35\u0E01\u0E32\u0E23\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E43\u0E0A\u0E49\u0E0A\u0E37\u0E48\u0E2D C. \u0E42\u0E14\u0E22\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E2F \u0E44\u0E14\u0E49\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E0A\u0E37\u0E48\u0E2D\u0E27\u0E48\u0E32 "C." \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E43\u0E0A\u0E49\u0E17\u0E14\u0E41\u0E17\u0E19 Choline Chloride \u0E43\u0E19\u0E2D\u0E32\u0E2B\u0E32\u0E23\u0E2A\u0E31\u0E15\u0E27\u0E4C \u0E0B\u0E36\u0E48\u0E07\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17\u0E2F \u0E40\u0E1B\u0E47\u0E19\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E43\u0E1A\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2D\u0E32\u0E2B\u0E32\u0E23\u0E2A\u0E31\u0E15\u0E27\u0E4C\u0E04\u0E27\u0E1A\u0E04\u0E38\u0E21\u0E40\u0E09\u0E1E\u0E32\u0E30 \u0E08\u0E36\u0E07\u0E02\u0E2D\u0E2B\u0E32\u0E23\u0E37\u0E2D\u0E27\u0E48\u0E32 \u0E01\u0E32\u0E23\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E14\u0E31\u0E07\u0E01\u0E25\u0E48\u0E32\u0E27\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E22\u0E01\u0E40\u0E27\u0E49\u0E19\u0E20\u0E32\u0E29\u0E35\u0E21\u0E39\u0E25\u0E04\u0E48\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48"""\n\nr = client.chat.completions.
1create(\n    model="openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b",\n    messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": USER}],\n    temperature=0.0, max_tokens=1024,\n    extra_body={"chat_template_kwargs": {"enable_thinking": False}})\nprint(r.choices[0].message.content)\n'})}),"\n",(0,i.jsx)(n.h3,{id:"essay-mode",children:"Essay mode"}),"\n",(0,i.jsxs)(n.p,{children:["A short system prompt and the exam question. The model writes a full legal essay, citing \u0E21\u0E32\u0E15\u0E23\u0E32 in prose rather than JSON, so raise ",(0,i.jsx)(n.code,{children:"max_tokens"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'SYSTEM = "You are a Thai legal expert. Answer the question with legal analysis and cite the relevant \u0E21\u0E32\u0E15\u0E23\u0E32."\n\nUSER = """\u0E08\u0E33\u0E40\u0E25\u0E22\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E35\u0E49\u0E40\u0E07\u0E34\u0E19\u0E01\u0E39\u0E49\u0E22\u0E37\u0E21\u0E41\u0E25\u0E30\u0E40\u0E07\u0E34\u0E19\u0E40\u0E25\u0E48\u0E19\u0E41\u0E0A\u0E23\u0E4C\u0E08\u0E33\u0E19\u0E27\u0E19 95,600 \u0E1A\u0E32\u0E17\u0E41\u0E01\u0E48\u0E42\u0E08\u0E17\u0E01\u0E4C\u0E23\u0E48\u0E27\u0E21 \u0E0B\u0E36\u0E48\u0E07\u0E44\u0E14\u0E49\u0E08\u0E14\u0E17\u0E30\u0E40\u0E1A\u0E35\u0E22\u0E19\u0E44\u0E27\u0E49\u0E43\u0E19\u0E2A\u0E21\u0E38\u0E14\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E02\u0E2D\u0E07\u0E42\u0E08\u0E17\u0E01\u0E4C\u0E23\u0E48\u0E27\u0E21 \u0E42\u0E14\u0E22\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E25\u0E31\u0E01\u0E10\u0E32\u0E19\u0E41\u0E2B\u0E48\u0E07\u0E2B\u0E19\u0E35\u0E49 \u0E15\u0E48\u0E2D\u0E21\u0E32\u0E08\u0E33\u0E40\u0E25\u0E22\u0E44\u0E14\u0E49\u0E43\u0E0A\u0E49\u0E1B\u0E32\u0E01\u0E01\u0E32\u0E02\u0E35\u0E14\u0E06\u0E48\u0E32\u0E41\u0E25\u0E30\u0E09\u0E35\u0E01\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E08\u0E19\u0E02\u0E32\u0E14\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E01\u0E31\u0E19 \u0E41\u0E21\u0E49\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E17\u0E35\u0E48\u0E22\u0E31\u0E07\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E2D\u0E22\u0E39\u0E48\u0E08\u0E30\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E2D\u0E48\u0E32\u0E19\u0E40\u0E02\u0E49\u0E32\u0E43\u0E08\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E14\u0E34\u0E21\u0E44\u0E14\u0E49 \u0E08\u0E33\u0E40\u0E25\u0E22\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E10\u0E32\u0E19\u0E43\u0E14 \u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E1B\u0E47\u0E19\u0E40\u0E1E\u0E35\u0E22\u0E07\u0E01\u0E32\u0E23\u0E1E\u0E22\u0E32\u0E22\u0E32\u0E21\u0E01\u0E23\u0E30\u0E17\u0E33\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48"""\n\nr = client.chat.completions.create(\n    model="openthai2.0-legal-thaillm-nemotron-3-nano-30b-a3b",\n    messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": USER}],\n    temperature=0.7, max_tokens=3000,\n    extra_body={"chat_template_kwargs": {"enable_thinking": False}})\nprint(r.choices[0].message.content)\n'})}),"\n",(0,i.jsx)(n.h2,{id:"recommended-generation-settings",children:"Recommended generation settings"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Use case"}),(0,i.jsx)(n.th,{children:"temperature"}),(0,i.jsx)(n.th,{children:"top_p"}),(0,i.jsx)(n.th,{children:"max_tokens (suggested)"}),(0,i.jsx)(n.th,{children:"thinking"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Citation answering (RAG or closed-book)"}),(0,i.jsx)(n.td,{children:"0.0"}),(0,i.jsx)(n.td,{children:"1.0"}),(0,i.jsx)(n.td,{children:"1024"}),(0,i.jsx)(n.td,{children:"off"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Legal essay drafting"}),(0,i.jsx)(n.td,{children:"0.7"}),(0,i.jsx)(n.td,{children:"0.9"}),(0,i.jsx)(n.td,{children:"2048\u20134096"}),(0,i.jsx)(n.td,{children:"on or off"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"General chat"}),(0,i.jsx)(n.td,{children:"0.7"}),(0,i.jsx)(n.td,{children:"0.9"}),(0,i.jsx)(n.td,{children:"1024"}),(0,i.jsx)(n.td,{children:"off"})]})]})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"max_tokens"})," values are suggestions, not limits: any budget up to the context window works, and answers terminate naturally (citation answers rarely exceed 700 tokens). Raise it freely for long essays or thinking mode."]}),"\n",(0,i.jsx)(n.li,{children:"Thinking mode is fully supported: the model reasons in English inside a think block, then answers in Thai. It helps on essays and complex analysis. The benchmark numbers above use thinking off, which is the tuned path for citation tasks; allow roughly 2\xd7 the token budget when thinking is on."}),"\n",(0,i.jsxs)(n.li,{children:["Serve with ",(0,i.jsx)(n.strong,{children:"at least"})," ",(0,i.jsx)(n.code,{children:"--max-model-len 32768"}
1),": real Revenue Code contexts overflow smaller windows. Raise it toward the full 256k as your VRAM allows."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"suitable-for",children:"Suitable for"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Legal RAG and search"})," \u2014 pair it with any retriever; it cites only what applies from the supplied sections."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Drafting and review tools"})," \u2014 the JSON citation contract plugs straight into automation."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"In-house counsel and compliance"})," \u2014 self-hosted, so client and case data never leaves your perimeter."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Public agencies"})," \u2014 data residency and governance stay entirely under your control."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Research and fine-tuning"})," \u2014 open weights, ready to adapt to your own legal domain."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"limitations-and-responsible-use",children:"Limitations and responsible use"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Retrieval quality drives results."})," Given the right sections, citations are near-perfect; if the retriever supplies the wrong sections, the answer follows them. For production RAG, pair the model with a sound retriever and monitor retrieval quality."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Near-miss rejection is the hardest task."})," Tax selection (picking the applicable section among close alternatives) is the lowest-scoring axis for every model, ours included. Retrieval tuning and human review are advised for high-stakes use."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Structured output is the strong path."})," The JSON citation contract is ideal for automation and legal-tech pipelines; free-form chat is supported but less structured."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Scope."})," Trained on Thai statutory law (Revenue Code, Civil and Commercial Code, related acts) and Revenue Department rulings; coverage of niche areas or very recent amendments may be thinner, and statutes change over time."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Human oversight required."})," Outputs are decision support, ",(0,i.jsx)(n.strong,{children:"not legal advice"}),". A qualified professional should verify every citation against the current law before relying on it."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Data provenance."})," Some essay training data derives from Thai bar examination materials; confirm redistribution terms for your jurisdiction and use case."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"sources-and-acknowledgements",children:"Sources and acknowledgements"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Base model: ",(0,i.jsx)(n.a,{href:"https://huggingface.co/nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16",children:"NVIDIA Nemotron-3-Nano-Omni-30B-A3B-Reasoning"}),", NVIDIA Open Model Agreement. We train on its extracted text core."]}),"\n",(0,i.jsxs)(n.li,{children:["Evaluation: ",(0,i.jsx)(n.a,{href:"https://huggingface.co/datasets/VISAI-AI/nitibench",children:"NitiBench"})," (VISAI-AI, MIT); SFT data built from WangchanX-Legal-ThaiCCL (VISTEC, MIT)."]}),"\n",(0,i.jsxs)(n.li,{children:["Built by the OpenThai team (",(0,i.jsx)(n.strong,{children:"AIEAT"})," / ",(0,i.jsx)(n.strong,{children:"iApp Technology"}),") on the ",(0,i.jsx)(n.strong,{children:"NVIDIA NeMo"})," stack, with the ",(0,i.jsx)(n.strong,{children:"Big Data Institute (BDI)"}),", the ",(0,i.jsx)(n.strong,{children:"ThaiLLM"})," initiative and ",(0,i.jsx)(n.strong,{children:"NVIDIA"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"get-in-touch",children:"Get in touch"}),"\n",(0,i.jsx)(n.p,{children:"Deploying OpenThai 2.0 Legal in your organization, or want it tuned to your own corpus?"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Email:"})," ",(0,i.jsx)(n.a,{href:"mailto:[email protected]",children:"[email protected]"})," \xb7 ",(0,i.jsx)(n.strong,{children:"Phone:"})," 086-322-5858"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Discord:"})," ",(0,i.jsx)(n.a,{href:"https://discord.gg/kYcpmdEcS2",children:"iApp community"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"More open models:"})," ",(0,i.jsx)(n.a,{href:"/openmodels/openthai-chinda-opensource-llm",children:"OpenThai Chinda 4B"})]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},29574:function(e,n,t){t.d(n,{Z:()=>p});var s=t(96540),i=t(96990),r=t(33717),a=t(51003);let l="container_YZJz",o="input_GqCS",d="hint_xP6G",c="link_Sydx";var h=t(74848);
1let p=({value:e,onChange:n,className:t})=>{let{user:p}=(0,r.A)(),[u,m]=(0,s.useState)([]),[g,x]=(0,s.useState)(!1),[j,y]=(0,s.useState)(!1),[w,f]=(0,s.useState)(e),v=(0,i.Ay)("/login"),b=(0,i.Ay)("/register"),k=(0,i.Ay)("/control/api-keys");(0,s.useEffect)(()=>{p&&A()},[p]),(0,s.useEffect)(()=>{f(e)},[e]);let A=async()=>{try{x(!0);let t=await a.FH.getApiKeys();m(t.keys||[]),t.keys&&t.keys.length>0&&!e&&n(t.keys[0].key)}catch(e){console.error("Failed to fetch API keys:",e)}finally{x(!1)}};return p?g?(0,h.jsxs)("div",{className:`${l} ${t||""}`,children:[(0,h.jsx)("label",{children:"API Key"}),(0,h.jsx)("p",{className:"loading_bNBf",children:"Loading your API keys..."})]}):(0,h.jsxs)("div",{className:`${l} ${t||""}`,children:[(0,h.jsx)("label",{children:"API Key"}),0===u.length?(0,h.jsxs)("div",{className:"noKeys_kkUN",children:[(0,h.jsx)("p",{children:"You don't have any API keys yet."}),(0,h.jsx)("a",{href:k,className:"createButton_d6IZ",children:"Create Your First API Key"})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("select",{value:j?"custom":e,onChange:e=>{let t=e.target.value;"custom"===t?(y(!0),n(w)):(y(!1),n(t))},className:"select_Aqio",children:[u.map(e=>(0,h.jsxs)("option",{value:e.key,children:[e.name," - ",e.key]},e.id)),(0,h.jsx)("option",{value:"custom",children:"Custom / Other Key"})]}),j&&(0,h.jsx)("div",{className:"customInputContainer_jfjn",children:(0,h.jsx)("input",{type:"text",value:w,onChange:e=>{let t=e.target.value;f(t),n(t)},placeholder:"Enter custom API key",className:o})}),(0,h.jsx)("p",{className:d,children:(0,h.jsx)("a",{href:k,className:c,children:"Manage your API keys"})})]})]}):(0,h.jsxs)("div",{className:`${l} ${t||""}`,children:[(0,h.jsx)("label",{children:"API Key"}),(0,h.jsx)("input",{type:"text",value:e,onChange:e=>n(e.target.value),placeholder:"Enter your API key",className:o}),(0,h.jsxs)("p",{className:d,children:[(0,h.jsx)("a",{href:v,className:c,children:"Log in to use your API keys"})," or ",(0,h.jsx)("a",{href:b,className:c,children:"Create an account"})]})]})}},91035:function(e,n,t){t.d(n,{A:()=>j});var s=t(96540),i=t(29574);let r="thinkToggle_mLf1",a="resultLabel_RVHT",l="devBlockHead_n20D",o="devCode_T9ux";var d=t(74848);let c=[{re:/`([^`]+)`/,type:"code"},{re:/\*\*([^*]+)\*\*/,type:"bold"},{re:/__([^_]+)__/,type:"bold"},{re:/\[([^\]]+)\]\(([^)\s]+)\)/,type:"link"},{re:/(?<![\w*])\*([^*\n]+)\*(?![\w*])/,type:"italic"}];function h(e,n="i"){let t;if(!e)return null;let s=null;for(let n of c){let t=n.re.exec(e);t&&(null===s||t.index<s.m.index)&&(s={m:t,type:n.type})}if(!s)return e;let{m:i,type:r}=s,a=e.slice(0,i.index),l=e.slice(i.index+i[0].length),o=`${n}-${i.index}`;return"code"===r?t=(0,d.jsx)("code",{className:"mdCode_DJ1t",children:i[1]},o):"bold"===r?t=(0,d.jsx)("strong",{children:h(i[1],`${o}b`)},o):"italic"===r?t=(0,d.jsx)("em",{children:h(i[1],`${o}i`)},o):"link"===r&&(t=(0,d.jsx)("a",{href:i[2],target:"_blank",rel:"noopener noreferrer",children:h(i[1],`${o}l`)},o)),[a||null,t,h(l,`${n}x`)]}function p({text:e,className:n}){if(!e)return null;let t=String(e).replace(/\r\n/g,"\n").split("\n"),i=[],r=[],a=null,l=null,o=()=>{r.length&&(i.push({t:"p",lines:r}),r=[])},c=()=>{a&&(i.push(a),a=null)};for(let e=0;e<t.length;e++){let n=t[e];if(/^\s*```/.test(n)){l?(i.push(l),l=null):(o(),c(),l={t:"code",lines:[]});continue}if(l){l.lines.push(n);continue}if(!n.trim()){if(o(),a){let n=e+1;for(;n<t.length&&!t[n].trim();)n++;let s=n<t.length?t[n]:"";(a.ordered?/^\s*\d+[.)]\s+/.test(s):/^\s*[-*+]\s+/.test(s))||c()}continue}if(/^\s*([-*_])\1{2,}\s*$/.test(n)){o(),c(),i.push({t:"hr"});continue}if(n.includes("|")&&e+1<t.length&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(t[e+1])&&t[e+1].includes("-")){o(),c();let s=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim()),r=s(n),a=[],l=e+2;for(;l<t.length&&t[l].includes("|")&&t[l].trim();)a.push(s(t[l])),l++;i.push({t:"table",header:r,rows:a}),e=l-1;continue}let s=n.match(/^(#{1,4})\s+(.*)$/);if(s){o(),c(),i.push({t:"h",level:s[1].length,text:s[2]});continue}let d=n.match(/^>\s?(.*)$/);if(d){o(),c(),i.push({t:"quote",text:d[1]});continue}let h=n.match(/^\s*[-*+]\s+(.*)$/),p=n.match(/^\s*(\d+)[.)]\s+(.*)$/);if(h||p){o();let e=!!p;a&&a.ordered===e||(c(),a={t:"list",ordered:e,items:[],...e?{start:parseInt(p[1],10)||1}:{}}),a.items.push(h?h[1]:p[2]);continue}c(),r.push(n)}return l&&i.push(l),o(),c(),(0,d.jsx)("div",{className:`md_Ci4s ${n||""}`,children:i.map((e,n)=>{if("h"===e.t){let t=`h${Math.min(e.level+2,6)}`;return(0,d.jsx)(t,{className:"mdHeading_AseH",children:h(e.text,`h${n}`)},n)}if("quote"===e.t)return(0,d.jsx)("blockquote",{className:"mdQuote_hm_e",children:h(e.text,`q${n}`)},n);if("hr"===e.t)return(0,d.jsx)("hr",{className:"mdHr_Al_V"},n);if("table"===e.t)return(0,d.jsx)("div",{className:"mdTableWrap_pAgl",children:(0,d.jsxs)("table",{className:"mdTable_PPqs",children:[(0,d.jsx)("thead",{children:(0,d.jsx)("tr",{children:e.header.map((e,t)=>(0,d.jsx)("th",{children:h(e,`th${n}-${t}`)},t))})}),(0,d.jsx)("tbody",{children:e.rows.map((e,t)=>(0,d.jsx)("tr",{children:e.map((e,s)=>(0,d.jsx)("td",{children:h(e,`td${n}-${t}-${s}`)},s))},t))})]})},n);if("code"===e.t)return(0,d.jsx)("pre",{className:"mdPre_Wufl",children:(0,d.jsx)("code",{children:e.lines.join("\n")})},n);if("list"===e.t){let t=e.ordered?"ol":"ul";return(0,d.jsx)(t,{className:"mdList_HCEV",...e.ordered&&e.start>1?{start:e.start}:{},children:e.items.map((e,t)=>(0,d.jsx)("li",{children:h(e,`l${n}-${t}`)},t))},n)}return(0,d.jsx)("p",{className:"mdP__idm",children:e.lines.map((e,t)=>(0,d.jsxs)(s.Fragment,{children:[t>0&&(0,d.jsx)("br",{}),h(e,`p${n}-${t}`)]},t))},n)})})}let u=()=>{if("undefined"==typeof window)return"https://api.iapp.co.th";let e=window.location.hostname;return"iapp.co.th"===e||"www.iapp.co.th"===e?"https://api.iapp.co.th":"https://uat-api.iapp.co.th"},m={essay:{thinkDefault:!0,rag:!0,ragInject:"system",system:"You are a Thai legal expert. Answer with legal analysis and cite the relevant \u0E21\u0E32\u0E15\u0E23\u0E32.",temperature:0,top_p:1,max_tokens:4096,json:!1,presets:["\u0E08\u0E33\u0E40\u0E25\u0E22\u0E02\u0E35\u0E14\u0E06\u0E48\u0E32\u0E41\u0E25\u0E30\u0E09\u0E35\u0E01\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E2B\u0E25\u0E31\u0E01\u0E10\u0E32\u0E19\u0E41\u0E2B\u0E48\u0E07\u0E2B\u0E19\u0E35\u0E49 \u0E41\u0E21\u0E49\u0E22\u0E31\u0E07\u0E2D\u0E48\u0E32\u0E19\u0E44\u0E14\u0E49 \u0E16\u0E37\u0E2D\u0E40\u0E1B\u0E47\u0E19\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E1E\u0E35\u0E22\u0E07\u0E1E\u0E22\u0E32\u0E22\u0E32\u0E21\u0E01\u0E23\u0E30\u0E17\u0E33\u0E1C\u0E34\u0E14","\u0E08\u0E33\u0E40\u0E25\u0E22\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E21\u0E2D\u0E1A\u0E2B\u0E21\u0E32\u0E22\u0E43\u0E2B\u0E49\u0E40\u0E01\u0E47\u0E1A\u0E23\u0E31\u0E01\u0E29\u0E32\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E2A\u0E34\u0E19\u0E02\u0E2D\u0E07\u0E1C\u0E39\u0E49\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E44\u0E27\u0E49 \u0E15\u0E48\u0E2D\u0E21\u0E32\u0E40\u0E1A\u0E35\u0E22\u0E14\u0E1A\u0E31\u0E07\u0E40\u0E2D\u0E32\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E19\u0E31\u0E49\u0E19\u0E40\u0E1B\u0E47\u0E19\u0E02\u0E2D\u0E07\u0E15\u0E19\u0E42\u0E14\u0E22\u0E17\u0E38\u0E08\u0E23\u0E34\u0E15 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E10\u0E32\u0E19\u0E43\u0E14"]},rag:{thinkDefault:!1,rag:!0,system:'You are OpenThaiGPT-Legal, an expert assistant on Thai law. You are given a legal question and the exact statutory sections needed to answer it. Reason step by step in English, then give the final answer in Thai. Cite ONLY sections present in the provided context, using each section\'s exact law_name and bare section number (e.g. 132, 77/1). Output the final answer as JSON: {"answer": "<Thai answer>", "citations": [{"law": "<law_name>", "section": "<bare id>"}]}
1.',temperature:0,top_p:1,max_tokens:2048,json:!0,presets:["\u0E19\u0E32\u0E22 \u0E01. \u0E02\u0E31\u0E1A\u0E23\u0E16\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E17\u0E0A\u0E19\u0E23\u0E16\u0E19\u0E32\u0E22 \u0E02. \u0E15\u0E49\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E43\u0E14","\u0E25\u0E39\u0E01\u0E08\u0E49\u0E32\u0E07\u0E17\u0E33\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E1A\u0E38\u0E04\u0E04\u0E25\u0E20\u0E32\u0E22\u0E19\u0E2D\u0E01\u0E43\u0E19\u0E17\u0E32\u0E07\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E08\u0E49\u0E32\u0E07 \u0E43\u0E04\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E1C\u0E34\u0E14","\u0E2B\u0E21\u0E34\u0E48\u0E19\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E17\u0E42\u0E14\u0E22\u0E01\u0E32\u0E23\u0E42\u0E06\u0E29\u0E13\u0E32 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E2D\u0E32\u0E0D\u0E32\u0E21\u0E32\u0E15\u0E23\u0E32\u0E43\u0E14"]},closedbook:{thinkDefault:!1,rag:!1,system:'You are an expert on Thai law. NO reference material is provided. Use your own knowledge, answer in Thai, cite law name + bare section. Output ONLY JSON: {"answer":"<Thai>","citations":[{"law":"<name>","section":"<id>"}]}.',temperature:0,top_p:1,max_tokens:2048,json:!0,presets:["\u0E25\u0E31\u0E01\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E43\u0E19\u0E40\u0E27\u0E25\u0E32\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E2D\u0E32\u0E0D\u0E32\u0E21\u0E32\u0E15\u0E23\u0E32\u0E43\u0E14","\u0E2A\u0E31\u0E0D\u0E0D\u0E32\u0E01\u0E39\u0E49\u0E22\u0E37\u0E21\u0E40\u0E07\u0E34\u0E19\u0E40\u0E01\u0E34\u0E19 2,000 \u0E1A\u0E32\u0E17 \u0E44\u0E21\u0E48\u0E21\u0E35\u0E2B\u0E25\u0E31\u0E01\u0E10\u0E32\u0E19\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E31\u0E07\u0E2A\u0E37\u0E2D \u0E1F\u0E49\u0E2D\u0E07\u0E23\u0E49\u0E2D\u0E07\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A\u0E04\u0E14\u0E35\u0E44\u0E14\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48","\u0E2B\u0E21\u0E34\u0E48\u0E19\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E17\u0E42\u0E14\u0E22\u0E01\u0E32\u0E23\u0E42\u0E06\u0E29\u0E13\u0E32 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E1C\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E2D\u0E32\u0E0D\u0E32\u0E21\u0E32\u0E15\u0E23\u0E32\u0E43\u0E14"]}},g={en:{title:"Try OpenThai 2.0 Legal \u2014 Live",sub:"Real model, real answers. Free with your iApp API key until 30 Sep 2026.",free:"FREE API \xb7 1 MONTH",ragOnTitle:"RAG connected \u2014 answers grounded in real statute text",ragOnBody:"This API retrieves from a 39-law, 6,300-section Thai statute corpus (hybrid BM25 + embedding search + reranker) and grounds every answer in the current law text. The sections it selects are shown below each answer. Switch to Closed-book mode (rag: false in the API) to compare with the bare model.",apiKey:"Your iApp API key",apiKeyPlaceholder:"Paste your API key\u2026",getKey:"No key yet? Register free \u2192",errAuth:'Invalid or missing API key. Register free at iapp.co.th, then create a key under "API Keys" in the control panel.',modes:{closedbook:"Closed-book (no RAG)",rag:"Citation + RAG",essay:"Legal essay + RAG"},hints:{closedbook:"rag: false \u2014 no retrieval. The model recalls the law and section (\u0E21\u0E32\u0E15\u0E23\u0E32) from memory alone. Kept as the comparison mode.",rag:"The server auto-retrieves the applicable sections and the model cites only from them, in JSON. The retrieved sections appear below the answer.",essay:"Full legal analysis in prose, citing \u0E21\u0E32\u0E15\u0E23\u0E32 \u2014 grounded in auto-retrieved current statute text."},question:"Question (Thai)",run:"Ask the model",running:"Thinking\u2026",thinking:"Show reasoning (slower)",streamToggle:"Stream the answer (SSE)",devTitle:"Developer view \u2014 the API call behind this demo",devHint:"This curl command updates live as you change the question, mode and toggles above. Run it in your terminal with your own API key \u2014 it is exactly what this page sends.",devRequest:"Request (curl)",devResponse:"Response (JSON)",devResponseSse:"Response (SSE 
1stream)",devCopy:"Copy with my key",devCopied:"\u2713 Copied",thinkNote:"Note: for citation modes the model was tuned with reasoning off \u2014 leaving it on can change which section it cites.",answer:"Answer",citations:"Citations",reasoning:"Model reasoning",retrieved:e=>`Retrieved law sections (${e}) \u{2014} the RAG step`,retrievedHint:"How the answer was grounded: the server hybrid-searched the statute corpus (BM25 + embeddings), reranked the candidates, and gave the model these sections. Score = reranker relevance.",tokens:(e,n)=>`tokens: ${e} in / ${n} out`,latency:e=>`latency: ${e}s`,tryOne:"Try an example:",errRate:"Rate limit reached (30 requests/minute per IP on the free tier). Please wait a moment and try again.",errGeneric:"The model endpoint is unreachable right now. Please try again shortly.",disclaimer:"Outputs are decision support, not legal advice. Verify every citation against the current law. Free with an iApp API key to 30 Sep 2026; standard pricing afterwards is 0.01/0.02 IC per 1K input/output tokens (same as Thanoy Legal AI)."},th:{title:"\u0E17\u0E14\u0E25\u0E2D\u0E07\u0E43\u0E0A\u0E49 OpenThai 2.0 Legal \u2014 \u0E2A\u0E14\u0E08\u0E32\u0E01\u0E42\u0E21\u0E40\u0E14\u0E25\u0E08\u0E23\u0E34\u0E07",sub:"\u0E43\u0E0A\u0E49\u0E1F\u0E23\u0E35\u0E14\u0E49\u0E27\u0E22 iApp API key \u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13 \u0E16\u0E36\u0E07 30 \u0E01.\u0E22. 2569",free:"API \u0E1F\u0E23\u0E35 \xb7 1 \u0E40\u0E14\u0E37\u0E2D\u0E19",ragOnTitle:"\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D RAG \u0E41\u0E25\u0E49\u0E27 \u2014 \u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E08\u0E23\u0E34\u0E07",ragOnBody:'API \u0E19\u0E35\u0E49\u0E04\u0E49\u0E19\u0E04\u0E37\u0E19\u0E08\u0E32\u0E01\u0E04\u0E25\u0E31\u0E07\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E44\u0E17\u0E22 39 \u0E09\u0E1A\u0E31\u0E1A \u0E01\u0E27\u0E48\u0E32 6,300 \u0E21\u0E32\u0E15\u0E23\u0E32 (hybrid: BM25 + vector search + reranker) \u0E41\u0E25\u0E49\u0E27\u0E43\u0E2B\u0E49\u0E42\u0E21\u0E40\u0E14\u0E25\u0E15\u0E2D\u0E1A\u0E42\u0E14\u0E22\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E09\u0E1A\u0E31\u0E1A\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19 \u0E21\u0E32\u0E15\u0E23\u0E32\u0E17\u0E35\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E21\u0E32\u0E08\u0E30\u0E41\u0E2A\u0E14\u0E07\u0E43\u0E15\u0E49\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E17\u0E38\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07 \u0E2A\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E42\u0E2B\u0E21\u0E14 "\u0E1B\u0E34\u0E14\u0E15\u0E33\u0E23\u0E32" (rag: false \u0E43\u0E19 API) \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E1B\u0E23\u0E35\u0E22\u0E1A\u0E40\u0E17\u0E35\u0E22\u0E1A\u0E01\u0E31\u0E1A\u0E42\u0E21\u0E40\u0E14\u0E25\u0E40\u0E1B\u0E25\u0E48\u0E32',apiKey:"iApp API key \u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",apiKeyPlaceholder:"\u0E27\u0E32\u0E07 API key \u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u2026",getKey:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E35\u0E22\u0E4C? \u0E2A\u0E21\u0E31\u0E04\u0E23\u0E1F\u0E23\u0E35 \u2192",errAuth:'API key \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E43\u0E2A\u0E48 \u0E2A\u0E21\u0E31\u0E04\u0E23\u0E1F\u0E23\u0E35\u0E17\u0E35\u0E48 iapp.co.th \u0E41\u0E25\u0E49\u0E27\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E40\u0E21\u0E19\u0E39 "API Keys" \u0E43\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E04\u0E27\u0E1A\u0E04\u0E38\u0E21',modes:{closedbook:"\u0E1B\u0E34\u0E14\u0E15\u0E33\u0E23\u0E32 (\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E49 RAG)",rag:"\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E15\u0E31\u0E27\u0E1A\u0E17 + RAG",essay:"\u0E40\u0E02\u0E35\u0E22\u0E19\u0E27\u0E34\u0E40\u0E04\u0E23\u0E32\u0E30\u0E2B\u0E4C + RAG"},hints:{closedbook:"rag: false \u2014 \u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E04\u0E49\u0E19\u0E04\u0E37\u0E19 \u0E42\u0E21\u0E40\u0E14\u0E25\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E04\u0E27\u0E32\u0E21\u0E08\u0E33\u0E25\u0E49\u0E27\u0E19 \u0E46 \u0E40\u0E01\u0E47\u0E1A\u0E44\u0E27\u0E49\u0E40\u0E1B\u0E47\u0E19\u0E42\u0E2B\u0E21\u0E14\u0E40\u0E1B\u0E23\u0E35\u0E22\u0E1A\u0E40\u0E17\u0E35\u0E22\u0E1A",rag:"\u0E23\u0E30\u0E1A\u0E1A\u0E04\u0E49\u0E19\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E17\u0E35\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07\u0E43\u0E2B\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34 \u0E42\u0E21\u0E40\u0E14\u0E25\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E40\u0E09\u0E1E\u0E32\u0E30\u0E21\u0E32\u0E15\u0E23\u0E32\u0E17\u0E35\u0E48\u0E04\u0E49\u0E19\u0E44\u0E14\u0E49 \u0E15\u0E2D\u0E1A\u0E40\u0E1B\u0E47\u0E19 JSON \u2014 \u0E21\u0E32\u0E15\u0E23\u0E32\u0E17\u0E35\u0E48\u0E04\u0E49\u0E19\u0E44\u0E14\u0E49\u0E41\u0E2A\u0E14\u0E07\u0E43\u0E15\u0E49\u0E04\u0E33\u0E15\u0E2D\u0E1A",essay:"\u0E27\u0E34\u0E40\u0E04\u0E23\u0E32\u0E30\u0E2B\u0E4C\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E1A\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E40\u0E23\u0E35\u0E22\u0E07\u0E40\u0E15\u0E47\u0E21\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A \u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E2D\u0E49\u0E32\u0E07\u0E21\u0E32\u0E15\u0E23\u0E32\u0E08\u0E32\u0E01\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E09\u0E1A\u0E31\u0E1A\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E17\u0E35\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E04\u0E49\u0E19\u0E43\u0E2B\u0E49"},question:"\u0E04\u0E33\u0E16\u0E32\u0E21 (\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22)",run:"\u0E16\u0E32\u0E21\u0E42\u0E21\u0E40\u0E14\u0E25",running:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E34\u0E14\u2026",thinking:"\u0E41\u0E2A\u0E14\u0E07\u0E01\u0E32\u0E23\u0E43\u0E2B\u0E49\u0E40\u0E2B\u0E15\u0E38\u0E1C\u0E25 (\u0E0A\u0E49\u0E32\u0E25\u0E07)",streamToggle:"\u0E2A\u0E15\u0E23\u0E35\u0E21\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E17\u0E35\u0E25\u0E30\u0E2A\u0E48\u0E27\u0E19 (SSE)",devTitle:"\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32 \u2014 \u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07 API \u0E40\u0E1A\u0E37\u0E49\u0E2D\u0E07\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E14\u0E42\u0E21\u0E19\u0E35\u0E49",devHint:"\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07 curl \u0E19\u0E35\u0E49\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E2A\u0E14\u0E15\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21 \u0E42\u0E2B\u0E21\u0E14 \u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E31\u0E49\u0E07\u0E14\u0E49\u0E32\u0E19\u0E1A\u0E19 \u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E23\u0E31\u0E19\u0E43\u0E19\u0E40\u0E17\u0E2D\u0E23\u0E4C\u0E21\u0E34\u0E19\u0E31\u0E25\u0E14\u0E49\u0E27\u0E22 API key \u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22 \u2014 \u0E40\u0E1B\u0E47\u0E19\u0E04\u0E33\u0E02\u0E2D\u0E40\u0E14\u0E35\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E17\u0E35\u0E48\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49\u0E2A\u0E48\u0E07\u0E08\u0E23\u0E34\u0E07",devRequest:"\u0E04\u0E33\u0E02\u0E2D (curl)",devResponse:"\u0E1C\u0E25\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A (JSON)",devResponseSse:"\u0E1C\u0E25\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A (SSE 
1stream)",devCopy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E04\u0E35\u0E22\u0E4C\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",devCopied:"\u2713 \u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E41\u0E25\u0E49\u0E27",thinkNote:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E2B\u0E15\u0E38: \u0E42\u0E2B\u0E21\u0E14\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E21\u0E32\u0E15\u0E23\u0E32\u0E16\u0E39\u0E01\u0E1B\u0E23\u0E31\u0E1A\u0E08\u0E39\u0E19\u0E21\u0E32\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E1B\u0E34\u0E14\u0E42\u0E2B\u0E21\u0E14\u0E04\u0E34\u0E14 \u0E01\u0E32\u0E23\u0E40\u0E1B\u0E34\u0E14\u0E44\u0E27\u0E49\u0E2D\u0E32\u0E08\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E21\u0E32\u0E15\u0E23\u0E32\u0E17\u0E35\u0E48\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E44\u0E1B",answer:"\u0E04\u0E33\u0E15\u0E2D\u0E1A",citations:"\u0E01\u0E32\u0E23\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07",reasoning:"\u0E01\u0E32\u0E23\u0E43\u0E2B\u0E49\u0E40\u0E2B\u0E15\u0E38\u0E1C\u0E25\u0E02\u0E2D\u0E07\u0E42\u0E21\u0E40\u0E14\u0E25",retrieved:e=>`\u{E15}\u{E31}\u{E27}\u{E1A}\u{E17}\u{E17}\u{E35}\u{E48}\u{E23}\u{E30}\u{E1A}\u{E1A}\u{E04}\u{E49}\u{E19}\u{E04}\u{E37}\u{E19}\u{E44}\u{E14}\u{E49} (${e} \u{E21}\u{E32}\u{E15}\u{E23}\u{E32}) \u{2014} \u{E02}\u{E31}\u{E49}\u{E19}\u{E15}\u{E2D}\u{E19} RAG`,retrievedHint:"\u0E17\u0E35\u0E48\u0E21\u0E32\u0E02\u0E2D\u0E07\u0E04\u0E33\u0E15\u0E2D\u0E1A: \u0E23\u0E30\u0E1A\u0E1A\u0E04\u0E49\u0E19\u0E04\u0E25\u0E31\u0E07\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E41\u0E1A\u0E1A\u0E44\u0E2E\u0E1A\u0E23\u0E34\u0E14 (BM25 + vector) \u0E08\u0E31\u0E14\u0E2D\u0E31\u0E19\u0E14\u0E31\u0E1A\u0E43\u0E2B\u0E21\u0E48\u0E14\u0E49\u0E27\u0E22 reranker \u0E41\u0E25\u0E49\u0E27\u0E2A\u0E48\u0E07\u0E21\u0E32\u0E15\u0E23\u0E32\u0E40\u0E2B\u0E25\u0E48\u0E32\u0E19\u0E35\u0E49\u0E43\u0E2B\u0E49\u0E42\u0E21\u0E40\u0E14\u0E25 \u0E04\u0E30\u0E41\u0E19\u0E19 = \u0E04\u0E27\u0E32\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07\u0E08\u0E32\u0E01 reranker",tokens:(e,n)=>`\u{E42}\u{E17}\u{E40}\u{E04}\u{E19}: \u{E40}\u{E02}\u{E49}\u{E32} ${e} / \u{E2D}\u{E2D}\u{E01} ${n}`,latency:e=>`\u{E43}\u{E0A}\u{E49}\u{E40}\u{E27}\u{E25}\u{E32}: ${e} \u{E27}\u{E34}`,tryOne:"\u0E25\u0E2D\u0E07\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07:",errRate:"\u0E04\u0E23\u0E1A\u0E42\u0E04\u0E27\u0E15\u0E32\u0E0A\u0E31\u0E48\u0E27\u0E04\u0E23\u0E32\u0E27 (30 \u0E04\u0E33\u0E02\u0E2D/\u0E19\u0E32\u0E17\u0E35 \u0E15\u0E48\u0E2D IP \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35) \u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E2D\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48",errGeneric:"\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E42\u0E21\u0E40\u0E14\u0E25\u0E44\u0E14\u0E49\u0E43\u0E19\u0E02\u0E13\u0E30\u0E19\u0E35\u0E49 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",disclaimer:"\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E40\u0E1B\u0E47\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D\u0E0A\u0E48\u0E27\u0E22\u0E15\u0E31\u0E14\u0E2A\u0E34\u0E19\u0E43\u0E08 \u0E21\u0E34\u0E43\u0E0A\u0E48\u0E04\u0E33\u0E1B\u0E23\u0E36\u0E01\u0E29\u0E32\u0E17\u0E32\u0E07\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22 \u0E42\u0E1B\u0E23\u0E14\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07\u0E01\u0E31\u0E1A\u0E15\u0E31\u0E27\u0E1A\u0E17\u0E09\u0E1A\u0E31\u0E1A\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E17\u0E38\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07 \u0E43\u0E0A\u0E49\u0E1F\u0E23\u0E35\u0E14\u0E49\u0E27\u0E22 iApp API key \u0E16\u0E36\u0E07 30 \u0E01.\u0E22. 2569 \u0E2B\u0E25\u0E31\u0E07\u0E08\u0E32\u0E01\u0E19\u0E31\u0E49\u0E19\u0E04\u0E34\u0E14\u0E23\u0E32\u0E04\u0E32\u0E21\u0E32\u0E15\u0E23\u0E10\u0E32\u0E19 0.01/0.02 IC \u0E15\u0E48\u0E2D 1\u0E1E\u0E31\u0E19\u0E42\u0E17\u0E40\u0E04\u0E19 \u0E40\u0E02\u0E49\u0E32/\u0E2D\u0E2D\u0E01 (\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A Thanoy Legal AI)"},zh:{title:"\u5728\u7EBF\u8BD5\u7528 OpenThai 2.0 Legal",sub:"\u4F7F\u7528\u4F60\u7684 iApp API \u5BC6\u94A5\u5373\u53EF\u514D\u8D39\u8C03\u7528\uFF0C\u81F3 2026 \u5E74 9 \u6708 30 \u65E5\u3002",free:"\u514D\u8D39 API \xb7 1 \u4E2A\u6708",ragO
1nTitle:"\u5DF2\u8FDE\u63A5 RAG \u2014 \u56DE\u7B54\u57FA\u4E8E\u771F\u5B9E\u6CD5\u6761\u539F\u6587",ragOnBody:'\u672C API \u4ECE\u8986\u76D6 39 \u90E8\u6CF0\u56FD\u6CD5\u5F8B\u30016,300+ \u6761\u6587\u7684\u8BED\u6599\u5E93\u4E2D\u6DF7\u5408\u68C0\u7D22\uFF08BM25 + \u5411\u91CF\u68C0\u7D22 + \u91CD\u6392\u5668\uFF09\uFF0C\u4F7F\u56DE\u7B54\u4EE5\u73B0\u884C\u6CD5\u6761\u539F\u6587\u4E3A\u4F9D\u636E\u3002\u7CFB\u7EDF\u9009\u4E2D\u7684\u6761\u6587\u4F1A\u663E\u793A\u5728\u6BCF\u4E2A\u56DE\u7B54\u4E0B\u65B9\u3002\u5207\u6362\u5230"\u95ED\u5377"\u6A21\u5F0F\uFF08API \u4E2D rag: false\uFF09\u53EF\u4E0E\u88F8\u6A21\u578B\u5BF9\u6BD4\u3002',apiKey:"\u4F60\u7684 iApp API \u5BC6\u94A5",apiKeyPlaceholder:"\u7C98\u8D34\u4F60\u7684 API \u5BC6\u94A5\u2026",getKey:"\u8FD8\u6CA1\u6709\u5BC6\u94A5\uFF1F\u514D\u8D39\u6CE8\u518C \u2192",errAuth:'API \u5BC6\u94A5\u65E0\u6548\u6216\u7F3A\u5931\u3002\u8BF7\u5148\u5728 iapp.co.th \u514D\u8D39\u6CE8\u518C\uFF0C\u7136\u540E\u5728\u63A7\u5236\u53F0"API Keys"\u4E2D\u521B\u5EFA\u5BC6\u94A5\u3002',modes:{closedbook:"\u95ED\u5377\uFF08\u65E0 RAG\uFF09",rag:"\u5F15\u7528 + RAG",essay:"\u6CD5\u5F8B\u8BBA\u8FF0 + RAG"},hints:{closedbook:"rag: false\u2014\u2014\u4E0D\u68C0\u7D22\uFF0C\u6A21\u578B\u4EC5\u51ED\u8BB0\u5FC6\u4F5C\u7B54\u3002\u4FDD\u7559\u4F5C\u5BF9\u6BD4\u6A21\u5F0F\u3002",rag:"\u670D\u52A1\u7AEF\u81EA\u52A8\u68C0\u7D22\u76F8\u5173\u6CD5\u6761\uFF0C\u6A21\u578B\u4EC5\u4F9D\u636E\u68C0\u7D22\u7ED3\u679C\u5F15\u7528\u4F5C\u7B54\uFF08JSON\uFF09\u3002\u68C0\u7D22\u5230\u7684\u6761\u6587\u663E\u793A\u5728\u56DE\u7B54\u4E0B\u65B9\u3002",essay:"\u6210\u7BC7\u7684\u6CD5\u5F8B\u5206\u6790\uFF0C\u884C\u6587\u4E2D\u5F15\u7528\u6761\u6587\u2014\u2014\u4EE5\u81EA\u52A8\u68C0\u7D22\u7684\u73B0\u884C\u6CD5\u6761\u539F\u6587\u4E3A\u4F9D\u636E\u3002"},question:"\u95EE\u9898\uFF08\u6CF0\u8BED\uFF09",run:"\u5411\u6A21\u578B\u63D0\u95EE",running:"\u601D\u8003\u4E2D\u2026",thinking:"\u663E\u793A\u63A8\u7406\u8FC7\u7A0B\uFF08\u8F83\u6162\uFF09",streamToggle:"\u6D41\u5F0F\u8F93\u51FA\uFF08SSE\uFF09",devTitle:"\u5F00\u53D1\u8005\u89C6\u56FE\u2014\u2014\u672C\u6F14\u793A\u80CC\u540E\u7684 API \u8C03\u7528",devHint:"\u4E0B\u9762\u7684 curl \u547D\u4EE4\u4F1A\u968F\u4F60\u5728\u4E0A\u65B9\u4FEE\u6539\u95EE\u9898\u3001\u6A21\u5F0F\u4E0E\u9009\u9879\u800C\u5B9E\u65F6\u66F4\u65B0\u3002\u590D\u5236\u5230\u7EC8\u7AEF\u3001\u6362\u4E0A\u4F60\u7684 API \u5BC6\u94A5\u5373\u53EF\u8FD0\u884C\u2014\u2014\u4E0E\u672C\u9875\u9762\u53D1\u9001\u7684\u8BF7\u6C42\u5B8C\u5168\u4E00\u81F4\u3002",devRequest:"\u8BF7\u6C42\uFF08curl\uFF09",devResponse:"\u54CD\u5E94\uFF08JSON\uFF09",devResponseSse:"\u54CD\u5E94\uFF08SSE \u6D41\uFF09",devCopy:"\u590D\u5236\uFF08\u542B\u6211\u7684\u5BC6\u94A5\uFF09",devCopied:"\u2713 \u5DF2\u590D\u5236",thinkNote:"\u6CE8\u610F\uFF1A\u5F15\u7528\u6A21\u5F0F\u662F\u5728\u5173\u95ED\u63A8\u7406\u7684\u6761\u4EF6\u4E0B\u8C03\u4F18\u7684\uFF0C\u5F00\u542F\u540E\u53EF\u80FD\u6539\u53D8\u6A21\u578B\u5F15\u7528\u7684\u6761\u6587\u3002",answer:"\u56DE\u7B54",citations:"\u5F15\u7528",reasoning:"\u6A21\u578B\u63A8\u7406",retrieved:e=>`\u{68C0}\u{7D22}\u{5230}\u{7684}\u{6CD5}\u{6761}\u{FF08}${e} \u{6761}\u{FF09}\u{2014} RAG \u{6B65}\u{9AA4}`,retrievedHint:"\u56DE\u7B54\u4F9D\u636E\uFF1A\u670D\u52A1\u7AEF\u5BF9\u6CD5\u6761\u8BED\u6599\u5E93\u505A\u6DF7\u5408\u68C0\u7D22\uFF08BM25 + \u5411\u91CF\uFF09\uFF0C\u7ECF\u91CD\u6392\u5668\u6392\u5E8F\u540E\u5C06\u8FD9\u4E9B\u6761\u6587\u63D0\u4F9B\u7ED9\u6A21\u578B\u3002\u5206\u6570 = \u91CD\u6392\u5668\u76F8\u5173\u5EA6\u3002",tokens:(e,n)=>`token\u{FF1A}\u{8F93}\u{5165} ${e} / \u{8F93}\u{51FA} ${n}`,latency:e=>`\u{8017}\u{65F6}\u{FF1A}${e} \u{79D2}`,tryOne:"\u8BD5\u8BD5\u793A\u4F8B\uFF1A",errRate:"\u5DF2\u8FBE\u514D\u8D39\u989D\u5EA6\u9650\u5236\uFF08\u6BCF IP \u6BCF\u5206\u949F 30 \u6B21\uFF09\u3002\u8BF7\u7A0D\u5019\u91CD\u8BD5\u3002",errGeneric:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u7AEF\u70B9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",disclaimer:"\u8F93\u51FA\u4EC5\u4E3A\u51B3\u7B56\u8F85\u52A9\uFF0C\u5E76\u975E\u6CD5\u5F8B\u610F\u89C1\uFF1B\u8BF7\u5BF9\u7167\u73B0\u884C\u6CD5\u5F8B\u6838\u9A8C\u6BCF\u5904\u5F15\u7528\u3002\u6301 iApp API \u5BC6\u94A5\u514D\u8D39\u4F7F\u7528\u81F3 2026-09-30\uFF0C\u4E4B\u540E\u6309\u
16807\u51C6\u4EF7 0.01/0.02 IC / 1K \u8F93\u5165/\u8F93\u51FA token \u8BA1\u8D39\uFF08\u4E0E Thanoy Legal AI \u76F8\u540C\uFF09\u3002"}};function x(e,n){let t=null,s=e||"",i=s.match(/<think>([\s\S]*?)<\/think>/);if(i)t=i[1].trim(),s=s.replace(i[0],"").trim();else if(s.includes("</think>")){let e=s.indexOf("</think>");t=s.slice(0,e).replace(/^<think>/,"").trim(),s=s.slice(e+8).trim()}else s.includes("<think>")&&(t=s.slice(s.indexOf("<think>")+7).trim(),s="");if(n)try{let e=s.match(/\{[\s\S]*\}/);if(e){let n=JSON.parse(e[0]);if(n&&n.answer)return{answer:n.answer,citations:n.citations||[],think:t}}}catch(e){}return{answer:s.trim(),citations:null,think:t}}function j({locale:e="en"}){let n=g[e]||g.en,[t,c]=(0,s.useState)("essay"),[h,j]=(0,s.useState)(()=>{if("undefined"==typeof window)return"";try{return window.localStorage.getItem("iapp_demo_apikey")||""}catch(e){return""}}),[y,w]=(0,s.useState)(m.essay.presets[0]),[f,v]=(0,s.useState)(m.essay.thinkDefault),[b,k]=(0,s.useState)(!0),[A,N]=(0,s.useState)(!1),[T,I]=(0,s.useState)(null),[_,S]=(0,s.useState)(null),[O,P]=(0,s.useState)(null),[R,C]=(0,s.useState)(!1),L=m[t],B=()=>({model:"openthai2.0-legal",rag:L.rag,...L.ragInject?{rag_inject:L.ragInject}:{},messages:[{role:"system",content:L.system},{role:"user",content:y}],temperature:L.temperature,top_p:L.top_p,max_tokens:L.max_tokens,...f?{chat_template_kwargs:{enable_thinking:!0}}:{},...b?{stream:!0,stream_options:{include_usage:!0}}:{}}),G=e=>{let n=h.trim(),t=n?e?`${n.slice(0,6)}\u{2022}\u{2022}\u{2022}\u{2022}\u{2022}\u{2022}\u{2022}\u{2022}`:n:"YOUR_IAPP_API_KEY";return`curl -s ${u()}/v3/llm/openthai2p0-legal/chat/completions \\
2  -H "Content-Type: application/json" \\
3  -H "apikey: ${t}" \\
4  -d '${JSON.stringify(B(),null,2).replace(/'/g,"'\\''")}'`},M=async()=>{if(A||!y.trim())return;if(!h.trim())return void S(n.errAuth);N(!0),I(null),S(null),P(null);let e=Date.now();try{let t=await fetch(`${u()}/v3/llm/openthai2p0-legal/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",apikey:h.trim()},body:JSON.stringify(B())});if(401===t.status||403===t.status){S(n.errAuth),P({status:t.status,ms:Date.now()-e,raw:await t.text()});return}if(429===t.status){S(n.errRate),P({status:429,ms:Date.now()-e,raw:await t.text()});return}if(!t.ok)throw Error(`HTTP ${t.status}`);if(b&&t.body){let n=t.body.getReader(),s=new TextDecoder,i="",r="",a=[],l=null,o=[];for(;;){let{done:t,value:d}=await n.read();if(t)break;let c=(i+=s.decode(d,{stream:!0})).split("\n\n");for(let e of(i=c.pop(),c)){let n,t=e.trim();if(!t.startsWith("data: "))continue;o.push(t);let s=t.slice(6);if("[DONE]"===s)continue;try{n=JSON.parse(s)}catch(e){continue}!a.length&&Array.isArray(n.retrieved_documents)&&(a=n.retrieved_documents);let i=n.choices?.[0]?.delta?.content;i&&(r+=i),n.usage&&(l=n.usage)}I({...x(r,!1),docs:a,usage:l,partial:!0,seconds:((Date.now()-e)/1e3).toFixed(1)})}if(!r)throw Error("empty response");I({...x(r,L.json),docs:a,usage:l,seconds:((Date.now()-e)/1e3).toFixed(1)});let d=o.length<=12?o:[...o.slice(0,4),`\u{2026} ${o.length-10} more events \u{2026}`,...o.slice(-6)];P({status:t.status,ms:Date.now()-e,raw:d.join("\n"),sse:!0})}else{let n=await t.json(),s=n.choices?.[0]?.message?.content;if(!s)throw Error("empty response");let i=x(s,L.json);I({...i,docs:Array.isArray(n.retrieved_documents)?n.retrieved_documents:[],usage:n.usage,seconds:((Date.now()-e)/1e3).toFixed(1)});let r=JSON.parse(JSON.stringify(n));Array.isArray(r.retrieved_documents)&&(r.retrieved_documents=r.retrieved_documents.map(e=>({...e,text:e.text&&e.text.length>160?e.text.slice(0,160)+"\u2026":e.text}))),P({status:t.status,ms:Date.now()-e,raw:JSON.stringify(r,null,2)})}}catch(e){S(n.errGeneric)}finally{N(!1)}};return(0,d.jsxs)("div",{className:"demo_nLmZ",children:[(0,d.jsxs)("div",{className:"header_TQe5",children:[(0,d.jsx)("p",{className:"headerTitle_hPqO",children:n.title}),(0,d.jsx)("span",{className:"freeBadge_Jryk",children:n.free}),(0,d.jsx)("p",{className:"headerSub_RvUb",children:n.sub})]}),(0,d.jsxs)("div",{className:"body_z92t",children:[(0,d.jsxs)("div",{className:"ragOn_rM1P",children:[(0,d.jsx)("span",{className:"ragOnIcon_SiX0",children:"\u{1F4DA}"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("strong",{children:n.ragOnTitle}),(0,d.jsx)("p",{children:n.ragOnBody})]})]}),(0,d.jsx)("div",{className:"tabs_t6at",children:Object.keys(m).map(e=>(0,d.jsx)("button",{type:"button",className:e===t?"tabActive_Ku3U tab_oe73":"tab_oe73",onClick:()=>{c(e),w(m[e].presets[0]),v(m[e].thinkDefault),I(null),S(null)},children:n.modes[e]},e))}),(0,d.jsx)("p",{className:"modeHint_XhcQ",children:n.hints[t]}),(0,d.jsx)("label",{className:"label_JP4W",children:n.question}),(0,d.jsx)("textarea",{className:"textarea_GPM4",value:y,onChange:e=>w(e.target.value),rows:3}),(0,d.jsxs)("div",{className:"presets_FFDC",children:[(0,d.jsx)("span",{style:{fontSize:"0.75rem",alignSelf:"center",color:"var(--ifm-color-emphasis-500)"},children:n.tryOne}),L.presets.map(e=>(0,d.jsx)("button",{type:"button",className:"preset_jD8h",onClick:()=>w(e),children:e.length>60?e.slice(0,58)+"\u2026":e},e))]}),(0,d.jsx)("div",{className:"keySelector_ubAJ",children:(0,d.jsx)(i.Z,{value:h,onChange:e=>{j(e);try{window.localStorage.setItem("iapp_demo_apikey",e)}catch(e){}}})}),(0,d.jsxs)("div",{className:"controls_gxJl",children:[(0,d.jsx)("button",{type:"button",className:"runBtn_K7wQ",onClick:M,disabled:A,children:A?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"spinner__UXW"}),n.running]}):n.run}),(0,d.jsxs)("label",{className:r,children:[(0,d.jsx)("input",{type:"checkbox",checked:f,onChange:e=>v(e.target.checked)}),n.thinking]}),(0,d.jsxs)("label",{className:r,children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:e=>k(e.target.checked)}),n.streamToggle]})]}),f&&L.json&&(0,d.jsx)("p",{className:"thinkNote_Yt2m",children:n.thinkNote}),_&&(0,d.jsx)("div",{className:"error_Q86k",children:_}),T&&(0,d.jsxs)("div",{className:"result_rsUo",children:[T.docs&&T.docs.length>0&&(0,d.jsxs)("details",{className:"docPanel_SrTZ",open:!0,children:[(0,d.jsxs)("summary",{className:"docSummary_Nf0j",children:["\u{1F4DA} ",n.retrieved(T.docs.length)]}),(0,d.jsx)("p",{className:"docHint_Nt_R",children:n.retrievedHint}),(0,d.jsx)("div",{className:"docList_Pa5H",children:T.docs.map((e,n)=>(0,d.jsxs)("details",{className:"docItem_RSdJ",children:[(0,d.jsxs)("summary",{className:"docHead_EvLS",children:[(0,d.jsxs)("span",{className:"docLaw_EVe2",children:[e.law," \xb7 \u0E21\u0E32\u0E15\u0E23\u0E32 ",e.section]}),(0,d.jsxs)("span",{className:"docScoreWrap_NMvG",children:[(0,d.jsx)("span",{className:"docScoreBar_H3zA",style:{width:`${Math.round(100*Math.max(.04,e.score))}%`}}),(0,d.jsx)("span",{className:"docScoreVal_hq8A",children:e.score.toFixed(2)})]})]}),(0,d.jsx)("p",{className:"docText_W3FF",children:e.text})]},n))})]}),(0,d.jsx)("div",{className:a,children:n.answer}),(0,d.jsx)(p,{text:T.answer,className:"answer_GhsY"}),T.citations&&T.citations.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:a,style:{marginTop:"0.8rem"},children:n.citations}),(0,d.jsx)("div",{className:"citations_Lwlc",children:T.citations.map((e,n)=>(0,d.jsxs)("span",{className:"citation_z5SV",children:[e.law," \xb7 \u0E21\u0E32\u0E15\u0E23\u0E32 ",e.section]}
4,n))})]}),T.think&&(0,d.jsxs)("details",{className:"thinkBox_XOhq",children:[(0,d.jsxs)("summary",{className:"thinkSummary_xYko",children:["\u{1F9E0} ",n.reasoning]}),(0,d.jsx)("div",{className:"thinkContent_fXGb",children:(0,d.jsx)(p,{text:T.think})})]}),(0,d.jsxs)("div",{className:"meta_ukJO",children:[T.usage&&(0,d.jsx)("span",{children:n.tokens(T.usage.prompt_tokens,T.usage.completion_tokens)}),(0,d.jsx)("span",{children:n.latency(T.seconds)}),(0,d.jsxs)("span",{children:["openthai2.0-legal \xb7 30B A3B",T.partial?" \xb7 \u23F3":""]})]})]}),(0,d.jsxs)("details",{className:"devPanel_H2y4",children:[(0,d.jsxs)("summary",{className:"devSummary_e8yX",children:["\u{1F9D1}\u200D\u{1F4BB} ",n.devTitle]}),(0,d.jsx)("p",{className:"devHint_bgC_",children:n.devHint}),(0,d.jsxs)("div",{className:l,children:[(0,d.jsx)("span",{children:n.devRequest}),(0,d.jsx)("button",{type:"button",className:"devCopy_WpvD",onClick:()=>{try{navigator.clipboard.writeText(G(!1)),C(!0),setTimeout(()=>C(!1),1500)}catch(e){}},children:R?n.devCopied:n.devCopy})]}),(0,d.jsx)("pre",{className:o,children:G(!0)}),O&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:l,children:(0,d.jsxs)("span",{children:[O.sse?n.devResponseSse:n.devResponse," \xb7 HTTP ",O.status," \xb7"," ",(O.ms/1e3).toFixed(1),"s"]})}),(0,d.jsx)("pre",{className:o,children:O.raw})]})]}),(0,d.jsx)("p",{className:"disclaimer_iU3Z",children:n.disclaimer})]})]})}},70921:function(e,n,t){t.d(n,{A:()=>s});let s=t.p+"assets/images/benchmark-scoreboard-f448ab187b46e501522075ee8516daf0.webp"},78899:function(e,n,t){t.d(n,{A:()=>s});let s=t.p+"assets/images/launch-hero-en-8805a78303d70ac6a8eb087213ac303c.webp"},92472:function(e,n,t){t.d(n,{A:()=>s});let s=t.p+"assets/images/training-pipeline-8668d70d6f5dd5b20253551c29c21e31.webp"},84429:function(e,n,t){t.d(n,{R:()=>a,x:()=>l});var s=t(96540);let i={},r=s.createContext(i);function a(e){let n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.