--- license: other license_name: qwen language: - th - en library_name: transformers pipeline_tag: text-generation tags: - openthaigpt - qwen - reasoning model-index: - name: OpenThaiGPT-1.6-72b results: - task: type: reasoning dataset: name: SkyThought type: mathematical_reasoning metrics: - name: OpenThaiGPT type: accuracy value: 78.7 - name: AIME24 type: accuracy value: 23.33 source: name: ðŸ‡đ🇭 OpenThaiGPT Benchmark url: https://openthaigpt.aieat.or.th/ --- # ðŸ‡đ🇭 OpenThaiGPT 1.6 72b ![OpenThaiGPT](https://cdn-uploads.huggingface.co/production/uploads/5fcd9c426d942eaf4d1ebd30/tByCXPW7JG3krRcTn1IlN.png) [More Info](https://openthaigpt.aieat.or.th/) ðŸ‡đ🇭 **OpenThaiGPT 1.6 72b** is a 72-billion-parameter Thai language model designed for general purpose tasks with strong reasoning capabilities. Building upon the foundation of OpenThaiGPT 1.5, this latest version demonstrates improved performance across a variety of benchmarks, particularly in code reasoning and general language tasks. ## Highlights - **Advanced Thai language model** with 72 billion parameters - **Strong reasoning capabilities** in both Thai and English - **Improved performance** over previous OpenThaiGPT versions - **Balanced capabilities** across mathematical, coding, and general language tasks - **Enhanced understanding** of Thai language and cultural context ## Benchmark Results | **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 | ## Recommended System Prompt ``` ``` ## Model Technical Report https://arxiv.org/abs/2504.01789 If OpenThaiGPT has been beneficial for your work, kindly consider citing it as follows: ```tex @misc{yuenyong2025openthaigpt16r1thaicentric, title={OpenThaiGPT 1.6 and R1: Thai-Centric Open Source and Reasoning Large Language Models}, author={Sumeth Yuenyong and Thodsaporn Chay-intr and Kobkrit Viriyayudhakorn}, year={2025}, eprint={2504.01789}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2504.01789}, } ``` ## How to use ### Online Web Interface https://chindax.iapp.co.th ### Transformers ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "openthaigpt/openthaigpt-1.6-72b" model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained(model_name) prompt = "āļāļĢāļļāļ‡āđ€āļ—āļžāļĄāļŦāļēāļ™āļ„āļĢāļ„āļ·āļ­āļ­āļ°āđ„āļĢ" messages = [ {"role": "user", "content": prompt} ] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) model_inputs = tokenizer([text], return_tensors="pt").to(model.device) generated_ids = model.generate( **model_inputs, max_new_tokens=16384, temperature=0.6 ) generated_ids = [ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) ] response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] ``` ### vLLM 1. Install VLLM (https://github.com/vllm-project/vllm) 2. Run server ```bash vllm serve openthaigpt/openthaigpt-1.6-72b --tensor-parallel-size 2 ``` * Note, change `--tensor-parallel-size 2` to the amount of available GPU cards. 3. Run inference (CURL example) ```bash curl -X POST 'http://127.0.0.1:8000/v1/chat/completions' \ -H 'Content-Type: application/json' \ -d '{ "model": "openthaigpt/openthaigpt-1.6-72b", "messages": [ { "role": "user", "content": "āļāļĢāļļāļ‡āđ€āļ—āļžāļĄāļŦāļēāļ™āļ„āļĢāļ„āļ·āļ­āļ­āļ°āđ„āļĢ" } ], "max_tokens": 16384, "temperature": 0.6, "top_p": 0.95, "top_k": 40 }' ``` ### GPU Memory Requirements | **Number of Parameters** | **FP 16 bits** | **8 bits (Quantized)** | **4 bits (Quantized)** | |------------------|----------------|------------------------|------------------------| | **72b** | 144 GB | 72 GB | 36 GB | ## Chat Template ```python {%- 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 XML tags:\\n\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n\\n\\nFor each function call, return a json object with function name and arguments within XML tags:\\n\\n{\\\"name\\\": , \\\"arguments\\\": }\\n<|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\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n' }}\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\\n' }}\n {{- message.content }}\n {{- '\\n' }}\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 ``` ## Key Improvements in OpenThaiGPT 1.6 72b Compared to OpenThaiGPT 1.5 72b, the 1.6 version shows: - **Significantly better code reasoning** performance in both Thai (LiveCodeBench-TH: 32.43 vs 12.61) and English (LiveCodeBench: 54.21 vs 46.38) - **Comparable general language understanding** with a high language accuracy of 98.2% - **Better balanced capabilities** across mathematical and coding tasks This model maintains strong performance in general language tasks while improving specialized capabilities, making it suitable for a wide range of applications. ## Licenses * This model is available for **Research** and **Commercial uses** under the specified terms. Please see the LICENSE file for more information. ## Supports - Official website: https://openthaigpt.aieat.or.th - Facebook page: https://web.facebook.com/groups/openthaigpt - A Discord server for discussion and support [here](https://discord.gg/rUTp6dfVUF) - E-mail: kobkrit@iapp.co.th ### OpenThaiGPT Team * Kobkrit Viriyayudhakorn (kobkrit@iapp.co.th / kobkrit@aieat.or.th) * Sumeth Yuenyong (sumeth.yue@mahidol.edu) * Thodsaporn Chay-intr (thodsaporn@iapp.co.th) ## Sponsors * āđ„āļ”āđ‰āļĢāļąāļšāļāļēāļĢāļŠāļ™āļąāļšāļŠāļ™āļļāļ™ GPU Nvidia H100 x 8 āđƒāļš āļˆāļēāļāļšāļĢāļīāļĐāļąāļ— āļŠāļĒāļēāļĄ āđ€āļ­āđ„āļ­ āļ„āļ­āļĢāđŒāđ€āļ›āļ­āđ€āļĢāļŠāļąāđˆāļ™ āļˆāļģāļāļąāļ”: https://siam.ai/ * āđ„āļ”āđ‰āļĢāļąāļšāļ—āļļāļ™āļ§āļīāļˆāļąāļĒāļŠāļ™āļąāļšāļŠāļ™āļļāļ™āļˆāļēāļāļāļ­āļ‡āļ—āļļāļ™āļŠāđˆāļ‡āđ€āļŠāļĢāļīāļĄāļ§āļīāļ—āļĒāļēāļĻāļēāļŠāļ•āļĢāđŒ āļ§āļīāļˆāļąāļĒāđāļĨāļ°āļ™āļ§āļąāļ•āļāļĢāļĢāļĄ āđ‚āļ”āļĒāļŦāļ™āđˆāļ§āļĒāļšāļĢāļīāļŦāļēāļĢāđāļĨāļ°āļˆāļąāļ”āļāļēāļĢāļ—āļļāļ™āļ”āđ‰āļēāļ™āļāļēāļĢāđ€āļžāļīāđˆāļĄāļ„āļ§āļēāļĄāļŠāļēāļĄāļēāļĢāļ–āđƒāļ™āļāļēāļĢāđāļ‚āđˆāļ‡āļ‚āļąāļ™āļ‚āļ­āļ‡āļ›āļĢāļ°āđ€āļ—āļĻ (āļšāļžāļ‚.) āļĢāđˆāļ§āļĄāļāļąāļš āļšāļĢāļīāļĐāļąāļ— āđ„āļ­āđāļ­āļžāļžāđŒāđ€āļ—āļ„āđ‚āļ™āđ‚āļĨāļĒāļĩ āļˆāļģāļāļąāļ” āļ‹āļķāđˆāļ‡āļĄāļĩ āļŠāļĄāļēāļ„āļĄāļœāļđāđ‰āļ›āļĢāļ°āļāļ­āļšāļāļēāļĢāļ›āļąāļāļāļēāļ›āļĢāļ°āļ”āļīāļĐāļāđŒāļ›āļĢāļ°āđ€āļ—āļĻāđ„āļ—āļĒ āđ€āļ›āđ‡āļ™āļœāļđāđ‰āļ”āļģāđ€āļ™āļīāļ™āļ‡āļēāļ™āđ‚āļ„āļĢāļ‡āļāļēāļĢ Disclaimer: Provided responses are not guaranteed.