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-r1-32b| SkyThought | OpenThaiGPT R1 32b | DeepSeek R1 70b | Typhoon R1 Distill 70b |
|---|---|---|---|
| AIME24-TH | 56.67 | 33.33 | 53.33 |
| AIME24 | 63.36 | 53.33 | 53.33 |
| MATH500-TH | 83.8 | 75.4 | 81 |
| MATH500 | 89.4 | 88.88 | 90.2 |
| LiveCodeBench-TH | 62.16 | 53.15 | 47.75 |
| LiveCodeBench | 69.67 | 64.97 | 54.79 |
| OpenThaiEval | 76.05 | 74.17 | 77.59 |
| AVERAGE | 71.58 | 63.31 | 65.42 |
<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-r1-32b-instruct"
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 = "จงหาพื้นที่ของวงกลมที่มีรัศมี 7 หน่วย"
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-r1-32b --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-r1-32b-instruct",
5 "messages": [
6 {
7 "role": "user",
8 "content": "จงหาพื้นที่ของวงกลมที่มีรัศมี 7 หน่วย"
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) |
|---|---|---|---|
| 32b | 64 GB | 32 GB | 16 GB |
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>'}}{% endif %}
