Text Generation
Transformers
Safetensors
Thai
English
qwen3
thai
medical
tool-use
function-calling
Merge
mergekit
v2.0.0
conversational
text-generation-inference
Instructions to use ThaiLLM/ThaiLLM-8B-MedApp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ThaiLLM/ThaiLLM-8B-MedApp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ThaiLLM/ThaiLLM-8B-MedApp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ThaiLLM/ThaiLLM-8B-MedApp") model = AutoModelForCausalLM.from_pretrained("ThaiLLM/ThaiLLM-8B-MedApp", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ThaiLLM/ThaiLLM-8B-MedApp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ThaiLLM/ThaiLLM-8B-MedApp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThaiLLM/ThaiLLM-8B-MedApp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ThaiLLM/ThaiLLM-8B-MedApp
- SGLang
How to use ThaiLLM/ThaiLLM-8B-MedApp with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ThaiLLM/ThaiLLM-8B-MedApp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThaiLLM/ThaiLLM-8B-MedApp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ThaiLLM/ThaiLLM-8B-MedApp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThaiLLM/ThaiLLM-8B-MedApp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ThaiLLM/ThaiLLM-8B-MedApp with Docker Model Runner:
docker model run hf.co/ThaiLLM/ThaiLLM-8B-MedApp
Download evaluation_summary.json from ThaiLLM/ThaiLLM-8B-MedApp: direct link, hf CLI and curl.
- Browser
- Download file 2.82 kB
-
https://huggingface.co/ThaiLLM/ThaiLLM-8B-MedApp/resolve/refs%2Fpr%2F1/evaluation_summary.json
- Command line
-
hf download hf://ThaiLLM/ThaiLLM-8B-MedApp@refs/pr/1/evaluation_summary.json
-
curl -L -o evaluation_summary.json https://huggingface.co/ThaiLLM/ThaiLLM-8B-MedApp/resolve/refs%2Fpr%2F1/evaluation_summary.json
2.82 kB
| { | |
| "release": "v2.0.0", | |
| "official_replication_evaluation_date": "2026-07-27", | |
| "multiturn_diagnostic_date": "2026-08-04", | |
| "official_replication": { | |
| "protocol": "vistec-AI/thaillm-medical-post-training@73772633663dfe02eff558a85eacbac9f617d329", | |
| "med_iq": { | |
| "examples": 200, | |
| "rollouts_per_example": 3, | |
| "judge_model": "deepseek/deepseek-v4-flash", | |
| "v2": { | |
| "format_reward": 1.0, | |
| "citations_reward": 0.6782222222222223, | |
| "response_reward": 0.7583333333333333, | |
| "combined_reward": 1.5365555555555557, | |
| "judge_errors": 0 | |
| }, | |
| "v1": { | |
| "format_reward": 0.9566666666666667, | |
| "citations_reward": 0.6228968253968254, | |
| "response_reward": 0.6316666666666667, | |
| "combined_reward": 1.3502301587301588, | |
| "judge_errors": 0 | |
| } | |
| }, | |
| "tooluse": { | |
| "examples": 5122, | |
| "rollouts_per_example": 3, | |
| "v2": { | |
| "pass_at_1_accuracy": 0.9991539763113367, | |
| "pass_at_1_trigger_f1": 1.0, | |
| "pass_at_1_macro_f1": 0.9939327426620813, | |
| "pass_at_3_accuracy": 0.9994142912924638, | |
| "rollout_errors": 0 | |
| }, | |
| "v1": { | |
| "pass_at_1_accuracy": 0.9035532994923858, | |
| "pass_at_1_trigger_f1": 0.8753987433542773, | |
| "pass_at_1_macro_f1": 0.7829973019437224, | |
| "pass_at_3_accuracy": 0.9478719250292854, | |
| "rollout_errors": 3 | |
| } | |
| } | |
| }, | |
| "multiturn_diagnostic": { | |
| "run_id": "20260804_223124", | |
| "scenarios": 10, | |
| "turns_per_scenario": 8, | |
| "repeats": 2, | |
| "responses_per_profile": 160, | |
| "v1_published_style": { | |
| "flag_rate": 0.46875, | |
| "mean_repeated_12gram_fraction": 0.2005, | |
| "mean_max_previous_similarity": 0.4083, | |
| "length_caps": 61 | |
| }, | |
| "v1_stabilized": { | |
| "flag_rate": 0.33125, | |
| "mean_repeated_12gram_fraction": 0.1153, | |
| "mean_max_previous_similarity": 0.3934, | |
| "length_caps": 36 | |
| }, | |
| "v2_published_style": { | |
| "flag_rate": 0.03125, | |
| "mean_repeated_12gram_fraction": 0.0063, | |
| "mean_max_previous_similarity": 0.302, | |
| "length_caps": 0 | |
| }, | |
| "v2_stabilized": { | |
| "flag_rate": 0.0, | |
| "mean_repeated_12gram_fraction": 0.0078, | |
| "mean_max_previous_similarity": 0.2199, | |
| "length_caps": 0 | |
| } | |
| }, | |
| "caveats": [ | |
| "The official benchmark used the published temperature-0.4 protocol, not the stabilized decoding defaults.", | |
| "The comparison is protocol-aligned; the v1 control did not exactly reproduce every value on the previous public model card.", | |
| "Historical evaluation manifests recorded the selected model path but not a weight-file hash; release staging created the first content-addressed fingerprint of that output.", | |
| "Multi-turn flags are automated degeneration heuristics, not medical-correctness scores." | |
| ] | |
| } | |