Text Generation
Transformers
Safetensors
gemma3
image-text-to-text
conversational
text-generation-inference
Instructions to use aisingapore/Gemma-SEA-LION-v4-27B-IT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aisingapore/Gemma-SEA-LION-v4-27B-IT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("aisingapore/Gemma-SEA-LION-v4-27B-IT") model = AutoModelForMultimodalLM.from_pretrained("aisingapore/Gemma-SEA-LION-v4-27B-IT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aisingapore/Gemma-SEA-LION-v4-27B-IT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aisingapore/Gemma-SEA-LION-v4-27B-IT
- SGLang
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT 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 "aisingapore/Gemma-SEA-LION-v4-27B-IT" \ --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": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "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 "aisingapore/Gemma-SEA-LION-v4-27B-IT" \ --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": "aisingapore/Gemma-SEA-LION-v4-27B-IT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aisingapore/Gemma-SEA-LION-v4-27B-IT with Docker Model Runner:
docker model run hf.co/aisingapore/Gemma-SEA-LION-v4-27B-IT
File size: 12,664 Bytes
6f1fb1c 72ade8b 6f1fb1c 62ce116 9c418e9 15bb0cd 9c418e9 62ce116 9c418e9 62ce116 9c418e9 62ce116 9c418e9 15bb0cd 9c418e9 62ce116 9c418e9 15bb0cd 9c418e9 15bb0cd 9c418e9 15bb0cd 62ce116 15bb0cd 9c418e9 62ce116 9c418e9 62ce116 9c418e9 62ce116 9c418e9 62ce116 15bb0cd 62ce116 15bb0cd 9c418e9 62ce116 15bb0cd 62ce116 15bb0cd 62ce116 15bb0cd 62ce116 9c418e9 62ce116 9c418e9 62ce116 15bb0cd 9c418e9 62ce116 9c418e9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | ---
library_name: transformers
pipeline_tag: text-generation
base_model:
- google/gemma-3-27b-it
language:
- en
- zh
- vi
- id
- th
- fil
- ta
- ms
- km
- lo
- my
- jv
- su
license: gemma
base_model_relation: finetune
---
*Gemma-SEA-LION-v4-27B-IT (IT Model) Last updated: 2025-08-20*
---
# Model Card for Gemma-SEA-LION-v4-27B-IT
<!-- Provide a quick summary of what the model is/does. -->
Last updated: 2025-08-20
**SEA-LION** is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned
for the Southeast Asia (SEA) region.
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
SEA-LION stands for *Southeast Asian Languages In One Network*.
Gemma-SEA-LION-v4-27B is based on Gemma 3 (which supports over 100 languages) and is a multilingual model
which has undergone continued pre-training on approximately **500B** tokens across 11 SEA languages:
Bahasa Indonesia, Burmese, Chinese, English, Khmer, Lao, Malay, Tagalog, Tamil, Thai and Vietnamese.
We continued post-training on Gemma-SEA-LION-v4-27B using a QA pairs dataset in
Bahasa Indonesia, Burmese, Chinese, English, Khmer, Lao, Malay, Tagalog, Tamil, Thai, and Vietnamese
to create *Gemma-SEA-LION-v4-27B-IT*.
For tokenization, the model employs the default tokenizer used in Gemma 3 27B IT.
- **Developed by:** Products Pillar, AI Singapore
- **Funded by:** Singapore NRF
- **Shared by:** Products Pillar, AI Singapore
- **Model type:** Decoder
- **Context length:** 128k tokens
- **Language(s) (NLP):** Bahasa Indonesia, Burmese, Chinese, English, Khmer, Lao, Malay, Tagalog, Tamil, Thai and Vietnamese
- **License:** [Gemma Terms of Use](https://ai.google.dev/gemma/terms)
- **Finetuned from model:** Gemma-SEA-LION-v4-27B
### Model Sources
<!-- Provide the basic links for the model. -->
- **Repository:** https://github.com/aisingapore/sealion.git
## Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
The model has not been aligned for safety. Developers and users should perform their own safety
fine-tuning and related security measures. In no event shall the authors be held liable for any claims, damages, or other liabilities arising from the use of the released weights and codes.
## Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
*The model was not tested for robustness against adversarial prompting.* It is important for users to be aware that our model exhibits certain limitations that warrant consideration.
Like many LLMs, the model can hallucinate and occasionally generates irrelevant content,
introducing fictional elements that are not grounded in the provided context.
Users should also exercise caution in interpreting and validating the model's responses
due to the potential inconsistencies.
**Limitations**
In terms of vision capability, Gemma-SEA-LION-v4-27B-IT has been trained and fine-tuned exclusively on the text back-end.
As a result, its vision capabilities are expected to be comparable to those of Gemma 3 IT 27B,
and may not exhibit significant improvements or differences in this area. [🤗 google/gemma-3-27b-it](https://huggingface.co/google/gemma-3-27b-it )
## How to Get Started with the Model
Use the code below to get started with the model.
Use the code below to get started with the model using the 🤗 Transformers library.
```python
from transformers import pipeline
import torch
pipe = pipeline(
"text-generation",
model="aisingapore/Gemma-SEA-LION-v4-27B-IT",
device="cuda",
torch_dtype=torch.bfloat16
)
messages = [
{
"role": "system",
"content": [{"type": "text", "text": "You are a helpful assistant."}]
},
{
"role": "user",
"content": [
{"type": "text", "text": "Write a poem on southeast asian countries in Indonesian."}
]
}
]
output = pipe(text=messages, max_new_tokens=200)
print(output[0]["generated_text"][-1]["content"])
```
## Training Details
### Training Data
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
The dataset comprises Bahasa Indonesia, Burmese, Chinese, English, Khmer, Lao, Malay, Tagalog, Tamil,
Thai and Vietnamese languages, collected from a mixture of sources including web data, code, open-source datasets,
and synthetically generated datasets, amounting to a total of 500 billion tokens.
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Training Hyperparameters
- **Training regime:** We perform post-training using a variety of Reinforcement Learning (RL) methods.
The instruction fine-tuning dataset combines our SEA-Instruct, Infinity-Instruct,
and OpenMath-Instruct 2 with open-source datasets such as
nvidia/Llama-Nemotron-Post-Training-Dataset (RL set) and zwhe99/DeepMath-103K.
Prompt sampling is guided by a gradient-based analysis process.
Our post-training workflow consists of multiple stages: instruction fine-tuning,
model merging, online RL for both instruction following and math using DRGPPO,
and on-policy alignment via APO. For alignment, rejected-chosen pairs are generated
from the target model, with the *chosen* responses obtained by rewriting and improving upon
the *rejected* outputs.
<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
We evaluated Gemma-SEA-LION-v4-27B-IT on general language, multi-turn chat and instruction-following capabilities.
**Testing Data**
General language capabilities
For the evaluation of general language capabilities, we employed the [SEA-HELM evaluation benchmark](https://arxiv.org/abs/2502.14301) across a variety of tasks.
These tasks include Question Answering (QA), Sentiment Analysis (Sentiment), Toxicity Detection (Toxicity), Translation in both directions (Eng>Lang & Lang>Eng),
Abstractive Summarisation (Abssum), Causal Reasoning (Causal), Natural Language Inference (NLI), Linguistic Diagnostics (LINDSEA), Cultural Knowledge (Kalahi)
and Global MMLU Lite.
Instruction-following and Multi-turn Chat
We evaluated the models on instruction-following and multi-turn chat capabilities with SEA-IFEval (based on [IFEval](https://arxiv.org/abs/2311.07911)) and SEA-MTBench (based on [MT-Bench](https://arxiv.org/abs/2306.05685)) respectively.
The two datasets were originally in English, the linguists and native speakers in the team worked together to filter, localise and translate the datasets into the respective target languages to ensure that the examples remained reasonable, meaningful and natural.
#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
All evaluations were run with the model specific generation parameters defined in the model config. Each evaluation comprised of 8 runs with different seeds and the final results were averaged across these runs.
For all tasks, the model was expected to provide an answer tag from which the answer was automatically extracted. For tasks where options were provided, the answer should comprise one of the pre-defined options.
The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.
SEA-IFEval
SEA-IFEval evaluates a model's ability to adhere to constraints provided in the prompt,
for example beginning a response with a specific word/phrase or answering with a certain number of sections.
Additionally, accuracy is normalised by the proportion of responses in the correct language
(if the model performs the task correctly but responds in the wrong language, it is judged to have failed the task).
SEA-MTBench
SEA-MTBench evaluates a model's ability to engage in multi-turn (2 turns) conversations and respond in ways that align with human needs.
We use `gpt-4.1-2025-04-14` as the judge model and compare against `gpt-4.1-2025-04-14` as the baseline model.
The metric used is the weighted win rate against the baseline model (i.e. average win rate across each category:
Math, Reasoning, STEM, Humanities, Roleplay, Writing, Extraction).
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
The following metrics were used:
| Task | Metric |
|--------------------------------------|----------------------------------------|
| Sentiment Analysis | Accuracy |
| Extractive QA (ID, VI, TH, TA) | ChrF++ |
| MCQ-QA (TL, MY, MS) | Accuracy |
| Metaphor | Accuracy |
| Abstractive Summarisation | Rouge-L |
| Translations | MetricX-24 score (with reference) |
| Causal Reasoning | Accuracy |
| Natural Language Inference | Accuracy |
| LINDSEA | Accuracy |
| Global MMLU Lite | Accuracy |
| Kalahi | Accuracy |
| SEA-IFEval | Accuracy |
| SEA-MTBench | Win rate against a reference |
| Toxicity Detection | Accuracy |
### Results
Coming soon!
For details on Gemma-SEA-LION-v4-27B-IT performance, please refer to the SEA-HELM leaderboard, [Leaderboard results on SEA-HELM](https://leaderboard.sea-lion.ai/).
#### Summary
TBC
## Environmental Impact
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** Nvidia H200 140GB GPUs
- **Hours used:** 214 hrs
- **Cloud Provider:** SMC H200
- **Compute Region:** Singapore
- **Carbon Emitted:** appx. 35.27 - 41 kg CO2 e
## More Information
This is the repository for the commercial instruction-tuned model.
The model has not been aligned for safety. Developers and users should perform their own safety
fine-tuning and related security measures. In no event shall the authors be held liable
for any claims, damages, or other liabilities arising from the use of the released weights and codes.
AI Singapore is a national programme supported by the National Research Foundation, Singapore and hosted by the National University of Singapore.
Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of the National Research Foundation or the National University of Singapore.
For more info, please contact us at sealion@aisingapore.org
## Team
Adithya Venkatadri Hulagadri, Adwin Chan Hok Teng, Anocha Sutaveephamochanon,
Brandon Ong Jin Jie, Bryan Siow Wei Kang, David Ong Tat-Wee, Esther Choa Hsueh Mei,
Evelyn Tan Chor Phin, Hamsawardhini Rengarajan, Huang Yuli, Jann Railey Estrada Montalan,
Jessica Tan Siao Wei, Jonathan Heng, Karthik Nagarajan, Lee Chwan Ren, Leong Wai Yi,
Leong Wei Qi, Leslie Teo, Mark Pereira, Muhammad Ridzuan Bin Mokhtar, Ngee Chia Tai,
Ngui Jian Gang, Nguyen Thanh Ngan, Nicholas Cheng Zi Yi, Ong Zhi Hao, Peerat Limkonchotiwat,
Raymond Ng Boon Cheong, Sajeban Antonyrex, Susanto Yosephine, Tan Choon Meng,
Walter Teng Kok Wai, Wayne Lau, William Tjhi Chandra, Yeo Yeow Tong, Yong Xianbin,
Liew Rachel, Liu Bing Jie Darius, Teo Wei Yi
## Contact
sealion@aisingapore.org |