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
Add files using upload-large-folder tool
Browse files- README.md +18 -3
- provenance.json +1 -1
- release_manifest.json +4 -4
README.md
CHANGED
|
@@ -141,7 +141,10 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 141 |
)
|
| 142 |
|
| 143 |
messages = [
|
| 144 |
-
{
|
|
|
|
|
|
|
|
|
|
| 145 |
]
|
| 146 |
inputs = tokenizer.apply_chat_template(
|
| 147 |
messages,
|
|
@@ -152,6 +155,15 @@ outputs = model.generate(inputs, generation_config=model.generation_config)
|
|
| 152 |
print(tokenizer.decode(outputs[0, inputs.shape[-1]:], skip_special_tokens=True))
|
| 153 |
```
|
| 154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
To load the original MedApp checkpoint, use `revision="v1.0.0"`.
|
| 156 |
|
| 157 |
## Serving with vLLM
|
|
@@ -167,8 +179,11 @@ vllm serve ThaiLLM/ThaiLLM-8B-MedApp \
|
|
| 167 |
```
|
| 168 |
|
| 169 |
When `--generation-config vllm` is used, send the stabilized sampling values in
|
| 170 |
-
each request.
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
## Intended use
|
| 174 |
|
|
|
|
| 141 |
)
|
| 142 |
|
| 143 |
messages = [
|
| 144 |
+
{
|
| 145 |
+
"role": "user",
|
| 146 |
+
"content": "ฉันเป็นผู้ใหญ่ ช่วงนี้นอนไม่ค่อยหลับ ควรเริ่มดูแลตัวเองอย่างไร",
|
| 147 |
+
},
|
| 148 |
]
|
| 149 |
inputs = tokenizer.apply_chat_template(
|
| 150 |
messages,
|
|
|
|
| 155 |
print(tokenizer.decode(outputs[0, inputs.shape[-1]:], skip_special_tokens=True))
|
| 156 |
```
|
| 157 |
|
| 158 |
+
This basic Transformers example demonstrates conversation only. For structured
|
| 159 |
+
tool calling, serve the model with an OpenAI-compatible endpoint and provide
|
| 160 |
+
the request's JSON tool schema. When a request contains a relative time such as
|
| 161 |
+
"tomorrow," the application must either provide a trusted current datetime
|
| 162 |
+
and timezone or resolve the request to an explicit timezone-aware datetime
|
| 163 |
+
before calling the model. Never execute a guessed or stale timestamp. Require
|
| 164 |
+
RFC 3339 with a numeric UTC offset, validate the tool name and arguments
|
| 165 |
+
against the schema, and obtain user authorization before execution.
|
| 166 |
+
|
| 167 |
To load the original MedApp checkpoint, use `revision="v1.0.0"`.
|
| 168 |
|
| 169 |
## Serving with vLLM
|
|
|
|
| 179 |
```
|
| 180 |
|
| 181 |
When `--generation-config vllm` is used, send the stabilized sampling values in
|
| 182 |
+
each request. For relative dates and times, supply a trusted current datetime
|
| 183 |
+
and timezone or request clarification; require a timezone-aware RFC 3339 value
|
| 184 |
+
before execution. Validate tool names and arguments against your schema, obtain
|
| 185 |
+
any required user authorization, reject stale or guessed timestamps, and make
|
| 186 |
+
tool execution idempotent where possible.
|
| 187 |
|
| 188 |
## Intended use
|
| 189 |
|
provenance.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"created_at": "2026-08-
|
| 3 |
"evaluation_binding": {
|
| 4 |
"note": "Historical evaluation manifests recorded the selected model path but did not hash its weight files. This release manifest is the first content-addressed fingerprint of that selected output.",
|
| 5 |
"release_manifest_created_after_evaluation": true,
|
|
|
|
| 1 |
{
|
| 2 |
+
"created_at": "2026-08-12T11:44:16.000183+00:00",
|
| 3 |
"evaluation_binding": {
|
| 4 |
"note": "Historical evaluation manifests recorded the selected model path but did not hash its weight files. This release manifest is the first content-addressed fingerprint of that selected output.",
|
| 5 |
"release_manifest_created_after_evaluation": true,
|
release_manifest.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"baseline_main_sha": "95e93ca22bf8fdc4d7124872615c1d5df002dfa4",
|
| 3 |
-
"created_at": "2026-08-
|
| 4 |
"files": [
|
| 5 |
{
|
| 6 |
"path": "README.md",
|
| 7 |
-
"sha256": "
|
| 8 |
-
"size":
|
| 9 |
},
|
| 10 |
{
|
| 11 |
"path": "added_tokens.json",
|
|
@@ -69,7 +69,7 @@
|
|
| 69 |
},
|
| 70 |
{
|
| 71 |
"path": "provenance.json",
|
| 72 |
-
"sha256": "
|
| 73 |
"size": 1454
|
| 74 |
},
|
| 75 |
{
|
|
|
|
| 1 |
{
|
| 2 |
"baseline_main_sha": "95e93ca22bf8fdc4d7124872615c1d5df002dfa4",
|
| 3 |
+
"created_at": "2026-08-12T11:44:43.025697+00:00",
|
| 4 |
"files": [
|
| 5 |
{
|
| 6 |
"path": "README.md",
|
| 7 |
+
"sha256": "6aaa0ed6bbc9c42dfdc7f984b806c141a6575e1e88a8182087ec245b4642a790",
|
| 8 |
+
"size": 9297
|
| 9 |
},
|
| 10 |
{
|
| 11 |
"path": "added_tokens.json",
|
|
|
|
| 69 |
},
|
| 70 |
{
|
| 71 |
"path": "provenance.json",
|
| 72 |
+
"sha256": "153dfb05cf67839cc1c26a4ded92b94995ce654a6a681bec88c67dc678575195",
|
| 73 |
"size": 1454
|
| 74 |
},
|
| 75 |
{
|