Views
No views yet

📢 OpenThaiGPT is now OpenThai
The project was renamed in July 2026. Released models keep their original names, and this repository path is unchanged and permanent. → openthai.aieat.or.th
| Need | Model |
|---|---|
| ⚖️ Thai law, statute citation, legal RAG | OpenThai 2.0 Legal 30B-A3B ← newest |
| 🧠 Reasoning, maths, logic, code | OpenThaiGPT R1 32B |
| 💬 General Thai chat and coding | OpenThaiGPT 1.6 72B |
| 💻 Limited GPU | OpenThaiGPT 1.5 7B |
ollama run openthai/openthai-1.6-72b| Benchmarks | OpenThaiGPT 1.6 72b | OpenThaiGPT 1.5 7b | OpenThaiGPT 1.5 14b | OpenThaiGPT 1.5 72b | Typhoon2 Qwen2.5 7b | Typhoon2 Llama3.1 8b | Typhoon2 Llama3.1 70b | NECTEC Pathumma LLM Text 1.0.0 7b |
|---|---|---|---|---|---|---|---|---|
| AIME24-TH | 6.67 | 0 | 0 | 6.67 | 3.33 | 3.33 | 13.33 | 0 |
| AIME24 | 23.33 | 6.67 | 10 | 23.33 | 6.67 | 3.33 | 10 | 0 |
| MATH500-TH | 43.2 | 24.2 | 26.2 | 62 | 51.8 | 31 | 55.8 | 21.8 |
| MATH500 | 82 | 40.4 | 47.4 | 83.2 | 65.4 | 49.6 | 67.4 | 42.8 |
| LiveCodeBench-TH | 32.43 | 22.52 | 21.62 | 12.61 | 9.91 | 8.11 | 27.03 | 0 |
| LiveCodeBench | 54.21 | 31.12 | 37.96 | 46.38 | 0.98 | 5.87 | 37.38 | 0 |
| OpenThaiEval | 78.7 | 64.5 | 71.26 | 77.16 | 64.76 | 56.63 | 72.54 | 65.27 |
| Language Accuracy | 98.2 | 97.6 | 98.4 | 99.4 | 99.4 | 98.6 | 99.8 | 98.6 |
| AVERAGE | 52.34 | 35.88 | 39.11 | 51.34 | 37.78 | 32.06 | 47.91 | 28.56 |
<No system prompt>1@misc{yuenyong2025openthaigpt16r1thaicentric,
2 title={OpenThaiGPT 1.6 and R1: Thai-Centric Open Source and Reasoning Large Language Models},
3 author={Sumeth Yuenyong and Thodsaporn Chay-intr and Kobkrit Viriyayudhakorn},
4 year={2025},
5 eprint={2504.01789},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2504.01789},
9}1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "openthaigpt/openthaigpt-1.6-72b"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12prompt = "กรุงเทพมหานครคืออะไร"
13messages = [
14 {"role": "user", "content": prompt}
15]
16text = tokenizer.apply_chat_template(
17 messages,
18 tokenize=False,
19 add_generation_prompt=True
20)
21model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
22
23generated_ids = model.generate(
24 **model_inputs,
25 max_new_tokens=16384,
26 temperature=0.6
27)
28generated_ids = [
29 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
30]
31
32response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]vllm serve openthaigpt/openthaigpt-1.6-72b --tensor-parallel-size 2--tensor-parallel-size 2 to the amount of available GPU cards.1curl -X POST 'http://127.0.0.1:8000/v1/chat/completions' \
2-H 'Content-Type: application/json' \
3-d '{
4 "model": "openthaigpt/openthaigpt-1.6-72b",
5 "messages": [
6 {
7 "role": "user",
8 "content": "กรุงเทพมหานครคืออะไร"
9 }
10 ],
11 "max_tokens": 16384,
12 "temperature": 0.6,
13 "top_p": 0.95,
14 "top_k": 40
15}'| Number of Parameters | FP 16 bits | 8 bits (Quantized) | 4 bits (Quantized) |
|---|---|---|---|
| 72b | 144 GB | 72 GB | 36 GB |
{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n
