Sailor2: Sailing in South-East Asia with Inclusive Multilingual LLMs
Paper • 2502.12982 • Published • 19
How to use junwatu/candi-sailor2-8b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="junwatu/candi-sailor2-8b")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("junwatu/candi-sailor2-8b")
model = AutoModelForMultimodalLM.from_pretrained("junwatu/candi-sailor2-8b")
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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use junwatu/candi-sailor2-8b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "junwatu/candi-sailor2-8b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "junwatu/candi-sailor2-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/junwatu/candi-sailor2-8b
How to use junwatu/candi-sailor2-8b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "junwatu/candi-sailor2-8b" \
--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": "junwatu/candi-sailor2-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "junwatu/candi-sailor2-8b" \
--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": "junwatu/candi-sailor2-8b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use junwatu/candi-sailor2-8b with Docker Model Runner:
docker model run hf.co/junwatu/candi-sailor2-8b
Fine-tuned version of sail/Sailor2-8B for Indonesian cultural heritage, especially temples (candi).
| Parameter | Value |
|---|---|
| Learning rate | 2e-4 |
| Batch size | 1 × 8 gradient accumulation |
| Max seq length | 2048 |
| Quantization | 4-bit NF4 (training) |
| Optimizer | paged_adamw_8bit |
| Scheduler | cosine with warmup |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"junwatu/candi-sailor2-8b",
torch_dtype="auto",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("junwatu/candi-sailor2-8b")
messages = [{"role": "user", "content": "Apa itu Candi Borobudur?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.9)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
The LoRA adapter is also available separately: junwatu/candi-sailor2-8b-lora
Apache 2.0 (same as base model)
@misc{junwatu2026candi,
title={Candi Sailor2: Fine-tuned Model for Indonesian Cultural Heritage},
author={junwatu},
year={2026},
publisher={HuggingFace},
url={https://huggingface.co/junwatu/candi-sailor2-8b}
}
@article{sailor2,
title={Sailor2: Advancing Multilingual Large Language Models for Southeast Asian Languages},
author={Sea AI Lab},
journal={arXiv preprint arXiv:2502.12982},
year={2025}
}