Only this pageAll pages
Powered by GitBook
1 of 59

SEA-LION.AI

Overview

Loading...

Loading...

Loading...

Loading...

Loading...

Models

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Benchmarks

Loading...

Loading...

Guides

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Resources

Loading...

Code of Conduct

Our Pledge

We, the community of contributors and users of SEA-LION, pledge to create a welcoming and inclusive environment for everyone. We are committed to fostering a respectful and harassment-free space where diverse ideas and perspectives can thrive.

Expected Behavior

To contribute to a positive and inclusive atmosphere, we expect all participants, including contributors, users, and maintainers, to:

  1. Be respectful and considerate: Treat others with kindness, respect, and empathy. Recognize and embrace diversity in backgrounds, experiences, and opinions.

  2. Be inclusive: Welcome and support people of all backgrounds, identities, and abilities. Avoid any form of discrimination or exclusionary behavior.

  3. Listen actively: Pay attention to others' ideas, experiences, and feedback. Be open to constructive criticism and different points of view.

  4. Show empathy: Understand that people may have different cultural norms, communication styles, and perspectives. Be patient and considerate when engaging with others.

  5. Resolve conflicts constructively: Disagreements and conflicts are natural, but we encourage participants to address them in a respectful and solution-oriented manner. Avoid personal attacks and name-calling.

  6. Use clear and inclusive language: Use language that is respectful, inclusive, and considerate of all participants. Avoid offensive, derogatory, or discriminatory language.

The following behaviors are considered unacceptable and will not be tolerated within the SEA-LION community:

  1. Harassment: Any form of harassment, including but not limited to offensive comments, slurs, intimidation, or unwelcome advances, is strictly prohibited.

  2. Discrimination: Discriminatory actions or comments based on race, ethnicity, nationality, gender, gender identity, sexual orientation, disability, religion, age, or any other characteristic will not be tolerated.

  3. Hate speech: Hate speech, promoting violence, or advocating harm towards individuals or groups based on their identity is not allowed.

  4. Personal attacks: Engaging in personal attacks, insults, or trolling of others within the community is unacceptable.

If you witness or experience behavior that violates this code of conduct, please report it promptly to the project maintainers by contacting

All reports will be treated with confidentiality, and the project maintainers will take appropriate action as necessary to address violations. We are committed to providing a safe and welcoming environment for all participants.

Enforcement of this code of conduct will be carried out in a fair and just manner. Depending on the severity and frequency of violations, consequences may include warnings, temporary or permanent bans from the community, or other appropriate actions.

This code of conduct is adapted from the , version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

SEA-LION v4.8

SEA-LION version 4.8, released in Sep 2026, is our latest collection of foundational, text generation optimized for Southeast Asia. Utilizing open dataset for continue pretraining and advanced post-training methodologies—such as agentic on-policy distillation delivers state-of-the-art regional fluency and high computational efficiency.

Built on the highly efficient NVIDIA Nemotron-3 Nano (30B-A3B) and Super (120B-A12B) base architectures, our models are optimized for precise text generation while maintaining low active-weight overhead.

  • Refer to the detailed page to access model cards, usage scripts, and deployment configurations for the entire nemotron family:

    • Focused on parallel-only dataset for the core text-generation Foundations

Contributing

Launched in May 2017, AI Singapore is a national R&D programme in AI – the very first of its kind on a national level. Through SEA-LION, we aim to support under-represented population groups and low-resource languages in Southeast Asia. We welcome collaborations that further enhance our work and help our shared mission of democratizing AI.

We invite researchers, developers, language enthusiasts, and organizations to collaborate in enhancing and expanding the capabilities of our models. This page outlines the various ways you can work with us—whether it’s joint model building, research partnerships, code contributions, documentation improvements, or data sharing.

We appreciate your interest in contributing to SEA-LION, and we look forward to collaborating with you!

We offer various partnership modalities to suit different needs and interests, with a focus on open-sourcing results to benefit the wider community. For collaborations other than a self-serve model, an NDA/MOU/CA may have to be signed by both parties.

Using our model (self-service)

SEA-LION models are open-source so do feel free to download them for your own needs. If SEA-LION manages to be helpful to you/your team, we would love to hear about it and share your successes with our wider community. Send us a note at sealion@aisingapore.org.

Building models together, Data contributions

Motivations

Large Language Models (LLMs) are a type of artificial intelligence model designed to understand and generate human language. Recent developments in LLMs have showcased remarkable capabilities in understanding and generating human language, with applications spanning translation, summarization, coding assistance, question answering, and more.

Many existing LLMs, however, are trained upon massive internet-based datasets, which often has disproportionately large influences from western, industrialized, rich, educated, and democratic (WIRED) societies, as people from non-WIRED societies are less likely to be literate, to use the Internet, and to have their output easily accessed. Such an imbalance in the training data can lead to model outputs that display strong bias in terms of cultural values, political beliefs and social attitudes.

LLMs trained on predominantly WIRED-centric content risk neglecting the linguistic and cultural diversity inherent in non-WIRED populations. These biases become evident not only in examples like cultural references or local idioms, but also in more critical domains such as decision-making, social attitudes and moral reasoning, and which can vary significantly across global communities. By overlooking these variations, mainstream LLMs may inadvertently perpetuate inaccurate assumptions or exclude large segments of the global population.

Our work in SEA-LION, now part of Singapore’s National Multi-Modal Large Language Model project, aims to address these disparities by creating LLMs that cater to under-represented population groups and low resource languages in the SEA region.

SEA-LION is trained on more content produced in Southeast Asian languages like Thai, Vietnamese and Bahasa Indonesia to ensure better representation in data and alignment compared to Western or Chinese models. SEA-LION models understand nuances in SEA languages and demonstrate greater awareness of cultural context specific to the region.

This lowers the bar for governments, industries, and academia that seek LLM solutions that fit local languages and reflect local cultural norms, since WIRED-centric models can pose langauge barriers and misalign with local sensibilities in the SEA region.

Disruptive behavior: Deliberate disruption of discussions, events, or community activities is discouraged.

Unacceptable Behavior

Reporting Violations

Enforcement

Attribution

sealion@aisingapore.org
Contributor Covenant

Nemotron-SEA-LION-v4.8

Nemotron-SEA-LION-v4.8

SEA-LION v3.5

SEA-LION version 3.5, released in Apr 2025, is our first set of hybrid reasoning models trained on Southeast Asian data, each with their unique strengths:

  • Llama-SEA-LION-v3.5-8B-R is suited for cost-efficient, low-latency applications where regional language support and advanced reasoning is critical.

  • Llama-SEA-LION-v3.5-70B-R is suited for knowledge-intensive tasks, and for high-demand environments where advanced reasoning and comprehensive language comprehension are essential.

Trained off our SEA-LION v3 models, SEA-LION v3.5 is explicitly enhanced for reasoning tasks with the inclusion of thinking blocks, continuing our mission to create language models that understand and respond with greater cultural awareness and depth across Southeast Asia.

A distinctive feature of SEA-LION v3.5 is its dynamic reasoning toggle - Mode selection is managed through customizable chat template configurations, offering versatile functionality in handling both complex reasoning tasks and general text generation.

For detailed information of each of the SEA-LION v3.5 models, please refer to their individual documentation pages via the links above.

SEA-LION v3

SEA-LION version 3, released in Dec 2024, is a collection of 3 models (and their variants), each with their unique strengths:

  • Gemma-SEA-LION-v3-9B, based on Gemma2, is our best performing SEA-LION v3 model on SEA-HELM benchmarks for similar sized models

  • Llama-SEA-LION-v3-8B, based on Llama 3.1 8B, now provides a larger context length of 128K

  • Llama-SEA-LION-v3-70B, based on Llama 3.1 70B, is our largest model to date, also providing a 128K context length

With enhanced natural language reasoning (NLR) abilities and superior instruction-following in SEA languages, SEA-LION v3 sets new standards in multilingual AI for the region.

For detailed information of each of the SEA-LION v3 models, please refer to their individual documentation pages via the links above.

Have a unique dataset or domain expertise? Contribute data that we can incorporate into future SEA-LION releases. Collaborate with us to train specialized or improved versions of SEA-LION that will be open-sourced, benefiting both you and the broader community.

If there are areas of research topics where you think that AISG and yourself can work together to work on a common research agenda that can further the work of SEA-LION, please feel free to reach out to us as well. We will be open to joint publications arising from these collaborations too.

If you are interested in any form of collaboration, please feel free to reach out to sealion@aisingapore.org

In addition to formal partnerships, there are many individual and community-driven ways to help SEA-LION grow. Whether it’s fixing bugs, improving documentation, or proposing new features, as a developer, researcher, or just an enthusiast, your input matters.

Before you begin, please take a moment to review this guide, which outlines the contribution process, code of conduct, and how to get help if needed.

Before you start contributing, please ensure you have the following:

  • A GitHub account: If you don't have one, you can create an account here.

  • Familiarity with Git: You'll need to know the basics of Git for version control.

If you encounter any issues, bugs, or unexpected behavior while using SEA-LION, please help us by reporting them.

To report a bug:

  1. Check if the issue has already been reported by searching the GitHub Issues page.

  2. If not, create a new issue with a descriptive title and detailed description of the problem you encountered.

  3. Include relevant information such as your operating system, Python version, and any error messages.

We appreciate your suggestions for improving SEA-LION. If you have an idea for an enhancement or new feature, follow these steps:

  1. Check if your suggestion has already been proposed in the GitHub Issues section.

  2. If not, create a new issue with a clear and concise title and a detailed description of your suggestion.

  3. Include any relevant context or examples to illustrate the enhancement's value.

Please review and adhere to our Code of Conduct. We expect all contributors and community members to treat each other with respect and kindness.

If you have questions, need assistance, or want to discuss contributions further, please feel free to contact us or open an issue for discussion.

1. Collaboration Opportunities

Self-Service Model Usage

Joint Model Building

Research Partnerships

2. Community Contributions

Getting Started

Reporting Bugs

Suggesting Enhancements

Code of Conduct

Get Help

Example Use Cases

Fine-tuning

SEA-LION-GUARD v2 (Latest)

SEA-LION-Guard-v2 is our next-generation suite of action governance and safety models tailored specifically for the Southeast Asian AI ecosystem. Moving beyond standard binary content filtering, the v2 suite introduces real-time Action Governance, Bring Your Own Policy (BYOP) enforcement, and deep Multi-Turn Context Evaluation across 8 core regional languages (Burmese, English, Filipino, Indonesian, Malay, Tamil, Thai, and Vietnamese).

The v2 collection offers scalable parameters and context windows designed for diverse deployment requirements—from edge agent execution to enterprise cloud governance:

  • (https://huggingface.co/collections/aisingapore/sea-lion-guard-v2) is a lightweight 31B, E4B and E2B parameter model with 256K context window for 31B and 128K context window for E4B and E2B. Optimized for ultra-low latency, it acts as an efficient edge guardrail for real-time tool interception and rapid API checks.

Compared to legacy moderation models, Gemma-SEA-LION-Guard-v2 shifts from freeform string generation to type-safe, calibrated decision probabilities across three fields:

SEA-LION v4

SEA-LION version 4, released in August 2025, represents our first collection of multimodal models trained on Southeast Asian text. Each model offers unique strengths tailored to specific needs:

  • A lightweight model optimized for mobile and edge devices, bringing robust SEA language understanding to environments with strict memory and latency constraints.

  • Our powerful vision-language model, expertly trained to interpret both images and text with a deep, nuanced understanding of Southeast Asian cultural contexts.

  • Our latest specialized vision-language models, featuring a native 256K context window and superior OCR capabilities for Indonesian, Thai, and Vietnamese. The 4B model

SEA-LION v4.5

SEA-LION version 4.5, released in May 2026, agentic, and multimodal models optimized for Southeast Asia. Utilizing advanced post-training methodologies—such as knowledge distillation and model merging—this suite delivers state-of-the-art regional fluency, precise tool use, and high computational efficiency.

Our highly efficient 4-billion parameter series built on Gemma 4. It is optimized for precise function-calling, structured JSON outputs, and autonomous agentic tool-use with minimal memory overhead.

  • Refer to the detailed page to access model cards, usage scripts, and deployment configurations for the entire Gemma family:

    • Core Agentic Foundations

Our high-capacity flagship causal and vision-language series built on Qwen3.6. It features a native 262K context window, robust multi-turn reasoning, and repository-level coding adapted for regional linguistic and cultural contexts.

Publications

List of SEA-LION research papers published:

SEA-LION Embedding

, released in March 2026, is a suite of high-performance encoder models specifically architected for Southeast Asian languages. The collection features two primary product lines:

  • : Built on the ModernBERT architecture, these models feature a native 8,192 token context window and are optimized for high-throughput production environments and long-document RAG.

  • : Fine-tuned from the E5-large foundation, these models are designed for maximum semantic accuracy in retrieval and similarity tasks across the region's diverse linguistic landscape.

For detailed information on specific models and checkpoints, please refer to their individual documentation pages.

  • Qwen-SEA-LION-v4.5-27B-IT

    Refer to the detailed page to explore full benchmarks, technical specifications, and configuration details for the entire Qwen family:

    • Base & Multimodal Foundations

    • High-Throughput Booster (SpecDecoder version)

Gemma-SEA-LION-v4.5 (E2B Series)

Qwen-SEA-LION-v4.5 (27B Series)

Gemma-SEA-LION-v4.5-E2B-IT

SEA-LION-Embedding: Open and Reproducible Text Embeddings for Southeast Asia

  • SEA-LION-v4.8: A Technical Report

  • SEA-GUARD: Culturally Grounded Multilingual Safeguard for Southeast Asia
    SEA-LION: Southeast Asian Languages in One Network
    SEA-HELM: Southeast Asian Holistic Evaluation of Language Models
    BHASA: A Holistic Southeast Asian Linguistic and Cultural Evaluation Suite for Large Language Models
    SEA-LION Embedding
    SEA-LION-ModernBERT (Efficiency & Context)
    SEA-LION-Embedding-E5 (Semantic Precision))
    1. content_moderation: Categorical probability distribution across "safe", "sensitive", and "unsafe" tiers (summing to 1.0).

    2. rule_applicability: Predicate relevance score ($0.0 - 1.0$) indicating whether a custom BYOP policy applies to the interaction.

    3. rule_violation: Calibrated probability score ($0.0 - 1.0$) quantifying the likelihood of a policy breach to enable real-time tool call abortion before execution.

    Gemma-SEA-LION-Guard-v2 empowers developers, enterprises, and public sector organizations across Southeast Asia to deploy autonomous agents with confidence. By providing structured, calibrated decision outputs, these models ensure AI systems remain culturally aligned, policy-compliant, and secure against emerging agentic risks.

    Note: For integration examples using OpenAI-compatible Decisions APIs, local vllm deployment scripts, and benchmark results on SEA-SafeguardBench, please refer to the individual model documentation pages linked above.

    The Gemma-SEA-LION-Guard-v2 Collection

    Key Enhancements in v2

    Gemma-SEA-LION-Guard-31B/E4B/E2B-v2

    Our Commitment to Safe Regional AI

    is optimized for efficient edge deployment, while the
    8B model
    is engineered for complex multi-modal reasoning.
    • Apertus-SEA-LION-v4-8B A versatile, compact model designed for high throughput and general-purpose SEA language tasks, offering an optimal trade-off between size and capability for developers.

    • Gemma-SEA-LION-v4-27B Suited for translation, abstractive summarisation, natural language inference, causal reasoning, metaphor understanding, question answering, paraphrasing, and sentiment analysis—applications where regional language support and advanced reasoning are critical.

    • Gemma-SEA-LION-v4-27B-IT Suited for knowledge-intensive tasks and high-demand contexts where comprehensive language comprehension is essential.

      • Available Variants: support inference on a range of consumer-grade GPUs and are compatible with various inference engines.

    • Our flagship instruction-tuned model, designed for maximum performance in general SEA context tasks.

      • Available Variants: offer a near-perfect balance of performance and efficiency, making the power of SEA-LION accessible on resource-constrained hardware like consumer-grade GPUs.

    SEA-LION v4 continues our mission to create language models that understand and respond with greater cultural awareness and depth across Southeast Asia. In addition, SEA-LION v4 has the ability to handle both image and text input as a multimodal model.

    For detailed information of each of the SEA-LION v4 models, please refer to their individual documentation pages via the links above.

    Vision Language Models (VLMs)

    Gemma-SEA-LION-v4-4B-VL
    Gemma-SEA-LION-v4-27B-VL
    Qwen-SEA-LION-v4-4B-VL and 8B-VL

    Text Generation LLMs

    SEA-GUARD

    SEA-Guard, released on 4 Feb 2026, is our premier suite of safety and moderation models tailored for the Southeast Asian landscape. This collection focuses on robust visual and textual guardrails, ensuring AI deployments remain secure and culturally compliant across the region.

    The SEA-Guard Collection

    The SEA-Guard suite currently consists of 4 specialized models:

    • Qwen-SEA-Guard-4B (https://huggingface.co/aisingapore/Qwen-SEA-Guard-4B-040226) is a 4B Image-to-Text model serving as a lightweight visual safety guardrail, specifically optimized for efficient edge applications where low latency is critical.

    • Qwen-SEA-Guard-8B (https://huggingface.co/aisingapore/Qwen-SEA-Guard-8B-040226) is an 8B Image-to-Text model that offers a balanced visual moderation solution with stronger reasoning capabilities for more nuanced content detection.

    • (https://huggingface.co/aisingapore/Llama-SEA-Guard-8B-040226) is an 8B Text Generation model. This text-only safety specialist is optimized for chat moderation and policy enforcement, ensuring safe interactions in dialogue systems.

    • (https://huggingface.co/aisingapore/Gemma-SEA-Guard-12B-040226) is a high-capacity 12B Image-Text-to-Text multimodal safety model designed for complex content analysis, capable of interpreting intricate relationships between visual and textual data.

    The SEA-Guard collection advances our mission to build AI that is not only culturally intelligent but also inherently safe. By providing specialized guardrails for both text and vision, these models enable developers to deploy AI solutions across Southeast Asia with confidence in their safety and compliance standards.

    Note: For detailed integration guides and benchmark data for each SEA-Guard model, please refer to their individual documentation pages via the links above.

    Model Deployment & Inferencing

    This section covers the various environments where SEA-LION models can be hosted, ranging from fully managed cloud services to self-hosted high-performance infrastructure. SEA-LION models are freely available for download. The following guides provide technical how-tos for setting up SEA-LION inference using different approaches:

    1. Using our provided SEA-LION API

    2. Running SEA-LION on a local machine (coming soon)

    3. Deploying SEA-LION on the cloud

    4. Leveraging our Partner API Platforms

    Agentic Frameworks

    SEA-LION models can be used as intelligent agents capable of tool-calling, multi-step reasoning, and complex task execution. The SEA-LION v3 family, such as aisingapore/Llama-SEA-LION-v3-70B-IT, can be utilized for agent-based applications with tool-calling capabilities.

    Agents built with SEA-LION can:

    • Execute complex, multi-step workflows

    • Integrate with external tools and APIs

    • Perform real-time information retrieval

    • Handle specialized tasks like translation, calculation, and web search

    • Chain multiple operations together intelligently

    The following guides provide technical how-tos for building SEA-LION agents using different frameworks:

    Learn how to build powerful agents using AWS's Strands Agents SDK, including:

    • Basic agent setup using in-built tools

    • Custom tool development

    • Using agents as tools

    • Multi-tool agent example

    Develop and deploy agents with Google ADK:

    • Basic agent setup with custom tools and agent-as-a-tool

    • Custom tool development

    • Using agents as tools

    • Running multi-tool agent via in-built web interface/CLI

    For optimal agent performance, we recommend using the following SEA-LION models:

    • aisingapore/Llama-SEA-LION-v3-70B-IT/aisingapore/Llama-SEA-LION-v3-8B-IT - Suitable for tool-calling, long context tasks or creative response.

    • aisingapore/Gemma-SEA-LION-v3-9B-IT - Suitable for smaller tasks with succinct response.

    • aisingapore/Llama-SEA-LION-v3.5-70B-R

    Tool Integration: SEA-LION agents can seamlessly integrate with both built-in tools (calculations, time queries) and custom tools (web search, translation, APIs).

    Multi-Agent Systems: Agents can be composed together in multiple ways. Specialized agents serving as tools, running in sequential workflow, or passing to each other in a loop.

    Streaming Responses: Built-in support for real-time streaming responses for better user experience.

    Flexible Configuration: Easy environment-based configuration for different deployment scenarios.

    SEA-LION MCP Server

    SEA-LION Model Context Protocol (MCP) Server provides a simple way to access SEA-LION’s multilingual models and Southeast Asian language tools from MCP-compatible clients.

    The Model Context Protocol (MCP) is an open standard for connecting AI models to external tools, data sources, and services. It defines a common interface so that clients (such as IDEs, chat assistants, or AI agents) can discover and use capabilities provided by servers without custom integrations for each tool. Powered by the SEA-LION API, the MCP server exposes capabilities including translation and localisation, and safety classification.

    Usage of the SEA-LION API is subject to our and

    Claude Desktop handles the OAuth flow for you automatically. It's the most straightforward way to connect.

    1. Open Claude Desktop and go to Settings → Connectors → Customize

    2. Click Add Custom Connector and select Web

    /
    aisingapore/Llama-SEA-LION-v3.5-8B-R
    - Display reasoning process and long context tasks.

    Available Frameworks

    Strands Agents SDK

    Google Agent Development Kit

    Recommended Models

    Key Features

    Gemma-SEA-LION-v4-27B-IT-GGUF, NVFP4, FP8_Dynamic
    Qwen-SEA-LION-v4-32B-IT
    Qwen-SEA-LION-v4-32B-IT-4BIT / 8BIT

    Our Commitment to Safe Regional AI

    Llama-SEA-Guard-8B
    Gemma-SEA-Guard-12B
    Create SEA-LION endpoint on Google Vertex AI
    Importing and Using Llama-SEA-LION models in a Serverless On-Demand Environment with Amazon Bedrock
    OpenAI-compatible APIs with Llama-SEA-LION models and Bedrock Access Gateway
    Deploying Gemma-SEA-LION models using AWS Sagemaker AI
    Deploying SEA-LION using vLLM on Linux server
    Cloudflare Workers AI
  • Enter a name (e.g. SEA-LION MCP) and the URL: https://mcp.sea-lion.ai

  • Click Add and Connect

    1. Click on Allow Access and sign in with your Google account

    To add the MCP server to Claude Code CLI:

    You'll then be prompted to sign in: your browser opens, and you authorise access with your Google account.

    Verify the connection with:

    You should see sealion listed as ✓ Connected.

    Once integrated, SEA-LION MCP works invisibly in the background. Users can simply talk to the main LLM such as Claude naturally.

    Example Prompt:

    Can you translate this article into Malay for our Singapore audience?

    Claude automatically calls SEA-LION's translation engine, localising the content for the right tone and context.

    Beyond translation, SEA-LION can also detect Southeast Asian language variants and moderate content with cultural context specific to the region.

    Limits help us mitigate misuse and manage API capacity and help ensure that everyone has fair access to the API.

    SEA-LION MCP usage frequency will be subject to rate limits applied on requests per minute (RPM).

    As of 04 Jun 2026, our rate limits is set to 10 requests per minute per user.

    If you have any questions or want to speak about getting a rate limit increase, reach out to sealion@aisingapore.org.

    Connect via Claude Desktop

    Terms of Use
    Privacy Policy
    claude mcp add --transport http sealion https://mcp.sea-lion.ai/
    claude mcp list

    Connect via Claude Code CLI

    Using Claude

    Rate Limits

    SEA-LION

    Built for Southeast Asia, by Southeast Asia

    SEA-LION (Southeast Asian Languages in One Network) is a family of open-source Large Language Models (LLMs) that better understands Southeast Asia’s (SEA) diverse contexts, languages, and cultures.

    It is an open-source project anchored by the Products Pillar of AI Singapore. Our work in SEA-LION aims to create LLMs that cater to under-represented population groups and low resource languages in the SEA region. You can read more about our motivations for SEA-LION here.

    This site provides information and resources on SEA-LION, including how to access the models, hosting, and how-to guides.

    Key Features of SEA-LION

    Model Collection
    Size
    Context Length
    Training Strategy
    Available in

    ¹ Supervised Fine-Tuning

    ² Continued Pre-Training

    SEA-LION has seen:

    • In v1, ability to outperform most models based on SEA-HELM (Southeast Asian Holistic Evaluation of Language Models) when it was released

    • In v2, outperformance for SEA tasks, while retaining credible performance on standard (English) benchmarks

    • In v2.1, key improvements in conversational abilities across SEA languages, while providing more helpful and contextually appropriate responses to user prompts

    • In v3, outperforms similar sized open source models, and even some larger models in both general and SEA capabilities

    SEA-LION-Embedding: The Vector Foundation

    The SEA-LION-Embedding suite provides the semantic foundation for the ecosystem. Released in March 2026, these models represent a significant leap in regional retrieval performance. Tested on the SEA-BED (Southeast Asia Embedding Benchmark), which utilizes human-curated native data rather than machine translations, our embeddings consistently set new state-of-the-art records for 10 regional languages across retrieval, reranking, and semantic textual similarity tasks.

    SEA-LION-Guard: The Protector

    • In v1, building on the sophisticated reasoning and multimodal foundation laid by SEA-LION v4, we are proud to introduce the first generation of SEA-Guard. Released on 4 Feb 2026, SEA-Guard is the dedicated safety counterpart to the SEA-LION family. As our foundational models gained the power to "see" (Multimodality in v4) and "think" (Reasoning in v3.5), the need for a culturally attuned safety layer became paramount.

    • In v2, we elevate safety from passive moderation to active governance. Built on the Gemma-4 foundation architecture, Gemma-SEA-LION-Guard-v2 (31B, E4B, and E2B) transitions from traditional text filtering to real-time Action Governance, Bring Your Own Policy (BYOP) enforcement, and Multi-Turn Context Evaluation across a massive 256K context window. Engineered specifically for agentic deployments, v2 replaces freeform text responses with calibrated, type-safe decision outputs (content_moderation, rule_applicability, and rule_violation)—enabling software to intercept unauthorized tool calls, enforce custom enterprise rules, and detect multi-turn scam patterns across 8 Southeast Asian languages.

    We use a holistic approach to evaluation, including not just traditional Natural Language Processing (NLP) benchmarking tasks (such as sentiment analysis and question answering) but also .

    Visit our for more detailed breakdown on:

    1. How SEA-LION compares to other available models along different metrics

    2. What SEA-HELM is and the four key capabilities it is evaluated on: English performance, Proficiency in SEA chat, Instruction-following and Linguistic tasks

    3. What each of these globally recognized metrics mean under SEA-HELM

    Transparent and Open Source

    We have benefited greatly from the open-source community and believe that efforts to better represent our region will similarly be well served by open-source efforts.

    All SEA-LION releases will therefore embrace an open-source ethos under the MIT license as much as possible; however, the exact licensing terms may vary depending on the underlying base model’s restrictions or requirements. For instance, if the model leverages Meta’s Llama3 codebase, it may be bound by the , which places certain restrictions on commercial use. Similarly, the Gemma-based variants may carry different terms. Users should always refer to the Hugging Face model card of each specific SEA-LION model for the most accurate, up-to-date license information.

    SEA-LION will also be open and transparent in the following areas throughout this guide:

    1. Pre-Training data

    2. Model training code

    3. Fine-Tuning data

    4. Evaluation benchmarks

    We welcome contributions to SEA-LION! Check out the to get started.

    Some ways to contribute:

    • Report bugs and issues

    • Enhance the documentation

    • Add more model evaluation tasks and metrics

    • Train versions of the model in more SEA languages

    Check out our also, for possible ways to further enhance and expand the capabilities of SEA-LION together.

    If you use SEA-LION in your work, please cite it as:

    If you are using SEA-LION v3 for your work, please cite it as:

    If you are using SEA-LION embedding for your work, please cite it as:

    AI Singapore is a national programme supported by the National Research Foundation, Singapore and hosted by the National University of Singapore. Any opinion, finding, conclusion or recommendation expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore, or the National University of Singapore.

    We also grateful for the support of the Infocomm Media Development Authority (IMDA) of Singapore.

    SEA-LION would not be possible without a growing list of Singapore, regional, and international collaborators. Please see our website for more details.

    If you have questions, comments, or issues, please open a GitHub issue or contact us via .

    SEA-LION Foundation Family

    The SEA-LION models have served as a foundation for developing localized AI solutions tailored to specific linguistic and cultural needs. Over multiple iterations, other regions have built upon SEA-LION’s architecture to create specialized versions that enhance language understanding for their respective regions. These models leverage SEA-LION’s robust multilingual capabilities while being fine-tuned with localized datasets, ensuring better performance in regional contexts.

    SEA-LION Model Tree

    Base
    Localized Model

    SEA-LION v1

    → : WangchanLion 7B is a multilingual instruction-following model developed by PyThaiNLP and the VISTEC-depa AI Research Institute of Thailand. Fine-tuned on SEA-LION-v1-7B, it incorporates approximately 500,000 samples from open-source, commercially permissible datasets, with a focus on Thai and English languages.

    SEA-LION v2

    → : Llama3 8B CPT Sahabat-AI v1 Instruct model, co-developed by GoTo Group and AI Singapore, is an Indonesian-focused adaptation fine-tuned with 448,000 Indonesian instruction-completion pairs, along with 96,000 Javanese and 98,000 Sundanese pairs. It supports Indonesian, Javanese, Sundanese, and English, making it a significant advancement in AI for the Indonesian linguistic landscape.

    By leveraging SEA-LION’s architecture, these localized models provide AI solutions that align more closely with native language requirements. As SEA-LION continues to evolve, more localized versions are expected to emerge, further expanding the reach and effectiveness of AI in Southeast Asian languages.

    Gemma-SEA-LION-v4-27B-VL

    Last updated: 2025-10-17

    SEA-VLM is an instruct-tuned vision-text model for the Southeast Asia (SEA) region.

    Gemma-SEA-LION-v4-27B-VL has undergone post-training using instruction-image pairs datasets in Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese, comprising approximately 540k samples in total, to create Gemma-SEA-LION-v4-27B-VL.

    Gemma-SEA-LION-v4-27B-VL inherits Gemma 3's:

    • Large 128K context length

    • Image and text understanding capabilities, including document comprehension, visual Q&A, and image-grounded reasoning

    • Advanced function calling and structured outputs to allow for seamless integration into larger systems

    We performed post-training in English and SEA languages on Gemma-SEA-LION-v4-27B-IT, a decoder model using the Gemma 3 architecture, to create Gemma-SEA-LION-v4-27B-VL.

    For tokenization, the model employs the default tokenizer used in Gemma 3 27B IT.

    • Developed by: SEACrowd and Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: SEACrowd and Products Pillar, AI Singapore

    • Model type: Decoder

    As of 15 October 2025, Gemma-SEA-LION-v4-27B-VL excels at Southeast Asian (SEA) tasks when compared to other open models with fewer than 200 billion parameters and demonstrates performance comparable to that of larger and top closed models. For detailed rankings, please refer to the .

    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.

    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 text capability, Gemma-SEA-LION-v4-27B-VL has been trained and fine-tuned exclusively on the vision-text backend. As a result, its text capabilities are expected to be comparable to those of Gemma-SEA-LION-v4-27B-IT, and may not exhibit significant improvements or differences in this area.

    Use the code below to get started with the model using the 🤗 Transformers library.

    The dataset comprises vision-text paired in Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese languages, collected from a mixture of sources including web data, code, open-source datasets.

    • Training regime:

    We perform SFT using 540k of vision-text samples written in 10 languages. Then, we perform model merging with Gemma3-27B-IT to preserve general vision-text knowledge.

    For details on Gemma-SEA-LION-v4-27B-VL performance, please refer to the SEA-LION.ai blogpost, .

    Carbon emissions can be estimated using the presented in .

    • Hardware Type: Nvidia H200 140GB GPUs

    • Hours used: 13 hrs

    • Cloud Provider: SMC H200

    • Compute Region: Singapore

    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.

    SEA-HELM Audio

    SEA-HELM Audio is a Southeast Asian (SEA) multilingual evaluation framework that extends the text-based SEA-HELM benchmark. It is designed to assess performance degradation in cascaded automatic speech recognition and large language model (ASR–LLM) pipelines.

    SEA-HELM Audio serves as a valuable resource for developers looking to deploy and evaluate voice agents, providing empirical baselines for how linguistic accuracy and instruction-following hold up when transitioning from text to spoken interactions. It currently covers English, Indonesian, Malay, Tamil, and Chinese.

    Motivations

    Limitations of Text-Only Benchmarks for Voice Agents

    While Large Language Models (LLMs) continue to achieve high benchmark scores on written text, deploying these models within real-world voice pipelines introduces acoustic transcription errors, phonetic ambiguities, and domain-specific degradation. Existing spoken language benchmarks do not adequately capture Southeast Asian linguistic nuances. There was a critical need to systematically measure the impact of speech input on downstream LLM task performance across SEA languages.

    Quantifying the "Speech Gap"

    To evaluate how voice interfaces bottleneck LLM reasoning, SEA-HELM Audio establishes a controlled framework to quantify the Speech Gap (Δ = Score_text − Score_speech). This absolute difference represents the "modality penalty," quantifying precisely how much task performance degrades due to transcription errors or missing acoustic signals.

    Core Pillars of SEA-HELM Audio

    1. Spoken Prompt Construction

    Because the original SEA-HELM contains only written prompts, SEA-HELM Audio natively creates spoken input. Each prompt is read aloud by a Text-to-Speech (TTS) synthesizer that plays the role of the user. To ensure authenticity, only the content a user would actually say is synthesized, and written conventions (like multiple-choice markers) are adapted so they read naturally aloud in each specific language.

    2. Dual-Path Evaluation Flow

    To isolate the exact cost of the speech front-end, each SEA-HELM prompt is evaluated in two parallel ways:

    • The Speech Path: The text prompt is converted to speech via TTS, transcribed back to text by an ASR system, and the resulting transcript is answered by the LLM.

    • The Text Path: The LLM answers the original, ground-truth text prompt directly.

    Because both paths share the same LLM and rule-based verifier, any difference in performance isolates the failure of the acoustic pipeline.

    The framework accommodates diverse pipeline architectures, evaluating both open-weight multilingual baselines (e.g., Qwen3-ASR, MERaLiON3-ASR) and commercial API services (e.g., ElevenLabs). It measures transcription quality (Word Error Rate and Character Error Rate) to separate how much the ASR changed the prompt from how much those changes actually derailed the downstream LLM task.

    All responses are scored with rule-based verifiers taken from SEA-HELM, keeping evaluations deterministic and identical across paths. Initial benchmarking focuses on highly verifiable subsets like SEA-HELM IFEval (instruction following) and Global-MMLU-Lite (multiple-choice reasoning).

    The leaderboard allows users to compare different ASR-LLM configurations, highlighting the performance penalty of the speech modality. Initial empirical results have exposed severe degradation across the board. For example, while models achieve exceptionally high scores on text-only instruction following, end-to-end speech accuracy drops significantly.

    Notably, the benchmark reveals a profound "Tamil Bottleneck," where the modality penalty exceeds 40 percentage points regardless of whether open-weight or commercial ASR systems are used, pointing to a severe acoustic data scarcity in regional speech modeling.

    SEA-HELM Audio forms part of the broader ATLAS-Eval ecosystem. Our methodology, evaluation frameworks, and related research papers (including the formal SEA-HELM Audio: Evaluating Multilingual ASR-LLM Pipeline Performance preprint) are publicly accessible.

    While SEA-HELM Audio establishes a solid baseline using synthesized speech to measure the "floor" of performance degradation, involve natural accents, background noise, and conversational code-switching. Future iterations of SEA-HELM Audio aim to incorporate naturalistic, crowdsourced audio corpora to provide an even more robust and comprehensive evaluation of Southeast Asian voice AI.

    For more details and information on SEA-HELM Audio, you can refer to the following materials and platforms:

    1. SEA-HELM Audio: Evaluating Multilingual ASR-LLM Pipeline Performance

    2. SEA-HELM Audio Benchmark Dataset Available on Hugging Face:

    3. SEA-HELM Audio Evaluation Repository Available on GitHub:

    4. SEA Audio Leaderboard & Voice-Agent Playground Interactive evaluation platform at

    Bedrock Access Gateway

    In the previous guide, we have shown how to leverage on Amazon Bedrock‘s Custom Model Import to deploy SEA-LION in the cloud. After importing the SEA-LION models, you can build applications with the AWS SDK. This guide describes an alternative method to build the applications with OpenAI-compatible APIs served by the Bedrock Access Gateway.

    Prerequisites

    The SEA-LION model is imported and available on Amazon Bedrock. For imported models, you are charged for model inference. Please refer to the Amazon Bedrock Pricing page for the latest information.

    Please check that the following are installed on your development machine.

    • Git

    • Python

    Local Installation

    If you have already cloned the repository from the previous , skip to the next step. The repository is a fork to support the imported models. At the time of writing, the original repository supports only.

    Navigate to the src directory.

    Check the and environment variables. Please ensure that AWS_REGION is set to the region where the model is imported.

    • AWS_ACCESS_KEY_ID

    • AWS_SECRET_ACCESS_KEY

    • AWS_SESSION_TOKEN

    • AWS_REGION

    Before running the gateway, it is a good practice to create a virtual environment to isolate the app. Please follow these steps to create a virtual environment, or feel free to use your preferred tool.

    Initialise the virtual environment.

    Activate the virtual environment.

    Install the packages.

    Start the gateway.

    Alternatively, start the gateway with Docker Compose if it is installed.

    List the models with the following curl script. The imported model is in the list with the format arn:aws:bedrock:<AWS_REGION>:<ACCOUNT_ID>:imported-model/<MODEL_ID>

    Test the chat completion API with the following curl script. Replace <AWS_REGION>, <ACCOUNT_ID> and <MODEL_ID> with the values from the imported model’s ARN (Amazon Resource Name) from the model list.

    With the gateway, the demo from the can use the to integrate with the imported model. Follow the steps in the guide to set it up. Run the demo with the --api parameter.

    • SEA-LION Models on Hugging Face:

    • Bedrock Access Gateway:

      • Production deployment:

    Gemma-SEA-LION-v4-4B-VL

    Last updated: 2026-02-05

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Gemma-SEA-LION-v4-4B-VL is a 4-billion parameter Vision-Language Model (VLM) built upon the gemma-3-4b-it architecture. To ensure domain adaptation for the region, the model underwent rigorous post-training on a curated dataset of approximately 8.54 million instruction-text pairs. This curated dataset included various SEA Languages such as Burmese, Malay, Tagalog and Tamil. This extensive post-training instills multilingual and multicultural fluency for both SEA languages and English.

    Gemma-SEA-LION-v4-4B-VL inherits the image and text capabilities from gemma-3-4b-it alongside its large context length of 128K tokens. Additionally, beyond extending the multilingual capabilities of the original gemma model for SEA languages, we experimented with:

    1. Adding function calling to the model to allow for this model to be used in tool calling applications

    FAQ

    Common questions we receive at the SEA-LION inbox, grouped by topic. If your question is not covered here, write to us at or use the Collaborate form on .

    SEA-LION (Southeast Asian Languages In One Network) is a family of open-source large language models built for Southeast Asia's languages and cultural contexts. The models are developed by AI Singapore.

    You have a few options:

    • Test the models directly in our .

    • Chat with SEA-LION on our .

    Qwen and Llama SEA-GUARD

    SEA-Guard is a collection of safety-focused Large Language Models (LLMs) built upon the SEA-LION family, designed specifically for the Southeast Asia (SEA) region.

    SEA-LION stands for Southeast Asian Languages In One Network and is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    This model is a fine-tuned version of , and on 1M instruction-following pairs. For more details on training data, please refer to the paper .

    For tokenization, the model employs the default tokenizer used in Qwen3-VL.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by:

    Gemma-SEA-GUARD-12B

    SEA-Guard is a collection of safety-focused Large Language Models (LLMs) designed specifically for the Southeast Asia (SEA) region. While the collection comprises four distinct models, we currently offer a single API endpoint that exclusively serves the . You can generate an API key to access this model at .

    SEA-LION stands for Southeast Asian Languages In One Network and is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    This model is a fine-tuned version of on 1M instruction-following pairs. For more details on training data, please refer to the paper .

    For tokenization, the model employs the default tokenizer used in Gemma 3.

    • Developed by: AI Products Pillar, AI Singapore

    vLLM on Linux

    The following guide explains the procedures for deploying a SEA-LION model on a Linux server.

    • OS: Linux

    • Python: 3.9-3.12

    • vLLM version: 0.10.1.1

    • uv 0.7.x installed

    Cloudflare Workers AI

    Our Gemma-SEA-LION-v4-27B-IT model is now supported on the Cloudflare Workers AI for on-demand inferencing, subject to Cloudflare's and .

    This quickstart guide will instruct you through setting up your Workers AI account and REST API to easily experiment with Gemma-SEA-LION-v4-27B-IT. For more detailed information, you can refer directly to the latest guide on Cloudflare

    Sign up for a if you have not already done so.

    You need your API token and Account ID to use the REST API.

    To get these values:

    • In the Cloudflare dashboard, go to the Workers AI page and select REST API:

    3. ASR and LLM Pipeline Assessment

    4. Deterministic Scoring and Active Subsets

    SEA-HELM Audio Leaderboard

    SEA-HELM Audio Datasets and Resources

    Limitations and Future Work

    Resources

    real-world spoken interactions
    Technical Report
    aisingapore/seahelm-audio
    aisingapore/seahelm-audio
    voice-agent.sea-lion.ai

    SEA-LION v3

    → Gemma2 9B WangchanLIONv2 (Thai): The Gemma2 9B WangchanLIONv2 Instruct model is a collaborative effort between VISTEC and AI Singapore. It has been fine-tuned with approximately 3,760,000 Thai instruction-completion pairs derived from human-annotated instructions, FLAN-style automatic data construction, and synthetic samples. This multilingual model supports both Thai and English languages.

    → Gemma2 9B CPT Sahabat-AI (Indonesian): The Gemma2 9B CPT Sahabat-AI v1 Instruct model, co-developed by GoTo Group and AI Singapore, has been fine-tuned with approximately 448,000 Indonesian instruction-completion pairs, along with 96,000 in Javanese, 98,000 in Sundanese, and an additional 129,000 in English. This multilingual model supports Indonesian, Javanese, Sundanese, and English.

    SEA-LION v4

    → Gemma 3 27B/4B SEA-LION v4 (Multimodal): The first multimodal release in the SEA-LION family, based on the Gemma 3 architecture. Co-developed with Google, these models support a 128K context window. It underwent post-training on ~10M samples across 11 SEA languages and features vision-text capabilities for document understanding and visual Q&A. This model supports text and image understanding with a commercially permissive license. It is designed to handle Southeast Asian cultural nuances and visual contexts.

    → Qwen-SEA-LION-v4-4B/8B-IT: The lightweight flagship multimodal model built on the Qwen3-VL framework, optimized for regional linguistic and cultural nuances.

    → Apertus 8B SEA-LION v4: A fully open regional adaptation based on the Swiss AI "Apertus" architecture, focusing on highly efficient, transparent, and community-driven multilingual support. Features 15T token pre-training across 1,000+ languages with a focus on deep multilingual depth and transparency.

    → Gemma-SEA-LION-v4.5-E2B-IT: Highly efficient lightweight model built on the Gemma 4 architecture, optimized for precise function-calling, structured JSON outputs, and autonomous agentic tool use in resource-constrained environments.

    → Qwen-SEA-LION-v4.5-27B-IT: High-capacity flagship instruction-tuned and multimodal model built on Qwen 3.6. Features a native 262K context window, robust multi-turn reasoning, and deep regional fluency across 7 key SEA languages. High-throughput with speculative decoding booster model utilizing block diffusion algorithms to significantly accelerate production inference latency without sacrificing output quality.

    → Nemotron-SEA-LION-v4.8: Extended regional foundation model featuring broad coverage across 13 regional languages—including Burmese, Malay, and key sub-national languages like Balinese, Javanese, and Sundanese. Advanced continue pre-training on parallel corpus to post-training methodologies—such as agentic on-policy distillation delivers state-of-the-art regional fluency and high computational efficiency, cultural competence assessments and country-entity knowledge verification.

    SEA-Guard (renamed as SEA-LION-GUARD)

    A specialized collection of safety-focused LLMs built on the SEA-LION family released on 4 Feb 2026.

    → Qwen-SEA-Guard-4B/8B (Image-to-Text): The 4B variant is a lightweight visual guardrail optimized for edge applications, while the 8B offers balanced visual moderation with stronger reasoning capabilities.

    → Llama-SEA-Guard-8B (Text Generation): A text-only safety specialist optimized for chat moderation and policy enforcement, ensuring safe interactions in dialogue systems.

    → Gemma-SEA-Guard-12B (Multimodal): The high-capacity safety flagship capable of interpreting complex relationships between visual and textual data for deep content analysis.

    Next-generation safety and action governance models featuring Bring Your Own Policy (BYOP) enforcement, real-time tool interception, and multi-turn context evaluation across 8 SEA languages.

    → Gemma-SEA-LION-Guard-v2-E2B (128K Context): An ultra-lightweight edge guardrail optimized for low-latency tool interaction evaluation and rapid API checks on constrained devices.

    → Gemma-SEA-LION-Guard-v2-E4B (128K Context): An efficient, mid-tier guardrail delivering balanced reasoning speed for real-time action governance in local enterprise deployments.

    → Gemma-SEA-LION-Guard-v2-31B (256K Context): The high-capacity flagship model built on Gemma-4, designed for deep policy evaluation, long-context scam detection, and multi-turn jailbreak analysis.

    SEA-LION Embedding

    A suite of high-performance encoder-only models specifically architected for Southeast Asian languages, providing state-of-the-art vector representations for RAG and semantic search.

    → SEA-LION-ModernBERT-Embedding (Encoder): Our flagship encoder line utilizing the ModernBERT architecture. It offers superior efficiency and long-context handling, specifically tuned for the unique scripts and linguistic structures of the SEA region.

    → SEA-LION-E5-Embedding (Encoder): A high-precision semantic encoder line fine-tuned from the E5-large foundation, optimized for maximum accuracy in cross-lingual retrieval and semantic matching across regional and global languages.

    Impact and Future Directions

    WangchanLion 7B (Thai)
    Llama3 8B CPT Sahabat-AI v1 Instruct (Indonesian)
    Claude Desktop Add custom connector dialog with the SEA-LION MCP name and URL filled in
    SEA-LION Application Access Request screen with the Allow Access button
    Translation prompt with Claude requesting permission to use the SEA-LION Translate localize tool
    The article translated into Malay and localized for a Singaporean audience
    Download the models from Hugging Face.
  • Inference the models through major cloud platforms (see "Running SEA-LION in production" below).

  • Yes. SEA-LION is open-source and free to use, including for commercial purposes. You can download and self-host the models from Hugging Face, or access them through cloud platform partners.

    You can generate an API key through the SEA-LION Playground. Documentation is available at docs.sea-lion.ai.

    Our free APIs are intended for proof-of-concept (POC) development and are rate-limited (10 requests per minute). They are not designed for production workloads.

    We are not able to raise the limits on the free POC tier. If you need higher throughput or production-grade reliability, inference SEA-LION through one of our cloud platform partners, where you can scale usage according to your needs.

    The free API is rate-limited and meant for POC testing, so heavy or sustained use may hit limits. For continued or production use, move to a cloud platform partner. If you believe you are seeing an actual outage rather than a rate limit, write to us with the details.

    For production, inference SEA-LION through major cloud platforms rather than the free POC API. The models are available on hyperscalers including AWS (Bedrock) and Google Cloud (Vertex AI), among others. See our inferencing guide for the current list and setup steps.

    If you are running on limited GPU resources, use the quantised versions of the models. The model card on Hugging Face lists the available variants and their requirements.

    SEA-LION is trained on and supports the national languages of Southeast Asia. This includes (among others) Indonesian, Thai, Vietnamese, Malay, Tamil, Khmer, Burmese, Lao and Filipino. For the authoritative and most current list, see the model documentation.

    Yes. These are among the Southeast Asian languages SEA-LION is trained on. We are continually working with local and international partners to strengthen performance across all supported languages.

    We are actively improving Tetum capability, working together with local and international partners. It is an area of ongoing development.

    No. We evaluate and support the national languages of Southeast Asia. This does not include dialects such as Cantonese, Hokkien, Teochew, Hakka or other Singaporean dialects.

    SEA-LION currently supports text and image (vision) inputs, and does not yet have a voice or audio model, though we do have plans to release text-to-speech (TTS).

    Not yet. SEA-LION today supports text and vision, and does not currently have a voice or audio model. We do have plans to release text-to-speech (TTS). Follow our website and AI Singapore's social channels to hear when it is released.

    SEA-LION and MERaLiON are complementary models that address different needs and work in tandem to strengthen Singapore's national AI foundation. SEA-LION, built by AI Singapore, is an open-source, SEA-relevant large language model. It is multilingual, multicultural and multimodal (handling text and vision), and is built for general tasks such as instruction following, tool use and reasoning. MERaLiON is a speech-to-text model that prioritises empathetic learning and understanding, starting with Singlish and Singapore's multicultural context and extending to regional languages. It also supports speech-related tasks such as emotion recognition and spoken dialogue summarisation. MERaLiON is developed by A*STAR's Institute for Infocomm Research (I²R).

    The two leverage shared data, compute and research to build complementary text and speech models.

    Our benchmark evaluations are published on the SEA-LION Leaderboard.

    Make sure you are using the latest version of the SEA-HELM evaluation code base, which is updated as we add languages and metrics. We recommend running with the default SEA-HELM configuration.

    We welcome collaboration across the public sector, private sector, academia and the non-profit space. The best first step is to submit the Collaborate form on sea-lion.ai or email us. To help us route your request quickly, please include a short overview of your organisation, your use case or proposed collaboration, and the languages or capabilities you are interested in.

    We are always glad to hear from people who can help strengthen SEA-LION's coverage and quality. Share details of the data or capability you can offer, and we will let you know if it aligns with our current priorities. We do review fit case by case, so not every offer will match an active need at a given time.

    AI Singapore/SEA-LION is a non-profit initiative funded by Singapore's National Research Foundation (NRF). We are not able to provide grants or funding for external projects. You are very welcome to use the open-source models freely for your work.

    Reach out via the Collaborate form or email. Note that SEA-LION is already available on several major platforms, so do let us know what you have in mind and we can explore fit.

    PAIP is a company-sponsored programme that helps organisations build applied AI capability within their teams. Because it is tailored to each organisation, we usually start with a short call to understand your team, your goals and the number of participants before sharing detailed materials. If you are interested, email us with your organisation and a brief description of your needs.

    Please email us with details of your outlet, the focus of the story and your timeline. Media requests are handled together with AI Singapore's Marketing Communications team, and we will follow up to confirm.

    We are glad to receive speaking and panel invitations. Email us with the event details, format, date and audience, and we will assess fit and timing.

    If you have identified a potential security issue, please email us at sealion@aisingapore.org with the details so we can route it to the right team.

    Follow AI Singapore on LinkedIn and our other social channels, and keep an eye on the SEA-LION website. That is where we announce new model releases, events and opportunities.

    Getting started

    What is SEA-LION?

    How do I try SEA-LION?

    sealion@aisingapore.org
    sea-lion.ai
    Playground
    Telegram bot

    Is SEA-LION free to use? Can I use it commercially?

    API access and rate limits

    How do I get an API key?

    What are the API rate limits?

    Can I get a rate limit increase?

    My API key expired, or I am hitting timeouts. What should I do?

    How do I run SEA-LION in production?

    Which model and hardware should I use?

    Languages and capabilities

    Which languages does SEA-LION support?

    Does SEA-LION support [Khmer / Tamil / Lao / Burmese]?

    Does SEA-LION support Tetum?

    Does SEA-LION support dialects such as Cantonese or Hokkien?

    What about Singlish, or speech-to-text and text-to-speech?

    Does SEA-LION have a voice or audio model?

    What is the difference between SEA-LION and MERaLiON?

    Benchmarks and evaluation

    Where can I see how SEA-LION performs?

    I am running SEA-HELM and seeing inconsistencies. What should I check?

    Partnerships and collaboration

    How can I partner or collaborate with SEA-LION?

    I would like to contribute language data or annotation. Is that useful?

    Can AI Singapore/SEA-LION fund my project or research?

    We are a cloud or hosting provider interested in hosting SEA-LION. Who do we talk to?

    Programmes

    What is the Pinnacle AI Industry Programme (PAIP) and how do I apply?

    Media and speaking

    I am a journalist with a media or interview request.

    I would like to invite SEA-LION to speak at an event.

    Security

    How do I report a security vulnerability?

    Staying in touch

    How do I keep up with new releases and events?

  • Get your API token:

    • Select Create a Workers AI API Token.

    • Review the prefilled information.

    • Select Create API Token.

    • Select Copy API Token.

    • Save that value for future use.

  • For Get Account ID, copy the value for Account ID. Save that value for future use.

  • After creating your API token, authenticate and make requests to the Worker AI API using your API token in the request.

    Cloudflare also supports OpenAI compatible endpoints for text generation (/v1/chat/completions)

    Step 1. Create a Cloudflare Account

    Step 2. Get Cloudflare API token and Account ID

    Data Usage
    Pricing Plans
    here
    Cloudflare account

    3. Run Gemma-SEA-LION-v4-27B-IT via Cloudflare Workers AI API

    Context length: 128k tokens

  • Language(s) (NLP): Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese

  • License: Gemma Terms of Use

  • Finetuned from model: Gemma-SEA-LION-v4-27B-IT

  • Carbon Emitted: appx. 27 kg CO2 e

    Model Details

    Model Description

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    How to Get Started with the Model

    Training Details

    Training Data

    Training Procedure

    Training Hyperparameters

    Environmental Impact

    More Information

    leaderboard
    SEA-LION v4 VL new members
    Machine Learning Impact calculator
    Lacoste et al. (2019)

    Run with Uvicorn

    Run with Docker Compose

    Test the APIs

    Demo

    Links

    https://github.com/aisingapore/bedrock-access-gateway
    guide
    foundation models
    access keys
    previous guide
    Python library for OpenAI API
    https://huggingface.co/aisingapore
    https://github.com/aisingapore/bedrock-access-gateway
    https://github.com/aisingapore/bedrock-access-gateway?tab=readme-ov-file#deployment
    Singapore NRF
  • Shared by: AI Products Pillar, AI Singapore

  • Model type: Decoder

  • Context length: 128k tokens

  • Language(s) (text): Burmese, English, Indonesian, Malay, Tagalog, Tamil, Thai, and Vietnamese

  • License:

    • Qwen : Apache-2.0

    • Llama : Llama 3.1 Community License

  • Finetuned from model: aisingapore/Qwen-SEA-LION-v4-4B-VL, aisingapore/Qwen-SEA-LION-v4-8B-VL and aisingapore/Llama-SEA-LION-v3-8B-IT

  • Qwen and Llama SEA-Guard models are available for download via the following channels:

    • Qwen-SEA-Guard-4B-040226

    • Qwen-SEA-Guard-8B-040226

    • Llama-SEA-Guard-8B-040226

    Repository: 🤗HuggingFace SEA-Guard Collection

    This model is optimized to return a binary classification in text form: ["safe", "unsafe"]. However, users must be aware that the model is subject to the limitations common to generative AI, including the potential to hallucinate or generate ungrounded, irrelevant text. Due to these inherent risks, human oversight is advised, and the model’s outputs should not be treated as absolute determinations without secondary verification.

    The output of the model is only "safe" or "unsafe". Users can directly use it without any finetune or in-context learning since it is already trained with cultural safety for SEA contexts.

    Users can also continue training this model further on the target tasks, e.g., vision-text safety datasets. Also, this model is supported by vLLM for fast inference.

    For more details on training data, please refer to the paper SEA-Guard.

    We employ a supervised-finetuning technique (SFT) on Llama-factory with the following hyperparameters.

    We use SEA-SafeguardBench to evaluate our SEA-Guard. Note that we also evaluated the vision-text safety classification in our research paper

    BibTeX:

    This is the repository for the commercial instruction-tuned model. Notwithstanding the model's safety-aligned training, developers and users are advised to conduct their own safety fine-tuning and implement appropriate 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.

    sealion@aisingapore.org

    Model Details

    Model Description

    aisingapore/Qwen-SEA-LION-v4-4B-VL
    aisingapore/Qwen-SEA-LION-v4-8B-VL
    aisingapore/Llama-SEA-LION-v3-8B-IT
    SEA-Guard

    Download the Models

    Intended Uses and Limitations

    Uses

    Direct Use

    Downstream Use

    Training and evaluation data

    Training procedure

    Testing Data, Factors & Metrics

    Citation

    More Information

    Contact

    Funded by: Singapore NRF
  • Shared by: AI Products Pillar, AI Singapore

  • Model type: Decoder

  • Context length: 128k tokens

  • Language(s) (text): Burmese, English, Indonesian, Malay, Tagalog, Tamil, Thai, and Vietnamese

  • License: Gemma

  • Finetuned from model: Gemma 3 12B IT

    • Repository: 🤗HuggingFace SEA-Guard Collection

    This model is optimized to return a binary classification in text form: ["safe", "unsafe"]. However, users must be aware that the model is subject to the limitations common to generative AI, including the potential to hallucinate or generate ungrounded, irrelevant text. Due to these inherent risks, human oversight is advised, and the model’s outputs should not be treated as absolute determinations without secondary verification.

    The output of the model is only "safe" or "unsafe". Users can directly use it without any finetune or in-context learning since it is already trained with cultural safety for SEA contexts. We also release the API of this model at sea-lion.ai.

    Users can also continue training this model further on the target tasks, e.g., vision-text safety datasets. Also, this model is supported by vLLM for fast inference.

    For more details on training data, please refer to the paper SEA-Guard.

    We employ a supervised-finetuning technique (SFT) on Llama-factory with the following hyperparameters.

    We use SEA-SafeguardBench to evaluate our SEA-Guard. Note that we also evaluated the vision-text safety classification in our research paper

    AUPRC is the primary metric to evaluate the safety classification of our models.

    BibTeX:

    This is the repository for the commercial instruction-tuned model. Notwithstanding the model's safety-aligned training, developers and users are advised to conduct their own safety fine-tuning and implement appropriate 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.

    sealion@aisingapore.org

    Model Details

    Model Description

    Gemma-based model
    sea-lion api key manager
    Gemma 3 12B IT
    SEA-Guard

    Model Sources

    Intended Uses and Limitations

    Uses

    Direct Use

    Downstream Use

    Training and Evaluation Data

    Training Procedure

    Testing Data, Factors & Metrics

    Metrics

    Citation

    More Information

    Contact

    CUDA drivers version 12 installed

    To get started, you will need to create an environment and install vLLM. The steps below outline how to install and use uv as the package manager, and then proceeding to install vLLM.

    1. Navigate to the desired base directory. In this guide, the base folder is assumed to be /home/sealion-user.

    1. Create a new working directory and enter it

    1. Initialize uv

    1. Add the vllm dependency

    1. Clone vllm github repository and rename the top-level directory to vllm_code. The renaming is necessary to prevent Python from importing modules from the vllm repository directory instead of the packages installed in the environment.

    The steps below outline how to host a vLLM service using GPUs.

    1. Navigate to working directory and activate environment:

    1. Set relevant values of environment variables. It is necessary to set VLLM_CACHE_ROOT to prevent errors arising from insufficient disk space as a result of using the default vLLM cache directory:

    1. Start the server with the desired model. The aisingapore/Gemma-SEA-LION-v4-27B-IT model is used in this example.

    Alternatively, the server can be started with the below command:

    1. Create a python script main.py similar to the following:

    1. Run the python script. The following assumes it is called main.py.

    You can also query the model with input prompts using curl method:

    The output obtained should be similar to the following:

    Prerequisites

    Environment Setup

    Model Deployment using vLLM

    curl https://api.cloudflare.com/client/v4/accounts/{$CLOUDFLARE_ACCOUNT_ID}/ai/run/@cf/aisingapore/gemma-sea-lion-v4-27b-it \
      -X POST \
      -H 'Authorization: Bearer {$CLOUDFLARE_AUTH_TOKEN}' \
      -d '{
        "messages": [
            {
                "role": "system",
                "content": "You are a friendly assistant"
            },
            {
                "role": "user",
                "content": "Tell me a Singlish joke!"
            }
        ],
        "stream": false
        }'
    import os
    import requests
    
    ACCOUNT_ID = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
    AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
    
    prompt = "Tell me a Singlish joke"
    response = requests.post(
      f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/aisingapore/gemma-sea-lion-v4-27b-it",
        headers={"Authorization": f"Bearer {AUTH_TOKEN}"},
        json={
          "messages": [
            {"role": "system", "content": "You are a friendly assistant"},
            {"role": "user", "content": prompt}
          ]
        }
    )
    completion = response.json()
    print(completion["result"]["choices"][0]["message"]["content"])
    curl --request POST \
      --url https://api.cloudflare.com/client/v4/accounts/{$CLOUDFLARE_ACCOUNT_ID}/ai/v1/chat/completions \
      -H 'Authorization: Bearer {$CLOUDFLARE_AUTH_TOKEN}' \
      -H 'Content-Type: application/json' \
      -d '{
          "model": "@cf/aisingapore/gemma-sea-lion-v4-27b-it",
          "messages": [
            {
              "role": "user",
              "content": "Tell me a Singlish joke"
            }
          ]
        }'
    from openai import OpenAI
    
    ACCOUNT_ID = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
    AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
    
    client = OpenAI(
        api_key=AUTH_TOKEN,
        base_url=f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/v1" 
    )
    
    completion = client.chat.completions.create(
        model="@cf/aisingapore/gemma-sea-lion-v4-27b-it",
        messages=[
            {
                "role": "user",
                "content": "Tell me a Singlish joke!"
            }
        ]
    )
    
    print(completion.choices[0].message.content)
    from transformers import pipeline
    import torch
    
    pipe = pipeline(
        "image-text-to-text",
        model="aisingapore/Gemma-SEA-LION-v4-27B-VL",
        device="cuda",
        torch_dtype=torch.bfloat16
    )
    
    messages = [
        {
            "role": "system",
            "content": [{"type": "text", "text": "You are a helpful assistant."}]
        },
        {
            "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?"}
            ]
        }
    ]
    
    output = pipe(text=messages, max_new_tokens=200)
    print(output[0]["generated_text"][-1]["content"])
    
    git clone https://github.com/aisingapore/bedrock-access-gateway.git
    cd bedrock-access-gateway/src
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    uvicorn api.app:app --host 0.0.0.0 --port 8000
    docker compose up
    curl http://localhost:8000/api/v1/models -H "Authorization: Bearer bedrock"
    curl http://localhost:8000/api/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer bedrock" \
    -d '{
      "model": "arn:aws:bedrock:<AWS_REGION>:<ACCOUNT_ID>:imported-model/<MODEL_ID>",
      "messages": [
        {
          "role": "user",
          "content": "Kalau orang sedang di GBK, biasanya sedang apa dia?"
        }
      ]
    }'
    python sealion_bedrock.py --api
    @misc{tasawong2026seaguardculturallygroundedmultilingual,
          title={SEA-Guard: Culturally Grounded Multilingual Safeguard for Southeast Asia}, 
          author={Panuthep Tasawong and Jian Gang Ngui and Alham Fikri Aji and Trevor Cohn and Peerat Limkonchotiwat},
          year={2026},
          eprint={2602.01618},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2602.01618}, 
    }
    @misc{tasawong2026seaguardculturallygroundedmultilingual,
          title={SEA-Guard: Culturally Grounded Multilingual Safeguard for Southeast Asia}, 
          author={Panuthep Tasawong and Jian Gang Ngui and Alham Fikri Aji and Trevor Cohn and Peerat Limkonchotiwat},
          year={2026},
          eprint={2602.01618},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2602.01618}, 
    }
    cd /home/sealion-user
    mkdir sealion_test && cd sealion_test
    uv init
    uv add vllm
    git clone https://github.com/vllm-project/vllm.git && mv vllm vllm_code
    cd /home/sealion-user/sealion_test && source/.venv/bin/activate
    export CUDA_VISIBLE_DEVICES=0
    export VLLM_CACHE_ROOT=/home/sealion-user/sealion_test/
    python -m vllm.entrypoints.openai.api_server --model aisingapore/Gemma-SEA-LION-v4-27B-IT
    vllm serve aisingapore/Gemma-SEA-LION-v4-27B-IT
    import requests
    
    response = requests.post(
        "http://localhost:8000/v1/completions",
        headers={"Content-Type": "application/json"},
        json={
            "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT",
            "prompt": "Prove or give a counter-example of the Birch and Swinnerton-Dyer conjecture.",
            "max_tokens": 3200,
            "temperature": 0.7,
        }
    )
    print(response.json())
    python main.py
    curl http://localhost:8000/v1/completions \
        -H "Content-Type: application/json" \
        -d '{
            "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT",
            "prompt": "Prove or give a counter-example of the Birch and Swinnerton-Dyer conjecture.",
            "max_tokens": 3200,
            "temperature": 0.7
        }'
    {'id': 'cmpl-7f41c8ff4bc9428e91505548b508747a', 'object': 'text_completion', 'created': 1755826519, 'model': 'aisingapore/Gemma-SEA-LION-v4-27B-IT', 'choices': [{'index': 0, 'text': '\n\nThe Birch and Swinnerton-Dyer (BSD) conjecture is one of the most important unsolved problems in mathematics. It relates the arithmetic of an elliptic curve to the analytic behavior of its L-function.\n\n**Statement of the Conjecture:**\n\nLet E be an elliptic curve defined over the rational numbers. Let L(E, s) be the L-function of E, which is a complex function defined for Re(s) > 1 by an Euler product.  The L-function can be analytically continued to the entire complex plane.\n\nThe conjecture states that:\n\n1. **The L-function L(E, s) has a pole at s = 1 if and only if E(Q) is finite.**  In other words, the L-function has a simple pole at s=1 if and only if the elliptic curve has finitely many rational points. If E(Q) is infinite, the L-function is analytic at s=1.\n\n2. **If the L-function has a pole at s = 1, the order of the pole is equal to the rank of the Mordell-Weil group E(Q).**  The rank of E(Q) is the dimension of the Mordell-Weil group, which measures the number of independent points of infinite order on the elliptic curve.\n\n3. **A precise formula relating the leading coefficient of the Taylor series of L(E, s) at s = 1 to several arithmetic invariants of E.** Specifically, if r is the rank of E(Q), then\n\n   lim_{s → 1} (s - 1)^r L(E, s) =  Ω_E * R_E *  ∏_{p | N} c_p *  |Sha(E)| / |E(Q)_{tor}|^2\n\n   where:\n    * Ω_E is the real period of E.\n    * R_E is the regulator of E.\n    * N is the conductor of E.\n    * c_p are the Tamagawa numbers at the primes p dividing N.\n    * Sha(E) is the Tate-Shafarevich group of E, which measures the failure of the Hasse principle.\n    * E(Q)_{tor} is the torsion subgroup of E(Q).\n\n**Status of the Conjecture:**\n\n* **Unproven:** The BSD conjecture remains unproven in general. It is considered one of the seven Millennium Prize Problems, with a $1 million reward for a correct proof.\n* **Partial Results:** Significant progress has been made:\n    * **Kolyvagin (1988):** Proved that if E has rank 0, then L(E, s) has a simple pole at s = 1.\n    * **Gross-Zagier (1986):** Proved the first half of BSD for elliptic curves with complex multiplication (CM curves). This result established the connection between the arithmetic invariants and the analytic behavior for a specific class of elliptic curves.\n    * **Rank 1 Curves:** Significant progress has been made towards proving BSD for rank 1 curves.\n    * **Taylor-Wiles-Katz:** Established modularity theorems, which are crucial for understanding the L-functions of elliptic curves.\n\n**Counter-Example?**\n\nThere are **no known counter-examples** to the BSD conjecture.  All the evidence so far supports its validity. However, the conjecture is incredibly difficult to prove, and the complexity of the terms involved makes it a formidable challenge.\n\n**Why can\'t I "prove or give a counter-example"?**\n\nThe difficulty lies in the following:\n\n* **Calculating L(E, s):** Computing the L-function to a high enough degree of accuracy to determine its behavior at s=1 is extremely challenging, even for relatively simple elliptic curves.\n* **Determining the Rank:** Finding the rank of an elliptic curve is also a difficult problem.\n* **Tate-Shafarevich Group:** The Tate-Shafarevich group Sha(E) is notoriously hard to compute. It is conjectured to be finite for all elliptic curves, but this remains unproven.\n* **Complex Analytic Continuation:** Understanding the analytic continuation of the L-function is also a complex problem.\n\n**In conclusion:**\n\nThe Birch and Swinnerton-Dyer conjecture is a profound statement about the deep connection between arithmetic and analysis.  Despite decades of research, it remains unproven.  There are no known counter-examples, and considerable evidence supports its truth.  A proof (or disproof) would be a major breakthrough in number theory.  Therefore, I cannot provide a proof or a counter-example. The best I can do is state the conjecture and summarize its current status.\n', 'logprobs': None, 'finish_reason': 'stop', 'stop_reason': 106, 'prompt_logprobs': None}], 'service_tier': None, 'system_fingerprint': None, 'usage': {'prompt_tokens': 20, 'total_tokens': 1020, 'completion_tokens': 1000, 'prompt_tokens_details': None}, 'kv_transfer_params': None}

    E2B

    128K

    SFT¹ of gemma-4-E2B-it

    Instruct, GGUF

    27B

    262K

    SFT¹ of Qwen3.6-27B

    Instruct, SpecDecoder, GGUF

    4B

    128K

    SFT¹ of Gemma 3 4B IT

    VLM

    8B

    65K

    SFT¹ of Apertus-8B-Instruct-2509

    Instruct, Reasoning

    4B, 8B

    256K

    SFT¹ of Qwen3-VL-4B-Instruct, Qwen3-VL-8B-Instruct

    VLM

    27B

    128K

    CPT² of Gemma 3 27B IT

    Base, Instruct, GGUF, NVFP4, FP8_Dynamic

    27B

    128K

    SFT¹ of Gemma-SEA-LION-v4-27B-IT

    VLM

    32B

    128K

    SFT¹ of Qwen3-32B

    Instruct, GPTQ-4BIT, GPTQ-8BIT

    8B

    128K

    SFT¹ of Llama-SEA-LION-v3-8B-IT

    Reasoning, GGUF

    70B

    128K

    SFT¹ of Llama-SEA-LION-v3-70B-IT

    Reasoning, GGUF

    9B

    8192

    CPT² of Gemma2

    Base, Instruct, GGUF

    8B

    128K

    CPT² of Llama 3.1 8B

    Base, Instruct, GGUF

    70B

    128K

    CPT² of Llama 3.1 70B

    Base, Instruct, GGUF

    8B

    8192

    CPT² of Llama3

    Base, Instruct, GGUF

    3B

    2048

    Pre-training from scratch

    Base

    7B

    2048

    Pre-training from scratch

    Instruct

    300M, 600M

    8K

    ModernBERT from scratch

    Base-Embedding, Checkpoints

    300M, 600M

    8K

    SFT¹ of SEA-LION-ModernBERT-Embedding

    Tuned-Embedding

    600M

    512

    SFT¹ of E5-Large

    Tuned-Embedding

    4B, 8B

    128K

    SFT¹ of Qwen-SEA-LION-v4-4B-VL, Qwen-SEA-LION-v4-8B-VL

    VLM

    8B

    128K

    SFT¹ of Llama-SEA-LION-v3-8B-IT

    Instruct

    12B

    128K

    SFT¹ of Gemma 3 12B IT

    VLM

    In v3.5, ability to handle reasoning tasks, with the versatility of handling general tasks as well while maintaining similar performance with state-of-the-art models.

  • In v4, our first multimodal SEA-LION models, extending capabilities beyond text to handle image + text inputs with massive 256K native context windows and specialized regional OCR, while continuing our focus on Southeast Asian languages, culture, and use cases.

  • In v4.5, rapid specialization of state-of-the-art open foundation models via knowledge distillation and model merging, delivering high-capacity reasoning and agentic tool-use capabilities alongside speed-optimized booster configurations for low-latency production deployment.

  • In v4.8, extended language coverage across 13 regional languages—including Burmese, Malay, and key sub-national languages—paired with advanced post-training for enhanced multi-turn chat and instruction-following, rigorously benchmarked under the upgraded SEA-HELM suite with deeper cultural competence (KALAHI) and country-entity knowledge evaluation.

  • SEA-LION-Guard v2

    31B

    256K

    SFT¹ of gemma-4-31B-it (Latest)

    Instruct

    E4B, E2B

    128K

    SFT¹ of gemma-4-E4B-it, gemma-4-E2B-it (Latest)

    Instruct

    SEA-LION v4.8

    30B-A3B

    262K

    CPT²,SFT¹ of NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16

    Base, Instruct, GGUF, NVFP4, FP8

    120B-A12B

    262K

    CPT²,SFT¹ of NVIDIA-Nemotron-3-Super-120B-A12B-Base-BF16 (Latest)

    @misc{sea_lion_2024,
      title={SEA-LION (Southeast Asian Languages In One Network): A Family of Large Language Models for Southeast Asia},
      author={AI Singapore},
      year={2024},
      howpublished={\url{https://github.com/aisingapore/sealion}}
    }
    @misc{2504.05747,
          title={SEA-LION: Southeast Asian Languages in One Network},
          author={Raymond Ng and Thanh Ngan Nguyen and Yuli Huang and Ngee Chia Tai and Wai Yi Leong and Wei Qi Leong and Xianbin Yong and Jian Gang Ngui and Yosephine Susanto and Nicholas Cheng and Hamsawardhini Rengarajan and Peerat Limkonchotiwat and Adithya Venkatadri Hulagadri and Kok Wai Teng and Yeo Yeow Tong and Bryan Siow and Wei Yi Teo and Wayne Lau and Choon Meng Tan and Brandon Ong and Zhi Hao Ong and Jann Railey Montalan and Adwin Chan and Sajeban Antonyrex and Ren Lee and Esther Choa and David Ong Tat-Wee and Bing Jie Darius Liu and William Chandra Tjhi and Erik Cambria and Leslie Teo},
          year={2025},
          eprint={2504.05747},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2504.05747},
    }
    @misc{2606.03027,
          title={SEA-LION-Embedding: Open and Reproducible Text Embeddings for Southeast Asia}, 
          author={Peerat Limkonchotiwat and Raymond Ng and Sarana Nutanong and Jian Gang Ngui},
          year={2026},
          eprint={2606.03027},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2606.03027}, 
    }
    @misc{2602.01618,
          title={SEA-Guard: Culturally Grounded Multilingual Safeguard for Southeast Asia}, 
          author={Panuthep Tasawong and Jian Gang Ngui and Alham Fikri Aji and Trevor Cohn and Peerat Limkonchotiwat},
          year={2026},
          eprint={2602.01618},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2602.01618}, 
    }

    Performance and Benchmarks

    Licensing

    Community

    To Cite SEA-LION

    Acknowledgements

    Contact

    meticulously handcrafted linguistic and cultural diagnostic tests tailored to Southeast Asia
    Leaderboard
    Llama3 License
    contributing guide
    collaborations guide
    sealion@aisingapore.org

    Base, Instruct, GGUF, NVFP4, FP8

    The visual parsing capabilities in Thai, Chinese and English

    We performed post-training in English and SEA languages on Gemma-SEA-LION-v4-27B-IT, a decoder model using the Gemma 3 architecture, to create Gemma-SEA-LION-v4-4B-VL.

    For tokenization, the model employs the default tokenizer used in gemma-3-4b-it.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Decoder

    • Context length: 128k tokens

    • Language(s) (NLP): fine-tuned on Burmese, English, Khmer, Malay, Tagalog and Tamil

    • License:

    • Finetuned from model:

    As of Feb 2026, Gemma-SEA-LION-v4-4B-VL outperforms other open models in the small parameter class on SEA tasks, achieving performance comparable to larger, proprietary models. For detailed rankings, please refer to the leaderboard.

    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.

    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 text capability, Gemma-SEA-LION-v4-4B-VL has been trained and fine-tuned exclusively on the vision-text backend. As a result, its text capabilities are expected to be comparable to those of Gemma-SEA-LION-v4-27B-IT, and may not exhibit significant improvements or differences in this area.

    Use the code below to get started with the model using the 🤗 Transformers library.

    The instruction fine-tuning text dataset comprises of a collection of OSS & synthetic data. The datasets used for post-training can be accessed via the link below.

    Datasets for Instruction Fine Tuning:

    • 🤗aisingapore/SEA-Instruct-2602

    Datasets for Tool-calling:

    • 🤗allenai/Dolci-Instruct-SFT-Tool-Use

    • 🤗Agent-Ark/Toucan-1.5M

    Datasets for Reinforcement Learning:

    • 🤗nvidia/Nemotron-Cascade-RL-Instruction-Following

    • 🤗openai/gsm8k

    • Training regime: Our post-training workflow consists of Instruction Fine-tuning, Model Merging and Reinforcement Learning.

    For details on Gemma-SEA-LION-v4-4B-VL performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    • Hardware Type: Nvidia H200 140GB GPUs

    • Cloud Provider: SMC H200

    • Compute Region: Singapore

    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.

    pip install transformers>=4.50.0
    
    from transformers import pipeline
    import torch
    
    pipe = pipeline(
        "image-text-to-text",
        model="aisingapore/Gemma-SEA-LION-v4-4B-VL",
        device="cuda",
        torch_dtype=torch.bfloat16
    )
    messages = [
      {
          "role": "system",
          "content": [{"type": "text", "text": "You are a helpful assistant."}]
      },
      {
          "role": "user",
          "content": [
              {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
              {"type": "text", "text": "Response in Indonesian. What animal is on the candy? Describe in Indonesian and English."}
          ]
      }
    ]
    
    output = pipe(text=messages, max_new_tokens=200)
    print(output[0]["generated_text"][-1]["content"])
    # Okay, let's take a look!
    # Based on the image, the animal on the candy is a **turtle**.
    # You can see the shell shape and the head and legs.
    

    Model Details

    Model Description

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    How to Get Started with the Model

    Training Details

    Training Data

    Training Procedure

    Training Hyperparameters

    Hardware

    More Information

    SEA-HELM

    SEA-HELM (Southeast Asian Holistic Evaluation of Language Models) is a comprehensive benchmark suite designed to evaluate the linguistic and cultural competencies of Large Language Models (LLMs) in Southeast Asian (SEA) languages.

    Formerly known as BHASA, SEA-HELM has been expanded and integrated with HELM to provide a more rigorous and authentic evaluation. It addresses the critical need for multilingual and multicultural benchmarks in the rapidly evolving field of LLMs.

    SEA-HELM serves as a valuable resource for developers looking to create and assess LLMs for linguistic accuracy and cultural sensitivity in the Southeast Asian context. It currently covers Filipino, Indonesian, Javanese, Sundanese, Tamil, Thai, and Vietnamese.

    Motivations

    Several key factors motivated our development of SEA-HELM:

    Lack of Comprehensive SEA Language Benchmarks

    Existing LLM benchmarks are capable of evaluating specific capabilities of LLMs in English and some mid- to low-resource languages, including those in the Southeast Asian (SEA) region. However, there has not been a comprehensive and authentic evaluation suite developed specifically for SEA languages, a problem exacerbated by the lack of both training and testing data on the internet.

    Need for Multilingual and Multicultural Evaluations

    There's an increasing need for benchmarks that assess not only linguistic capabilities but also cultural representation and sensitivity. Evaluations of linguistic and cultural representation are essential for gauging the efficacy and fairness of language models.

    SEA-HELM deliberately incorporates community participation by involving native speakers to ensure linguistic accuracy and cultural authenticity. For example, the evaluation suite includes a cultural evaluation dataset for Filipino developed in collaboration with community members from the Philippines.

    Core Pillars of SEA-HELM

    SEA-HELM is organized into five core evaluation pillars, designed to comprehensively assess various competencies of LLMs.

    Each evaluation task under SEA-HELM uses prompts in the target language to ensure that the LLM can interpret native instructions correctly. The datasets used are either originally written in the native language or carefully translated by native speakers to avoid translation errors. This ensures that the evaluation is authentic and relevant to the linguistic nuances of each language.

    This pillar focuses on evaluating the fundamental natural language processing abilities of LLMs in Southeast Asian languages, such as language understanding, generation, and reasoning.

    NLU tasks assesses the model's ability to comprehend text. The tasks included in this competency are question answering and sentiment analysis.

    • Question Answering (QA) evaluates the model's ability to understand a question and extract the answer from a given text. SEA-HELM uses datasets like TyDi QA for Indonesian, XQuAD for Vietnamese and Thai, and IndicQA for Tamil. The models are prompted to answer questions by extracting the answer from a provided paragraph.

    • Sentiment Analysis: determines sentiment expressed in a text. SEA-HELM uses datasets like NusaX for Indonesian, UIT-VSFC for Vietnamese, Wisesight Sentiment for Thai, and IndicSentiment for Tamil. The models are prompted to determine the sentiment of a given sentence and respond with a single word: Positive, Negative, or Neutral.

    NLG tasks evaluates a model's ability to generate human-like text. The tasks included in this competency are machine translation and abstractive summarization.

    • Machine Translation assesses the model's ability to translate text from one language to another. SEA-HELM evaluates translation between English and target SEA languages. The models are prompted to translate a given text into a specified language.

    • Abstractive Summarization requires the model to read a document, identify the key points, and summarize them into a coherent and fluent text. SEA-HELM uses the XLSum dataset for all four target languages. The models are prompted to summarize an article in one or two sentences in the specified language

    NLR tasks assesses the model's ability to reason and draw inferences from text. The tasks included in this competency are causal reasoning and Natural Language Inference (NLI).

    NLI tasks involve determining whether a given premise entails or contradicts a hypothesis. SEA-HELM uses datasets like IndoNLI for Indonesian, XNLI for Vietnamese and Thai, and IndicXNLI for Tamil.

    This pillar focuses on evaluating capabilities unique to LLMs, such as instruction following and chat capabilities.

    • Instruction following assesses the ability of LLMs to follow human instructions and adhere to specified formats using SEA-IFEval, a benchmark we manually created collaboratively with native speakers.

    • Chat capability evaluates the ability of LLMs to engage in human-like conversations using SEA-MTBench, another manually translated and localised version of the popular MT-Bench dataset.

    This pillar focuses on systematically diagnosing language proficiency and grammatical understanding of language models in Southeast Asian languages by utilizing LINDSEA (LINguistic Diagnostics for Southeast Asian languages).

    LINDSEA is a high-quality, manually-crafted linguistic dataset designed to provide a fine-grained evaluation of a model’s linguistic abilities, and is the first dataset of its kind created for SEA languages.

    This pillar is designed to assess cultural representation and sensitivity in language models. This pillar recognizes the importance of evaluating LLMs on their understanding and appropriate handling of cultural nuances, social norms, and values specific to Southeast Asian cultures.

    SEA-HELM uses cultural diagnostics to probe for both cultural representation and sensitivity. The goal is to ensure that LLMs used in SEA contexts are not only linguistically accurate but also culturally aware and respectful.

    SEA-HELM achieves authentic cultural representation through a strong participatory approach that includes native speaker communities. For example, SEA-HELM includes a cultural evaluation dataset for Filipino developed in collaboration with community members from the Philippines, which resulted in KALAHI.

    This pillar ensures that language models (LLMs) do not produce harmful or unsafe outputs, especially in the context of Southeast Asian (SEA) languages and cultures. It recognizes that multilingual inputs, particularly in lower-resource languages common in the SEA region, can increase the likelihood of LLMs generating unsafe responses. The pillar aims to protect users interacting with these models in SEA languages from issues like hate speech.

    Currently, the Safety pillar focuses on toxicity detection as its primary task, with coverage for Indonesian, Thai, Vietnamese, and Filipino. This involves identifying toxic content such as hate speech and abusive language in text, which is crucial for content moderation. SEA-HELM uses datasets like MLHSD for Indonesian, Thai Toxicity Tweet for Thai, ViHSD for Vietnamese, and PH Elections Toxicity for Filipino.

    While passing these evaluations is a necessary step, it is not a guarantee of complete safety in real-world scenarios, as it is impossible to cover every type of unsafe response. SEA-HELM plans to expand this pillar to include a broader range of safety-related tasks in the future.

    To provide transparency, comparative insights and understanding of models' multilingual and multicultural performance, SEA-HELM maintains a .

    The offers multiple views, including overall scores, language-specific scores, and detailed task scores, allowing users to delve deeper into the evaluation results.

    The full codebase for SEA-HELM is provided open-source on .

    Our SEA-HELM evaluation datasets are publicly available on .

    While SEA-HELM aims for holistic evaluations, it is not yet exhaustive in its coverage of languages and tasks. Areas for improvement include:

    • Expanding SEA language coverage beyond the current seven languages (e.g., Burmese, Khmer, Lao).

    • Exploring automatic LLM evaluations for better benchmarking.

    • Enhancing the safety pillar to include more real-world risk factors.

    • Adding more cultural and linguistic assessments

    For more details and information on SEA-HELM, you can refer to the following materials:

    Google Vertex AI

    A step-by-step guide to deploying AI Singapore's SEA-LION models to run as an endpoint on Google's Vertex AI.

    1. Go to Google's Model Garden

    2. Scroll down (in the main page) to the "All Partners" section, and click on "Hugging Face".

    3. Set the “Filter by Name” to “aisingapore”. A list of SEA-LION models will appear.

    1. Click the model you wish to deploy, and a side panel will pop up. Here you can set the name of your endpoint, select the region and machine spec to deploy the model to. Then click on Deploy to complete the deployment.

      (Note: make sure you have enough hardware quota in your selected region)

    1. The deployment takes some time (depending on the size of the model). When done, you will see the deployed endpoint in your

      Take note of your endpoint ID.

    1. To test your deployed endpoint using a Python program,

      a. Get a Vertex AI service key from your administrator, or create one yourself if you have the right permissions on GCP.

      b. Install the for your system.

      c. Make sure your Google Cloud SDK is properly installed and authenticated by running the following command: gcloud auth login

      d. Create a new Python environment and install the following packages: pip install google-cloud-aiplatform openai

    2. Create a Python program vt-test.py containing the following code:

    1. Make sure your Vertex AI service key JSON file (named vt-svc-key.json) is in the same directory as your Python program.

    2. Run your program python vt-test.py and see the result:

    1. Below is a sample bash script curl_test.sh for calling the endpoint via CLI using curl:

    When run,

    Amazon Bedrock Custom Model Import

    The SEA-LION models are open source and freely available for research and commercial use. A common question we receive from developers is how to host and configure SEA-LION for model inference in their own environments. When it comes to deploying our models, organizations have several hosting options available to them. One such approach involves using the Custom Model Import feature in Amazon Bedrock, which allows for integration within Amazon’s cloud infrastructure.

    At the time of writing, the supported model architectures include Llama 3 and Llama 3.1. The Llama-SEA-LION-v3-8B-IT and Llama-SEA-LION-v3-70B-IT models are supported. The SEA-LION models not built using the Llama architecture (such as Gemma2 and MPT) are not supported.

    This article outlines the process of importing the SEA-LION model into Amazon Bedrock and includes a demo application that integrates with the imported model.

    Prerequisites

    If you do not already have an Amazon Web Services (AWS) account, please sign up first.

    Note that in following this guide, the following AWS services are paid services and will incur costs:

    • Amazon Bedrock

    • Amazon S3

    Please check that the following are installed on your development machine.

    is a fully managed service that simplifies the deployment and scaling of AI models. It provides access to high-performing foundation models, enabling a serverless experience for model deployment and integration. With Custom Model Import, users can upload their own models and use a unified platform for AI development.

    There is no charge to import a custom model to Bedrock. Once you import a model, you will be able to access it on-demand without requiring to perform any control plane action.

    You are only charged for model inference, based on the number of copies of your custom model required to service your inference volume and the duration each model copy is active, billed in 5-minute windows.

    A model copy is a single instance of an imported model ready to serve inference requests. The price per model copy per minute depends on factors such as architecture, context length, AWS Region, compute unit version (hardware generation), and is tiered by model copy size.

    A monthly storage cost per Custom Model Unit is applicable. The Custom Model Units needed to host a model depend on a variety of factors — notably the model architecture, model parameter count, and context length. The exact number of Custom Model Units needed will be determined at the time of import.

    Please refer to the page, including the Custom Model Import pricing under the Pricing Details section, for the latest information.

    The model used in this guide is . This section describes the steps to import the model.

    Upload the contents of to an Amazon S3 bucket. Please take note of the .

    As the time of writing, Amazon Bedrock Custom Model Import is supported in the us-east-1 (N. Virginia) and us-west-2 (Oregon) regions. Please check the for the latest information.

    Select a supported region in the AWS Console. Navigate to Amazon Bedrock, Imported Models. Click the Import Model button.

    Input the model name and the S3 location of the uploaded model. Update the other accordingly. Click Import Model to start the import.

    After the import is completed, locate the model in Imported models.

    Click the copy button to copy the ARN (Amazon Resource Name).

    The demo application uses the to integrate with the imported model.

    Clone the . The repository is a fork to include a functional demo and to support the imported models via the gateway.

    Navigate to the demo directory.

    Copy the environment file.

    Edit the value of ENDPOINT_ARN in the environment file and paste the ARN of the imported model.

    Edit the value of AWS_REGION (e.g. us-east-1) in the environment file to match the region where the model was imported.

    Before running the demo, it is a good practice to create a virtual environment to isolate the app. Please follow these steps to create a virtual environment, or feel free to use your preferred tool.

    Initialise the virtual environment.

    Activate the virtual environment.

    Install the packages.

    Set up the Boto3 credentials:

    Run the demo.

    Amazon Bedrock Custom Model Import optimizes the hardware utilization by removing the models that are not active. The demo might throw an exception that indicates the model is not ready for inference. Please refer to and customize your applications to handle it gracefully.

    The demo uses the to integrate with the imported model. If you are looking for how to work with OpenAI-compatible APIs, given their popularity, please refer to the next .

    • SEA-LION models on Hugging Face:

    • Import a customized model into Amazon Bedrock:

    Llama-SEA-LION-v3.5-8B

    Llama-SEA-LION-v3.5-8B-R is a hybrid model offering versatile functionality, handling both complex reasoning tasks and general text generation, with mode selection managed through the tokenizer's chat template.

    We performed instruction tuning in English and also in SEA languages such as Filipino, Indonesian, Tamil, Thai and Vietnamese on our , a decoder model using the Llama 3.1 architecture, to create Llama-SEA-LION-v3.5-8B-R.

    By leveraging on SEA-LION v3’s strong foundation, Llama-SEA-LION-v3.5-8B-R ensures broader accessibility and usability, empowering diverse communities and use cases throughout the region. It is particularly suited for cost-efficient, low-latency applications where regional language support and advanced reasoning is critical.

    For tokenisation, the model employs the default tokenizer used in Llama 3.1 70B Instruct. The model has a context length of 128k.

    At a glance:

    • Model type: Decoder

    Llama-SEA-LION-v3.5-70B

    Llama-SEA-LION-v3.5-70B-R is a hybrid model offering versatile functionality, handling both complex reasoning tasks and general text generation, with mode selection managed through the tokenizer's chat template.

    We performed instruction tuning in English and also in SEA languages such as Filipino, Indonesian, Tamil, Thai and Vietnamese on our , a decoder model using the Llama 3.1 architecture, to create Llama-SEA-LION-v3.5-70B-R.

    By leveraging on SEA-LION v3’s strong foundation, Llama-SEA-LION-v3.5-70B-R ensures broader accessibility and usability, empowering diverse communities and use cases throughout the region. It is particularly suited for knowledge-intensive tasks, and for high-demand environments where advanced reasoning and comprehensive language comprehension are essential.

    For tokenisation, the model employs the default tokenizer used in Llama 3.1 70B Instruct. The model has a context length of 128k.

    At a glance:

    • Model type: Decoder

    Gemma Terms of Use
    gemma-3-4b-it

    1. NLP Classics

    Natural Language Understanding (NLU)

    Natural Language Generation (NLG)

    Natural Language Reasoning (NLR)

    2. LLM-Specifics

    3. SEA Linguistics

    4. SEA Culture

    5. Safety

    SEA-HELM Leaderboard

    SEA-HELM Datasets and Resources

    Limitations and Future Work

    Resources

    public leaderboard
    leaderboard
    Github
    HuggingFace
    BHASA: A Holistic Southeast Asian Linguistic and Cultural Evaluation Suite for Large Language Models
    SEA-HELM: Southeast Asian Holistic Evaluation of Language Models
    Towards fair and comprehensive multilingual LLM benchmarking
    SEA-LION v4.5
    SEA-LION v4
    SEA-LION v3.5
    SEA-LION v3
    SEA-LION v2
    SEA-LION v1
    SEA-LION Embedding
    SEA-GUARD (renamed as SEA-LION-GUARD v1)
    Endpoints page
    Google Cloud SDK

    Amazon Bedrock

    Pricing Model of Custom Model Import

    Import the SEA-LION Model

    Demo

    Exception Handling

    Further Work

    Links

    Git
    Python
    Amazon Bedrock
    Amazon Bedrock Pricing
    Llama-SEA-LION-v3-8B-IT
    https://huggingface.co/aisingapore/Llama-SEA-LION-v3-8B-IT
    Amazon S3 Pricing
    Amazon Bedrock documentation
    settings
    Amazon Bedrock Runtime
    repository
    https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
    https://docs.aws.amazon.com/bedrock/latest/userguide/invoke-imported-model.html#handle-model-not-ready-exception
    AWS SDK
    guide
    https://huggingface.co/aisingapore
    https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html
    import openai
    import os
    from google.auth import default
    import google.auth.transport.requests
    
    # Set the path to your service account key file
    os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'vt-svc-key.json'
    
    PROJECT_ID = "<your GCP project ID>"
    LOCATION = "<region of your deployed endpoint>"
    ENDPOINT = "Your endpoint ID (from the above screenshot)"
    
    # Get access token
    # Note: the credential lives for 1 hour by default, and must be refreshed after expiration
    # (https://cloud.google.com/docs/authentication/token-types#at-lifetime);
    
    credentials, _ = default(scopes=["https://www.googleapis.com/auth/cloud-platform"])
    credentials.refresh(google.auth.transport.requests.Request())
    
    client = openai.OpenAI(
        base_url = f"https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/endpoints/{ENDPOINT}",
        api_key = credentials.token,
    )
    
    msg = "Write me a 5-line limerick"
    max_tokens = 500
    stream = False
    
    resp = client.chat.completions.create(
        model = "",
        messages = [ {"role": "user" , "content": msg} ],
        max_tokens = max_tokens,
        stream = stream,
    )
    print(msg)
    print(resp.choices[0].message.content)
    ❯ python vt-test.py
    Write me a 5-line limerick
    There once was a fellow so bright,
    Whose knowledge shone with great might.
    In the city so grand,
    He solved problems with hand,
    And his name echoed day and night.
    #!/bin/bash
    
    # 1. Set your variables
    export PROJECT_ID="<your GCP project ID>"
    export LOCATION="<region of your deployed endpoint>"
    export ENDPOINT_ID="Your endpoint ID (from the above screenshot)"
    
    # 2. Get a fresh access token
    export ACCESS_TOKEN=$(gcloud auth print-access-token)
    
    # 3. Define the request payload
    read -r -d '' PAYLOAD << EOM
    {
      "model": "",
      "messages": [
        {
          "role": "user",
          "content": "Write me a 5-line limerick"
        }
      ],
      "max_tokens": 500,
      "stream": false
    }
    EOM
    
    # 4. Make the curl request
    curl -X POST \
        -H "Authorization: Bearer ${ACCESS_TOKEN}" \
        -H "Content-Type: application/json" \
        "https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/endpoints/${ENDPOINT_ID}/chat/completions" \
        -d "${PAYLOAD}"
    ./curl_test.sh
    {"id":"chatcmpl-da744c88eaa848929593366bec8f8900","object":"chat.completion","created":1760605976,
    "model":"aisingapore/Gemma-SEA-LION-v4-27B-IT","choices":[{"index":0,"message":{"role":"assistant",
    "content":"There once was a baker named Sue,\nWhose bread was a wonderful hue.\nWith berries so bright,\nA delectable sight,\nAnd a taste that was lovely and new!\n",
    "refusal":null,"annotations":null,"audio":null,"function_call":null,"tool_calls":[],
    "reasoning_content":null},"logprobs":null,"finish_reason":"stop","stop_reason":106}],
    "service_tier":null,"system_fingerprint":null,
    "usage":{"prompt_tokens":19,"total_tokens":59,"completion_tokens":40,"prompt_tokens_details":null},
    "prompt_logprobs":null,"kv_transfer_params":null}
    git clone https://github.com/aisingapore/bedrock-access-gateway.git
    cd bedrock-access-gateway/demo
    cp .env.example .env
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    python sealion_bedrock.py
    Tokenizer: Default tokenizer used in Llama 3.1 8B Instruct
  • Context Length: 128K

  • Available Formats:

    • Reasoning (Llama-SEA-LION-v3.5-8B-R)

    • GGUF (Llama-SEA-LION-v3.5-8B-R-GGUF)

  • Supported Languages:

    1. Burmese

    2. Chinese

    3. English

    4. Filipino

    5. Indonesia

    6. Javanese

    7. Khmer

    8. Lao

    9. Malay

    10. Sundanese

    11. Tamil

    12. Thai

    13. Vietnamese

  • License: Llama3.1 Community License

  • Llama-SEA-LION-v3.5-8B-R was trained with an additional series of supervised fine-tuning atop our existing Llama-SEA-LION-v3-8B-IT models across multiple stages, culminating in a final tune with distilled reasoning data of 1.5M traces from Deepseek-R1 across multiple SEA languages such as Indonesian Tamil, Thai, Tagalog and Vietnamese.

    A distinctive feature of Llama-SEA-LION-v3.5-8B-R is its dynamic reasoning toggle. By default, the model operates in a detailed reasoning mode, thoughtfully guiding users through step-by-step solutions. Users retain full control, easily switching reasoning mode off using customizable chat template configurations, allowing concise interactions suitable for straightforward queries. During the tuning process, reasoning and non-reasoning data were simultaneously incorporated, resulting in a versatile model adaptable to varied user needs.

    We also scaled up our instruction set to 30M instructions (across a training time of a month on a single node for the 70B), incorporating the latest in open-source alongside multiple rounds of synthetic aggregation and rewrite, improving the quality of its responses and leaning the model towards accounting for our region's unique cultural diversity and history. It comprises a mix of curated publicly available open source data, synthetic generations from stronger models and handwritten instructions centered around Southeast Asian culture (particularly from Project SEALD), general multilingual instruction-following and chat prompt-response pairs.

    Llama-SEA-LION-v3.5-8B-R training uniquely emphasizes region-specific data aggregation and synthetic instruction generation, undergoing multiple refinement cycles and model merging to enhance multilingual proficiency and reasoning capabilities, ensuring exceptional performance across both complex and general-purpose tasks. This ensures that Llama-SEA-LION-v3.5-8B-R maintains its superior performance while mitigating issues like catastrophic forgetting.

    We evaluated Llama-SEA-LION-v3.5-8B-R on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the SEA-HELM (also known as BHASA) evaluation benchmark 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), and linguistic diagnostics (LINDSEA).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Since Llama-SEA-LION-v3.5-8B-R is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, SEA-IFEval (based on IFEval) and SEA-MTBench (based on MT-Bench).

    As these 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.

    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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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). A tie is given a score of 0.5.

    For more details on Llama-SEA-LION-v3.5-8B-R benchmark performance, please refer to the SEA-HELM leaderboard.

    The following quantized GGUF formats of our Llama-SEA-LION-v3.5-8B-R model are available:

    • Llama-SEA-LION-v3.5-8B-R-F16

    • Llama-SEA-LION-v3.5-8B-R-Q2_K

    • Llama-SEA-LION-v3.5-8B-R-Q3_K_M

    • Llama-SEA-LION-v3.5-8B-R-Q4_0

    • Llama-SEA-LION-v3.5-8B-R-Q4_K_M

    • Llama-SEA-LION-v3.5-8B-R-Q5_0

    • Llama-SEA-LION-v3.5-8B-R-Q5_K_M

    • Llama-SEA-LION-v3.5-8B-R-Q6_K

    • Llama-SEA-LION-v3.5-8B-R-Q8_0

    Please refer to our Download the Model(s) section for more details on how to access them.

    Llama-SEA-LION-v3.5-8B-R models are available for download via the following channels:

    HuggingFace SEA-LION v3.5 Collection

    Model
    Download

    Llama-SEA-LION-v3.5-8B-R

    Llama-SEA-LION-v3.5-8B-R-GGUF

    ,

    Llama-SEA-LION-v3.5-8B-R can be run using the 🤗 Transformers library

    Llama-SEA-LION-v3.5-8B-R defaults to reasoning with thinking_mode="on" passed to the chat template. To use non-thinking mode ie. standard generations, pass thinking_mode="off" to the chat template instead.

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    Introduction

    continued pre-trained Llama-SEA-LION-v3-8B-IT
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3.5-8B-R"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3.5-70B-R"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    
    tokenizer = pipeline.tokenizer
    
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, thinking_mode="off")
    
    outputs = pipeline(
        prompt,
        max_new_tokens=256,
    )
    
    print(outputs[0]["generated_text"])

    Llama-SEA-LION-v3.5-8B-R

    Post-Training

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Llama-SEA-LION-v3.5-8B-R-GGUF

    Download the Model(s)

    Usage

    Thinking Mode Toggle

    Disclaimer

    Tokenizer: Default tokenizer used in Llama 3.1 70B Instruct

  • Context Length: 128K

  • Available Formats:

    • Reasoning (Llama-SEA-LION-v3.5-70B-R)

    • GGUF (Llama-SEA-LION-v3.5-70B-R-GGUF)

  • Supported Languages:

    1. Burmese

    2. Chinese

    3. English

    4. Filipino

    5. Indonesia

    6. Javanese

    7. Khmer

    8. Lao

    9. Malay

    10. Sundanese

    11. Tamil

    12. Thai

    13. Vietnamese

  • License: Llama3.1 Community License

  • Llama-SEA-LION-v3.5-70B-R was trained with an additional series of supervised fine-tuning atop our existing Llama-SEA-LION-v3-70B-IT models across multiple stages, culminating in a final tune with distilled reasoning data of 1.5M traces from Deepseek-R1 across multiple SEA languages such as Indonesian Tamil, Thai, Tagalog and Vietnamese.

    A distinctive feature of Llama-SEA-LION-v3.5-70B-R is its dynamic reasoning toggle. By default, the model operates in a detailed reasoning mode, thoughtfully guiding users through step-by-step solutions. Users retain full control, easily switching reasoning mode off using customizable chat template configurations, allowing concise interactions suitable for straightforward queries. During the tuning process, reasoning and non-reasoning data were simultaneously incorporated, resulting in a versatile model adaptable to varied user needs.

    We also scaled up our instruction set to 30M instructions (across a training time of a month on a single node for the 70B), incorporating the latest in open-source alongside multiple rounds of synthetic aggregation and rewrite, improving the quality of its responses and leaning the model towards accounting for our region's unique cultural diversity and history. It comprises a mix of curated publicly available open source data, synthetic generations from stronger models and handwritten instructions centered around Southeast Asian culture (particularly from Project SEALD), general multilingual instruction-following and chat prompt-response pairs.

    Llama-SEA-LION-v3.5-70B-R training uniquely emphasizes region-specific data aggregation and synthetic instruction generation, undergoing multiple refinement cycles and model merging to enhance multilingual proficiency and reasoning capabilities, ensuring exceptional performance across both complex and general-purpose tasks. This ensures that Llama-SEA-LION-v3.5-70B-R maintains its superior performance while mitigating issues like catastrophic forgetting.

    We evaluated Llama-SEA-LION-v3.5-70B-R on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the SEA-HELM (previously known as BHASA) evaluation benchmark 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), and linguistic diagnostics (LINDSEA).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Since Llama-SEA-LION-v3.5-70B-R is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, SEA-IFEval (based on IFEval) and SEA-MTBench (based on MT-Bench).

    As these 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.

    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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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). A tie is given a score of 0.5.

    For more details on Llama-SEA-LION-v3.5-70B-R benchmark performance, please refer to the SEA-HELM leaderboard.

    The following quantized GGUF formats of our Llama-SEA-LION-v3.5-70B-R model are available:

    • Llama-SEA-LION-v3.5-70B-R-F16

    • Llama-SEA-LION-v3.5-70B-R-Q2_K

    • Llama-SEA-LION-v3.5-70B-R-Q3_K_M

    • Llama-SEA-LION-v3.5-70B-R-Q4_0

    • Llama-SEA-LION-v3.5-70B-R-Q4_K_M

    • Llama-SEA-LION-v3.5-70B-R-Q5_0

    • Llama-SEA-LION-v3.5-70B-R-Q5_K_M

    • Llama-SEA-LION-v3.5-70B-R-Q6_K

    • Llama-SEA-LION-v3.5-70B-R-Q8_0

    Please refer to our Download the Model(s) section for more details on how to access them.

    Llama-SEA-LION-v3.5-70B-R models are available for download via the following channels:

    HuggingFace SEA-LION v3.5 Collection

    Model
    Download

    Llama-SEA-LION-v3.5-70B-R

    Llama-SEA-LION-v3.5-70B-R-GGUF

    ,

    Llama-SEA-LION-v3.5-70B-R can be run using the 🤗 Transformers library

    Llama-SEA-LION-v3.5-70B-R defaults to reasoning with thinking_mode="on" passed to the chat template. To use non-thinking mode ie. standard generations, pass thinking_mode="off" to the chat template instead.

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    Introduction

    continued pre-trained Llama-SEA-LION-v3-70B-IT
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3.5-70B-R"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3.5-70B-R"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    
    tokenizer = pipeline.tokenizer
    
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, thinking_mode="off")
    
    outputs = pipeline(
        prompt,
        max_new_tokens=256,
    )
    
    print(outputs[0]["generated_text"])

    Llama-SEA-LION-v3.5-70B-R

    Post-Training

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Llama-SEA-LION-v3.5-70B-R-GGUF

    Download the Model(s)

    Usage

    Thinking Mode Toggle

    Disclaimer

    Gemma-SEA-LION-v4.5

    Last update: 2026-05-19

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Gemma-SEA-LION-v4.5-E2B-IT built upon the gemma-4-E2B-it architecture with 2.3B effective (5.1B with embeddings). To ensure deep domain adaptation, the model underwent distillation from google/gemma-4-31B-it on an updated aisingapore/SEA-Instruct-2602, instilling multilingual and multicultural fluency across English and key SEA languages: Burmese, Indonesian, Filipino (Tagalog), Malay, Tamil, Thai, and Vietnamese.

    Gemma-SEA-LION-v4.5-E2B-IT inherits the following features from Gemma 4:

    • Native System Prompt Support – Gemma 4 introduces native support for the system role, enabling more structured and controllable conversations.

    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    Ollama
    Reasoning – Highly capable reasoning model, with configurable thinking modes.
  • Extended Multimodalities – Processes Text, Image with variable aspect ratio and resolution support (all models), Video, and Audio (featured natively).

  • Optimized for On-Device – designed for efficient local execution on laptops and mobile devices.

  • Enhanced Coding & Agentic Capabilities – Achieves notable improvements in coding benchmarks alongside native function-calling support, powering highly capable autonomous agents.

  • SEA-LION stands for Southeast Asian Languages In One Network.

    We performed post-training in English and SEA languages on gemma-4-E2B-it, a multimodal learning model using the Gemma 4 architecture, to create Gemma-SEA-LION-v4.5-E2B-IT.

    For tokenization, the model employs the default tokenizer used in gemma-4-E2B-it.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Transformer Decoder with Vision and Audio Encoder

    • Training Stage: Post-Training (Logit Distillation & Model Merging)

    • Context length: 128k

    • Language(s): fine-tuned on Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese

    • License:

    • Finetuned from model:

    • Repository: SEA-LION v4.5 - an aisingapore Collection

    Gemma-SEA-LION-v4.5-E2B-IT models are available for download via the following channels: 🤗HuggingFace SEA-LION v4.5 Collection

    Model
    Download

    Gemma-SEA-LION-v4.5-E2B-IT

    ,

    Gemma-SEA-LION-v4.5-E2B-IT-GGUF

    ,

    Use the code below to get started with the model with 🤗 Transformers libraries.

    The instruction fine-tuning text dataset comprises a collection of OSS & synthetic data, including approximately 8.54 million instruction-text pairs and advanced tool-calling instruction pairs specifically curated for the region.

    🤗aisingapore/SEA-Instruct-2602

    To maintain high efficiency, our post-training pipeline is centred entirely on knowledge distillation.

    We evaluated Gemma-SEA-LION-v4.5-E2B-IT on general language, multi-turn chat, instruction-following capabilities, and vision-language benchmarks.

    General language capabilities

    For the evaluation of general language capabilities, we employed the SEA-HELM evaluation benchmark 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/Thai Exam.

    Instruction-following and Multi-turn Chat

    We evaluated the models on Instruction-following and Multi-turn Chat capabilities with SEA-IFEval (based on IFEval) and SEA-MTBench (based on MT-Bench) 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.

    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: 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: 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-oss-120b as the judge model and compare against gpt-oss-120b 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).

    The following metrics were used for text capabilities:

    Task

    Metric

    Sentiment Analysis

    Accuracy

    Extractive QA (ID, VI, TH, TA)

    ChrF++

    MCQ-QA (TL, MY, MS)

    Accuracy

    Metaphor

    Accuracy

    Abstractive Summarisation

    Rouge-L

    For details on Gemma-SEA-LION-v4.5-E2B-IT performance, please refer to the https://leaderboard.sea-lion.ai/.

    The architecture is based on the dense model architecture of Gemma4 E2B, can be found in the gemma-4-E2B-it Model Card.

    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.

    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.

    pip install -U transformers torch accelerate
    from transformers import AutoProcessor, AutoModelForCausalLM
    MODEL_ID = "aisingapore/Gemma-SEA-LION-v4.5-E2B-IT"
    # Load model
    processor = AutoProcessor.from_pretrained(MODEL_ID)
    model = AutoModelForCausalLM.from_pretrained(
        MODEL_ID,
        dtype="auto",
        device_map="auto"
    )
    # Prompt
    messages = [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Write a short joke about HDB flat in Singapore."},
    ]
    # Process input
    text = processor.apply_chat_template(
        messages,
        tokenize=False,
        add_generation_prompt=True,
        enable_thinking=False
    )
    inputs = processor(text=text, return_tensors="pt").to(model.device)
    input_len = inputs["input_ids"].shape[-1]
    # Generate output
    outputs = model.generate(**inputs, max_new_tokens=1024)
    response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
    # Parse output
    processor.parse_response(response)

    Model Details

    Model Description

    Model Sources

    How to Get Started with the Model

    Download the Models

    Training Details

    Training Data

    Training Regime

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Factors

    Metrics

    Results

    Technical Specifications

    Model Architecture

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    Qwen-SEA-LION-v4-VL

    Last update: 2025-12-1

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Qwen-SEA-LION-v4-VL contains 4/8-billion parameter Vision-Language Models (VLM) built upon the Qwen3-VL-4B/8B-Instruct architecture. To ensure domain adaptation for the region, the model underwent rigorous supervised fine-tuning (SFT) on a curated dataset of approximately 9 million instruction-text pairs. This extensive post-training instills multilingual and multicultural fluency, covering English and 7 key SEA languages: Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese.

    Qwen-SEA-LION-v4-4B/8B-VL inherits the following features from Qwen3-VL:

    • Long-Context Multimodal Architecture (Native 256K context window)

    Qwen-SEA-LION-v4-32B-IT

    Last updated: 2025-10-17

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Qwen-SEA-LION-v4-32B-IT is based on Qwen3, which provides a strong foundation with support for over 100 languages and advanced reasoning capabilities. The model underwent continued pre-training on approximately 100B tokens sampled from the SEA-Pile v2 pretraining corpus of over one trillion tokens across 7 SEA languages: Burmese, Indonesian, Malay, Filipino, Tamil, Thai, and Vietnamese. Finally, it was post-trained on a high-quality dataset of approximately 8 million question-and-answer pairs to create the final instruction-tuned model.

    Qwen-SEA-LION-v4-32B-IT inherits the following features from Qwen3-32B:

    • 32,768 of context length natively

    SEA-LION stands for Southeast Asian Languages In One Network.

    We performed continued pre-training in English and SEA languages on Qwen3-32B, a decoder model using the Gemma 3 architecture, and post-training to create Qwen-SEA-LION-v4-32B-IT.

    Apertus-SEA-LION-v4-8B

    Last updated: 2026-02-05

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    SEA-LION stands for Southeast Asian Languages In One Network.

    Apertus-SEA-LION-v4-8B-IT is a 8-billion parameter model built upon the Apertus-8B-Instruct architecture. To ensure domain adaptation for the region, the model underwent rigorous post-training on a curated dataset of approximately 8.54 million instruction-text pairs.

    This extensive post-training instills multilingual and multicultural fluency, covering key SEA languages such as Burmese, Malay, Tagalog and Tamil. The dataset also includes 347,000 tool-calling instruction-text pairs to impart these capabilities, in addition to linguistic fluency.

    Apertus-SEA-LION-v4-8B-IT is designed as a fully open model; to align with this core philosophy, we have released the datasets used for post-training, as well as the evaluation codes and datasets used to evaluate the model.

    These resources can be accessed via the link below.

    SEA-LION-Embedding-E5

    Last update: 2026-03-16

    SEA-LION is a collection of Large Language Models (LLMs) and encoders which have been pretrained and fine-tuned for the Southeast Asia (SEA) region.

    SEA-LION stands for Southeast Asian Languages In One Network.

    The SEA-LION-Embedding-E5-600M model is a Sentence Transformer optimised for 11 Southeast Asian languages. It has been fine-tuned from the base, mapping sentences and paragraphs to a 1024-dimensional dense vector space. This model is designed for high-accuracy semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and RAG (Retrieval-Augmented Generation) workflows. It leverages the robust XLM-RoBERTa architecture pretrained on 100 languages, optimised here for 11 Southeast Asian languages: Burmese, Chinese, English, Filipino, Indonesian, Khmer, Lao, Malay, Tamil, Thai, and Vietnamese.

    The SEA-LION-E5-Embedding-600M model is a Sentence Transformer built on the which was initialised from architecture.

    • Model Type: Sentence Transformer

    Translations

    MetricX-24 score (with reference)

    Causal Reasoning

    Accuracy

    Natural Language Inference

    Accuracy

    LINDSEA

    Accuracy

    Global MMLU Lite

    Accuracy

    ThaiExam

    Accuracy

    Kalahi

    Accuracy

    SEA-IFEval

    Accuracy

    SEA-MTBench

    Win rate against a reference

    Apache-2.0
    https://huggingface.co/google/gemma-4-E4B-it
    HuggingFace
    Ollama
    HuggingFace
    Ollama

    Edge-Optimized Inference (Resource Efficient)

  • Enhanced Vision-Language Capabilities

  • Tool Use

  • SEA-LION stands for Southeast Asian Languages In One Network.

    Qwen-SEA-LION-v4-4B/8B-VL contains 4/8-billion parameter Vision-Language Models (VLM) built upon the Qwen3-VL-4B/8B-Instruct architecture. To ensure domain adaptation for the region, the model underwent rigorous supervised fine-tuning (SFT) on a curated dataset of approximately 9 million instruction-text pairs. This extensive post-training instills multilingual and multicultural fluency, covering English and 7 key SEA languages: Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese.

    Qwen-SEA-LION-v4-4B/8B-VL inherits the following features from Qwen3-VL:

    • Long-Context Multimodal Architecture (Native 256K context window)

    • Edge-Optimized Inference (Resource Efficient)

    • Enhanced Vision-Language Capabilities

    • Tool Use

    For tokenization, the model employs the default tokenizer used in Qwen3-VL.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Decoder

    • Context length: 256k

    • Language(s): fine-tuned on Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese

    • License:

    • Finetuned from model: ,

    The instruction fine-tuning text dataset comprises of a collection of OSS & synthetic data.

    • Training regime: Our workflow consists of instruction fine-tuning and model merging.

    We evaluated Qwen-SEA-LION-v4-4B/8B-VL on general language capabilities.

    General language capabilities

    For the evaluation of general language capabilities, we employed the SEA-HELM evaluation benchmark 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) and SEA-MTBench (based on MT-Bench) 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.

    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).

    The following metrics were used for text capabilities:

    Task

    Metric

    Sentiment Analysis

    Accuracy

    Extractive QA (ID, VI, TH, TA)

    ChrF++

    MCQ-QA (TL, MY, MS)

    Accuracy

    Metaphor

    Accuracy

    Abstractive Summarisation

    Rouge-L

    We also evaluated our models on two types of tasks using datasets specifically focused on Southeast Asian examples to benchmark and compared our models' performances against the original base models (Qwen3-VL-4B/8B).

    • Visual Question Answering (VQA): We utilised Multiple Choice Question (MCQ) style tasks, including MARVL, CVQA, and WorldCuisines.

    • Image Captioning: We employed the XM3600 dataset, evaluating strictly on examples relevant to the SEA region.

    Key Insight: Despite our fine-tuning process focusing primarily on text data (approximately 8 million regional Q&A and instruction pairs), our evaluations confirm that Qwen-SEA-LION-v4 (4B/8B) successfully retains the high-performance vision-language capabilities of the original base models.

    The evaluation was done zero-shot with native prompts.

    The following metrics were used to measure performance:

    • Normalised accuracy was the primary metric for the VQA tasks (CVQA, MARVL, and WorldCuisines).

    • RefCLIP Score was used for the XM3600 image captioning task.

    For details on Qwen-SEA-LION-v4-VL performances, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    Qwen-SEA-LION-v4-VL models are available for download via the following channels: 🤗HuggingFace SEA-LION v4 Collection

    Model
    Download

    Qwen-SEA-LION-v4-4B-VL

    Qwen-SEA-LION-v4-8B-VL

    Use the code below to get started with the model with 🤗 Transformers libraries.

    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.

    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.

    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.

    For more info, please contact us at SEA-LION Inquiry Form or sealion@aisingapore.org

      pip install transformers>=4.57.0 
    from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
    
    # default: Load the model on the available device(s)
    model = Qwen3VLForConditionalGeneration.from_pretrained(
        "aisingapore/Qwen-SEA-LION-v4-8B-VL", dtype="auto", device_map="auto"
    )
    
    # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
    # model = Qwen3VLForConditionalGeneration.from_pretrained(
    #     "aisingapore/Qwen-SEA-LION-v4-8B-VL",
    #     dtype=torch.bfloat16,
    #     attn_implementation="flash_attention_2",
    #     device_map="auto",
    # )
    
    processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-4B-Instruct")
    
    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."}
            ],
        }
    ]
    
    # Preparation for inference
    inputs = processor.apply_chat_template(
        messages,
        tokenize=True,
        add_generation_prompt=True,
        return_dict=True,
        return_tensors="pt"
    )
    inputs = inputs.to(model.device)
    
    # Inference: Generation of the output
    generated_ids = model.generate(**inputs, max_new_tokens=128)
    generated_ids_trimmed = [
        out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
    ]
    output_text = processor.batch_decode(
        generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
    )
    print(output_text)  

    Introduction

    Training Details

    Training Data

    Training Procedure

    Training Hyperparameters

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Factors

    Metrics

    Retaining VL Capabilities

    Factors

    Metrics

    Results

    Download the Models

    Uses

    How to Get Started with the Model

    Disclaimer

    Bias, Risks, and Limitations

    More Information

    For tokenization, the model employs the default tokenizer used in Qwen3-32B.

    • 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): Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai, and Vietnamese

    • License: /

    • Continue pretrained from 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.

    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.

    In terms of vision capability, Qwen-SEA-LION-v4-32B-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 Qwen3-32B, and may not exhibit significant improvements or differences in this area. (https://huggingface.co/Qwen/Qwen3-32B )

    Use the code below to get started with the model using the 🤗 Transformers library.

    The model defaults to non-thinking mode. To enable thinking mode, please use enable_thinking=True.

    Training Datasets

    The instruction fine-tuning dataset combines our SEA-Instruct, Infinity-Instruct, and OpenMath-Instruct 2 with open-source datasets. For the Online RL datasets, open sourced datasets such as nvidia/Llama-Nemotron-Post-Training-Dataset (RL set) and zwhe99/DeepMath-103K were used.

    Training regime

    Our post-training workflow consists of multiple stages: instruction fine-tuning, model merging, online RL for both instruction following and math using DRGPPO, and then followed by on-policy alignment via APO.

    • Qwen-SEA-LION-v4-32B-IT

    • Qwen-SEA-LION-v4-32B-IT-4BIT

    • Qwen-SEA-LION-v4-32B-IT-8BIT

    Quantized Variant
    Model Size (GB)
    VRAM Required (GB)
    Time to First Token (s)
    Tokens per Second

    BF16

    65.57

    61.03

    0.34

    58.84

    8-bit (GPTQ)

    34.34

    Additional Remarks:

    • TTFT and Toks per Sec: measured with vLLM on localhost and concurrency = 1.

    • Reported results are the median (p50) values, calculated across 10 requests. (11 requests were run and the first result was dropped, to eliminate cold-start delays)

    • Model size taken from vLLM upon loading

    • Input size 4K, output 1K

    • Tests conducted on a system with an NVIDIA H200 GPU

    We evaluated Qwen-SEA-LION-v4-32B-IT on general language, multi-turn chat and instruction-following capabilities.

    General language capabilities

    For the evaluation of general language capabilities, we employed the SEA-HELM evaluation benchmark 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) and SEA-MTBench (based on MT-Bench) 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.

    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).

    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

    For details on Qwen-SEA-LION-v4-27B-IT performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/ .

    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.

    For more info, please contact us using this sealion@aisingapore.org

    Model Details

    Model Description

    from transformers import AutoModelForCausalLM, AutoTokenizer
    
    model_name = "aisingapore/Qwen-SEA-LION-v4-32B"
    
    # load the tokenizer and the model
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(
        model_name,
        torch_dtype="auto",
        device_map="auto"
    )
    
    # prepare the model input
    prompt = "Create a poem that captures the seaside scenery across Southeast Asian countries, including transcriptions in their respective languages."
    messages = [
        {"role": "user", "content": prompt}
    ]
    text = tokenizer.apply_chat_template(
        messages,
        tokenize=False,
        add_generation_prompt=True,
        enable_thinking=True # Switches between thinking and non-thinking modes. Default is True.
    )
    model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
    
    # conduct text completion
    generated_ids = model.generate(
        **model_inputs,
        max_new_tokens=32768
    )
    output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
    
    # parsing thinking content
    try:
        # rindex finding 151668 ()
        index = len(output_ids) - output_ids[::-1].index(151668)
    except ValueError:
        index = 0
    
    thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
    content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
    
    print("thinking content:", thinking_content)
    print("content:", content)
    

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    Caveats || Risks

    Limitations

    How to Get Started with the Model

    Training Details

    Training Procedure

    Uses

    Available Versions

    Resource Metrics

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Factors

    Metrics

    More Information

    Open post-training datasets we used.

  • SEA-HELM Evaluation codes and datasets

  • SEA-LION stands for Southeast Asian Languages In One Network.

    We performed post-training in English and SEA languages on Apertus-8B-Instruct-2509, a decoder model using the Apertus architecture, and post-training to create Apertus-SEA-LION-v4-8B-IT.

    For tokenization, the model employs the default tokenizer used in Apertus-8B-Instruct-2509.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Decoder

    • Context length: 65k

    • Language(s): fine-tuned on English, Burmese, Tagalog, Malay and Tamil

    • License:

    • Finetuned from model:

    • Repository: https://huggingface.co/collections/aisingapore/sea-lion-v4

    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.

    The models were not tested for robustness against adversarial prompting. It is important for users to be aware that our models exhibit certain limitations that warrant consideration. Like many LLMs, the models 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.

    Use the code below to get started with the model with 🤗 Transformers libraries.

    The prompt in the example is in Malay and translates to “Please help me find a 4-room flat near Tampines, budget under $500,000. I also want to know the estimated monthly loan payment.”

    The instruction fine-tuning text dataset comprises of a collection of OSS & synthetic data. The datasets used for post-training can be accessed via the link below.

    Datasets for Instruction Fine Tuning:

    • 🤗aisingapore/SEA-Instruct-2602

    Datasets for Tool-calling:

    • 🤗allenai/Dolci-Instruct-SFT-Tool-Use

    • 🤗Agent-Ark/Toucan-1.5M

    Datasets for Reinforcement Learning:

    • 🤗nvidia/Nemotron-Cascade-RL-Instruction-Following

    • 🤗openai/gsm8k

    • Training regime: Our post-training workflow consists of instruction fine-tuning and model merging.

    • Training hyperparameters: The following hyperparameters were used during training:

    Category
    Hyperparameter
    Value

    Optimization

    Optimizer

    ADAMW_TORCH_FUSED (β1=0.9, β2=0.999, ε=1e-08)

    Batch Size

    Train Batch Size (per device)

    1

    Eval Batch Size (per device)

    1

    We evaluated Apertus-SEA-LION-v4-8B-IT on general language capabilities and LLM-specific capabilities using SEA-HELM.

    For details on Apertus-SEA-LION-v4-8B-IT performance, please refer to the Leaderboard results on SEA-HELM.

    The Apertus-SEA-LION-v4-8B models are available for download via the 🤗 HuggingFace Apertus-SEA-LION-v4-8B-IT repository. You can also explore more models in the same collection at 🤗 HuggingFace SEA-LION v4 Collection.

    This is the repository for the commercial instruction-tuned model. The models have 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.

    For more info, please contact us at SEA-LION Inquiry Form or sealion@aisingapore.org

    Introduction

    pip install transformers>=4.56.0
    
    # The code is adopted from Apertus example
    from transformers import AutoModelForCausalLM, AutoTokenizer
    
    model_name = "aisingapore/Apertus-SEA-LION-v4-8B-IT"
    device = "cuda"  # for GPU usage or "cpu" for CPU usage
    
    # load the tokenizer and the model
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(
        model_name,
    ).to(device)
    
    # prepare the model input
    prompt = "Explain the concept of 'Hari Raya Puasa' in simple terms."
    messages_think = [
        {"role": "user", "content": prompt}
    ]
    
    text = tokenizer.apply_chat_template(
        messages_think,
        tokenize=False,
        add_generation_prompt=True,
    )
    model_inputs = tokenizer([text], return_tensors="pt", add_special_tokens=False).to(model.device)
    
    # Generate the output
    generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
    
    # Get and decode the output
    output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]
    print(tokenizer.decode(output_ids, skip_special_tokens=True))
    import torch
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained('aisingapore/gemma-sealion-4b-v4-cand5', trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained(
        "aisingapore/gemma-sealion-4b-v4-cand5",
        torch_dtype=torch.bfloat16,
        device_map="auto"
    )
    
    messages = [
        {"role": "user", "content": "Tolong carikan flat 4-bilik dekat Tampines, bajet bawah $500,000. Nak tahu juga berapa anggaran pinjaman bulanan."}
    ]
    
    tools = [
        {
            "type": "function",
            "function": {
                "name": "search_hdb_listings",
                "description": "Search for HDB flats available for sale",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {"type": "string", "description": "Town or area name"},
                        "flat_type": {"type": "string", "description": "Flat type e.g. 3-room, 4-room, 5-room"},
                        "max_price": {"type": "number", "description": "Maximum price in SGD"}
                    },
                    "required": ["location", "flat_type"]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "name": "calculate_mortgage",
                "description": "Calculate estimated monthly mortgage payment",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "loan_amount": {"type": "number", "description": "Loan amount in SGD"},
                        "interest_rate": {"type": "number", "description": "Annual interest rate as percentage"},
                        "loan_tenure_years": {"type": "integer", "description": "Loan period in years"}
                    },
                    "required": ["loan_amount"]
                }
            }
        }
    ]
    
    input_ids = tokenizer.apply_chat_template(
        messages,
        tools=tools,
        return_tensors="pt",
        add_generation_prompt=True
    ).to(model.device)
    
    generated_ids = model.generate(
        input_ids,
        max_new_tokens=512,
        do_sample=False,
    )
    
    response = tokenizer.decode(
        generated_ids[0][input_ids.shape[1]:],
        skip_special_tokens=False,
    ).replace("", "").strip()
    
    print(response)

    Model Details

    Model Description

    Model Sources

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    How to Get Started with the Model

    Tool Calling

    Training Details

    Training Data

    Training Procedure

    Training Hyperparameters

    Evaluation

    Testing Data, Factors & Metrics

    Results

    Download the Models

    More Information

    Base Architecture: E5 (Transformer Encoder)

  • Developed by: AI Products Pillar, AI Singapore

  • Funded by: Singapore NRF

  • Shared by: AI Products Pillar, AI Singapore

  • Context length: 512

  • Languages: Burmese, Chinese, English, Filipino, Indonesian, Khmer, Lao, Malay, Tamil, Thai, and Vietnamese

  • License: MIT

  • Finetuned from model: multilingual-e5-large

    • Documentation: Sentence Transformers Documentation

    • Repository: aisingapore/SEA-LION-E5-Embedding-600M

    SEA-LION-E5-Embedding-600M details one of the variants available within this collection. If you are deploying our models for your specific use case, we would love to hear from you! Please feel free to contact us to share your experience or explore potential collaborations.

    Model Variant
    Model Repository
    Suggesting Applications & Use Cases

    Fine-tuned Embedding Models

    - - -

    - Retrieval-Augmented Generation (RAG) - Information retrieval, and search - Similarity comparisons

    Pre-trained Encoder Models

    - -

    - Fill mask - Text classification - Fine-tuning for downstream tasks (e.g., sentiment analysis, classification).

    Pre-trained Model Checkpoints

    - -

    - Continued Pre-Training (CPT) - Fine-tuning for downstream tasks (e.g., sentiment analysis, classification).

    First install the Sentence Transformers library:

    Then you can load this model and run inference.

    This model was tuned using a multi-stage training pipeline with the following datasets:

    • Contrastive Pre-training: 245 million text pairs (EN-EN and EN-SEA) to enhance cross-lingual alignment.

    • Fine-tuning: 13 million diverse text pairs (spanning EN-EN, CN-CN, EN-SEA, and SEA-SEA) to create the final fine-tuned model.

    Language

    Percentage

    EN-EN

    20%

    CN-CN

    20%

    EN-SEA

    10%

    SEA-SEA

    50%

    Following the foundational training, the model's cross-lingual alignment was substantially enhanced by undergoing contrastive pre-training utilising 245 million text pairs, specifically focusing on English-to-English and English-to-Southeast Asian language mappings (EN-EN and EN-SEA). Finally, to ensure the model could effectively follow user instructions and handle complex interactions, it was instruction-tuned using a diverse dataset of 13 million text pairs spanning EN-EN, CN-CN, EN-SEA, and SEA-SEA, culminating in the final highly capable instruction-tuned model.

    The model is evaluated across three primary benchmark suites to provide a comprehensive assessment of embedding quality across Southeast Asian, Chinese, and English contexts:

    • SEA-BED (Southeast Asia Embedding Benchmark) (https://arxiv.org/pdf/2508.12243): The primary testing suite, consisting of 169 datasets across 10 Southeast Asian languages (Burmese, Filipino, Indonesian, Khmer, Malay, Lao, Tamil, Tetum, Thai, and Vietnamese). Notably, 71% of these datasets are native-authored or human-curated to preserve regional linguistic properties.

    • CMTEB (Chinese Massive Text Embedding Benchmark): A specialised subset of MTEB focused on Chinese language tasks, used to evaluate performance in one of the region's most prominent scripts.

    • MTEB (Massive Text Embedding Benchmark): The industry-standard global benchmark used to gauge general-purpose English embedding performance across a wide array of tasks.

    For details on Performance comparison of embedding models on SEA-BED, please refer to the SEA-HELM.

    Carbon emission was estimated using the fact sheet from TRG Datacenters.

    • Hardware Type: Nvidia H200 140GB GPUs

    • Hours used: 896 hrs

    • Cloud Provider: SMC H200

    • Compute Region: Singapore

    • Carbon Emitted: appx. 252.13 kg CO2 e

    SEA-LION-E5-Embedding-600M is an encoder-only model based on XLM-R Large with E5-style contrastive pre-training and mean pooling.

    Parameter
    SEA-LION-E5-Embedding-600M

    d_model

    1024

    head_dim

    16

    Vocabulary

    250,000 (SentencePiece)

    Sequence Length

    512

    Pooling Mode

    Mean tokens (with attention mask)

    • E5: "EmbEddings from bidirEctional Encoder rEpresentations" – a weakly-supervised contrastive pre-training method for text embeddings.

    • SEA-BED: Southeast Asia Embedding Benchmark – a comprehensive evaluation suite for embedding models on SEA languages.

    • Asymmetric Retrieval: Retrieval tasks where query and document formulations differ; E5 uses prefixes to handle this.

    • Mean Pooling: Aggregating token embeddings by averaging (weighted by attention mask) to produce a fixed-size sentence representation.

    While this model supports masked language modeling, it is primarily optimised via contrastive fine-tuning for downstream tasks such as sequence classification, token classification, or question answering. Please note that these weights have not been specifically aligned for safety; therefore, developers should implement their own safety evaluations and security measures. The authors disclaim all liability for any claims, damages, or other liabilities arising from the use of the released code or weights.

    For more info, please contact us at sealion@aisingapore.org

    Introduction

    Model Details

    Model Description

    multilingual-e5-large
    Multilingual E5 Text Embeddings
    xlm-roberta-large
    pip install -U sentence_transformers>=2.2.2
    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer(
        "aisingapore/SEA-LION-E5-Embedding-600M",
        prompts={
            "STS": "Instruct: Retrieve semantically similar text.\nQuery: ",
            "Clustering": "Instruct: Classify text into its appropriate category\nQuery: ",
            "Classification": "Instruct: Classify text into its appropriate category\nQuery: ",
            "Retrieval": "Instruct: Given a passage that is guaranteed to contain the answer, retrieve relevant passages that answer the query.\nQuery: ",
            "BitextMining": "Instruct: Retrieve parallel sentences.\nQuery: ",
            "PairClassification": "Instruct: Retrieve semantically similar text.\nQuery: ",
            "Reranking": "Instruct: Retrieve semantically similar text.\nQuery: ",
            "InstructionRetrieval": "Instruct: Given a instruction and a output, retrieve the most relevant output that answer the instruction.\nQuery: ",
            "MultiLabelTextClassification": "Instruct: Classify the given text into its appropriate classes\nQuery: ",
            "QARetrieval": "Instruct: Given a passage that is guaranteed to contain the answer, retrieve relevant passages that answer the query.\nQuery: ",
            "Summarization": "Instruct: Summarize the given text.\nQuery: "
        },
    )
    
    sentences = [
        "The weather is lovely today.",
        "อากาศวันนี้ดีมาก",
        "Dia berkendara ke stadion.",
    ]
    embeddings = model.encode(sentences, prompt_name="STS")
    print(embeddings.shape)
    # [3, 1024]
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities)
    #tensor([[1.0000, 0.8594, 0.5534],
    #        [0.8594, 1.0000, 0.6343],
    #        [0.5534, 0.6343, 1.0000]])

    Model Sources

    Uses

    Direct Usage (Sentence Transformers)

    Training Details

    Training Data

    Training Procedure

    Preprocessing

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Results

    Environmental Impact

    Technical Specifications

    Model Architecture and Objective

    Glossary

    More Information

    SEA-LION-ModernBERT and Embedding

    Last update: 2026-03-16

    SEA-LION is a collection of Large Language Models (LLMs) and encoders which have been pretrained and fine-tuned for the Southeast Asia (SEA) region.

    SEA-LION stands for Southeast Asian Languages In One Network.

    This encoder-only model leverages the advanced ModernBERT architecture combined with the Gemma 3 SentencePiece tokenizer. The adoption of the Gemma 3 tokenizer with ModernBERT allows the model to achieve highly efficient and culturally nuanced text processing. This combination significantly improves the tokenization fertility and compression rates for complex regional scripts and diverse Southeast Asian languages, enabling the model to handle longer context windows and cross-lingual tasks with greater computational efficiency.

    To achieve this level of performance, the model was developed through a rigorous, multi-stage training pipeline. The foundation was established through extensive pre-training on 2 Trillion (2T) tokens, followed by a mid-training phase on an additional 1 Trillion (1T) tokens. Both of these massive training phases comprehensively covered code alongside 13 specific languages: Burmese, Chinese, English, Filipino, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tamil, Thai, and Vietnamese.

    The SEA-LION-ModernBERT-based models are built on the ModernBERT architecture and has a vocabulary size of 262K.

    For tokenization, the model employs our custom tokenizer, which has excellent performance for SEA languages, ensuring optimal model performance.

    32.04

    0.35

    68.85

    4-bit (GPTQ)

    19.93

    19.43

    0.34

    78.20

    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

    Qwen Terms of Service
    Qwen Usage Policy
    Qwen-3-32B

    Hardware

    Distributed Type

    multi-GPU

    Number of Devices

    64

    Schedule

    LR Scheduler Type

    constant_with_warmup

    LR Scheduler Warmup Steps

    269

    Other

    Training Steps

    5397

    Seed

    42

    Apache-2.0
    Apertus-8B-Instruct

    Translations

    MetricX-24 score (with reference)

    Causal Reasoning

    Accuracy

    Natural Language Inference

    Accuracy

    LINDSEA

    Accuracy

    Global MMLU Lite

    Accuracy

    ThaiExam

    Accuracy

    Kalahi

    Accuracy

    SEA-IFEval

    Accuracy

    SEA-MTBench

    Win rate against a reference

    Apache-2.0
    Qwen3-VL-4B-Instruct
    Qwen3-VL-8B-Instruct
    HuggingFace
    HuggingFace
    aisingapore/SEA-LION-E5-Embedding-600M
    aisingapore/SEA-LION-ModernBERT-Embedding-300M
    aisingapore/SEA-LION-ModernBERT-Embedding-600M
    aisingapore/SEA-LION-ModernBERT-300M
    aisingapore/SEA-LION-ModernBERT-600M
    aisingapore/SEA-LION-ModernBERT-300M-checkpoints
    aisingapore/SEA-LION-ModernBERT-600M-checkpoints
    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Encoder

    • Context length: 8k

    • Languages: Burmese, Chinese, English, Filipino, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tamil, Thai, and Vietnamese

    • License:

    • Repository: The weights for this model and its various training stages are being released to support transparency, research, and diverse downstream applications. Link to HF Repo

    This model card details one of the variants available within this ModernBERT-based collection.

    Model Variant
    Model Repository
    Suggesting Applications & Use Cases

    Fine-tuned Embedding Models

    - - -

    - Retrieval-Augmented Generation (RAG) - Information retrieval, and search - Similarity comparisons

    Pre-trained Encoder Models

    - -

    - Fill mask - Text classification - Fine-tuning for downstream tasks (e.g., sentiment analysis, classification).

    Pre-trained Model Checkpoints

    - -

    - Continued Pre-Training (CPT) - Fine-tuning for downstream tasks (e.g., sentiment analysis, classification).

    The checkpoints repository contains available of model variants.

    Model Variant
    Suggesting Applications & Use Cases

    stage1-pre-training/SEA-LION-PT-300M.pt

    Composer checkpoint from the Pre-Training Stage suitable for continued pre-training (CPT).

    stage1-pre-training/SEA-LION-PT-300M

    Folder for the HuggingFace checkpoints from the Pre-Training Stage, suitable for continued pre-training or fine tuning.

    stage2-mid-training/SEA-LION-MT-300M-w-decay.pt

    Composer checkpoint from the Mid-Training stage with learning rate annealing suitable for fine tuning with learning rate warmup.

    stage2-mid-training/SEA-LION-MT-300M-wo-decay.pt

    Composer checkpoint from the Mid-Training stage without learning rate annealing suitable for continued pre-training (CPT) and fine tuning without learning rate warmup.

    stage2-mid-training/SEA-LION-MT-300M-wo-decay

    Note: For stage2-mid-training checkpoints with learning rate annealing, please refer to aisingapore/SEA-LION-ModernBERT-300M and aisingapore/SEA-LION-ModernBERT-600M

    Note: If you are deploying our models for your specific use case, we would love to hear from you! Please feel free to contact us to share your experience or explore potential collaborations.

    The model was not tested for robustness against adversarial usage. It is important for users to be aware that our model exhibits certain limitations that warrant consideration. Users should also exercise caution in continue-implementing and validating the model's responses due to the potential inconsistencies.

    Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

    Use this code snippet below to run inference with the model via the API.

    Use the code below to download the model locally.

    Note: To get started with Continued Pre-Training of the Composer checkpoints, we recommend refering to this guide.


    The models are pre-trained from scratch through a two-phase pipeline, beginning with an extensive initial stage on 2 trillion tokens, followed by a mid-training phase on an additional 1 trillion tokens. Both phases incorporated a diverse dataset covering programming code and 13 languages: Burmese, Chinese, English, Filipino, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tamil, Thai, and Vietnamese.

    The pre-trained checkpoints were pre-trained from scratch on a number of trillion tokens corpus with the following linguistic and thematic distribution:

    Data Source
    Percentage

    code

    10%

    EN - English

    35%

    ID - Indonesian

    8%

    JV - Javanese

    0.5%

    KM - Khmer

    The model is evaluated across three primary benchmark suites to provide a comprehensive assessment of embedding quality across Southeast Asian, Chinese, and English contexts:

    • SEA-BED (Southeast Asia Embedding Benchmark): The primary testing suite, consisting of 169 datasets across 10 Southeast Asian languages (Burmese, Filipino, Indonesian, Khmer, Malay, Lao, Tamil, Tetum, Thai, and Vietnamese). Notably, 71% of these datasets are native-authored or human-curated to preserve regional linguistic properties.

    • CMTEB (Chinese Massive Text Embedding Benchmark): A specialised subset of MTEB focused on Chinese language tasks, used to evaluate performance in one of the region's most prominent scripts.

    • MTEB (Massive Text Embedding Benchmark): The industry-standard global benchmark used to gauge general-purpose English embedding performance across a wide array of tasks.

    For details on Performance comparison of embedding models on SEA-BED, please refer to the SEA-HELM.

    Carbon emission was estimated using the fact sheet from TRG Datacenters.

    • Hardware Type: Nvidia H200 140GB GPUs

    • Hours used: 1,825 GPU hours

    • Cloud Provider: SMC H200

    • Compute Region: Singapore

    • Carbon Emitted: appx. 513.27 kg CO2 e

    SEA-LION-ModernBERT-300M is an encoder model using the ModernBERT architecture.

    Parameter
    SEA-LION-ModernBERT

    Layers

    22

    d_model

    768

    head_dim

    12

    Vocabulary

    262144

    Sequence Length

    8k

    This is the repository for the commercial fine-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.

    For more info, please contact us at sealion@aisingapore.org

    Introduction

    Model Details

    Model Description

    Gemma3
    from openai import OpenAI
    
    client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.sea-lion.ai/v1/embeddings")
    
    result = client.embeddings.create(
        model="aisingapore/SEA-LION-ModernBERT-Embedding-600M",
        input=[
            "Singapore is a tropical island city-state.",
            "The Lion City sits at the tip of the Malay Peninsula.",
        ],
    )
    
    for item in result.data:
        print(f"index {item.index}: dim={len(item.embedding)}")
    pip install -U transformers>=4.48.0
    #########################
    ## Download checkpoints locally for continued pre-training or fine tuning
    #########################
    from huggingface_hub import snapshot_download
    
    # Download the stage-1-pre-training Huggingface checkpoint
    snapshot_download(
      "aisingapore/SEA-LION-ModernBERT-300M-checkpoints",
      repo_type="model",
      allow_patterns=["stage1-pre-training/SEA-LION-PT-300M/*"],
      local_dir="checkpoints"
    )
    
    # Download the stage-1-pre-training Composer checkpoint
    snapshot_download(
      "aisingapore/SEA-LION-ModernBERT-300M-checkpoints",
      repo_type="model",
      allow_patterns=["stage1-pre-training/SEA-LION-PT-300M.pt"],
      local_dir="checkpoints"
    )
    import torch
    from transformers import pipeline
    
    pipeline = pipeline(
        task="fill-mask",
        model="checkpoints/stage1-pre-training/SEA-LION-PT-300M", # loading from local folder
        dtype=torch.float16,
        device=0
    )
    pipeline("Plants create  through a process known as photosynthesis.")

    Model Sources

    Uses

    Bias, Risks, and Limitations

    Recommendations

    How to Get Started with the Model

    Training Details

    Training Data

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Results

    Environmental Impact

    Technical Specifications

    Model Architecture and Objective

    More Information

    Capabilities & Tool-Use

    Introduction to Tool Calling

    Tool calling is a powerful feature that enables Large Language Models (LLMs) to interact with external functions and APIs, extending their capabilities beyond text generation. SEA-LION models support tool calling with different implementations depending on the model version.

    Tool calling allows models to:

    • Access real-time information (weather, time, web search)

    • Perform calculations and data processing

    • Interact with external systems and APIs

    • Execute specific functions based on user requests

    This guide covers tool calling implementation for the SEA-LION model variants hosted on , each with distinct behaviors and requirements. For demonstration purposes, the tools suggested in the will be used in the sample code snippets.

    Key Characteristics:

    • Uses text-based tool calling format

    • Requires parsing tool calls from response content

    • Does not utilize standard tool_calls parameter

    • Follows system prompt instructions for tool call formatting

    Following the Gemma 3 chat template, Gemma-SEA-LION-v4-27B-IT does not parse the , hence it is recommended to handle tool-calling via the parsing of the model's message response, similar to by Google DeepMind engineer Philipp Schmid.

    When tool_choice is configured to enforce usage of a specific tool, the tool_calls parameter will be returned, but this removes flexibility from the LLM on determining whether tool call is required.

    If enforcing tool call:

    Key Characteristics:

    • Supports standard OpenAI-style function calling

    • Uses tool_calls parameter in responses

    • Requires tools configuration in API request

    • Works with tool_choice: "auto" setting

    Key Characteristics:

    • Reasoning model without tool calling capability

    • Tool-calling can be done via parsing from message response

    • Similar to Gemma-SEA-LION-v4-27B-IT using tool-calling via message content

    • Recommend not adding tools, tool_choice in API call

    Here's an examples that handles all three models, making use of the components provided in the :

    1. Gemma-SEA-LION-v4-27B-IT:

      • Typically uses text parsing instead of standard tool calling

      • System prompt should explicitly define tool call format

      • tools parameter in API requests is only utilized when tool_choice

    1. Error Handling: Always implement proper error handling for tool execution failures and API timeouts.

    2. Model Detection: Use model name suffixes to determine the appropriate tool calling approach:

    3. Timeout Management: Set appropriate timeouts for both LLM API calls and tool execution

    4. Response Validation: Always validate tool call responses before processing:

    • Validate all tool parameters before execution

    • Implement rate limiting for external API calls

    • Sanitize user inputs that will be passed to tools

    • Consider implementing tool execution sandboxing for production environments

    • Cache tool results where appropriate (e.g., weather data for short periods)

    • Implement parallel tool execution when multiple tools are called

    • Use connection pooling for HTTP requests in tool implementations

    • Consider implementing tool call batching for efficiency

    Tool Implementation Example

    This guide provides practical tool implementations for SEA-LION models, including working code, parsing logic, and execution frameworks. The implementations cover common patterns that you can adapt for your specific use cases.

    What's Included

    This example includes the components typically needed for tool calling:

    • Tool Functions: Working implementations for weather, time, and web search

    • Schema Definitions: OpenAI-compatible tool schemas for model integration

    • System Prompt: Sample prompt configured for model to execute tool-calling if it is not equipped to do so via chat template

    • Response Parsing: Parsing logic for text-based tool calls

    • Execution Framework: Tool execution system with error handling

    • Customization Guide: Instructions for adapting these examples to your own tools

    The three example tools (weather, time, web search) demonstrate different common patterns—external API integration, system functions, and data processing. You can use these directly or as templates when building your own tools.

    The example tools above demonstrate different types of functionality:

    • get_weather: External API integration with error handling

    • get_time: System/library function usage with timezone handling

    • search_web: Complex data processing and result formatting

    To create your own tools:

    1. Define your function: Create an async function that takes parameters and returns structured data

    2. Add error handling: Always validate inputs and handle exceptions gracefully

    3. Update the tool schema: Define the function signature for the model

    4. Modify the execution framework: Add your function to the execute_tool_calls function

    Example of a custom tool:

    Nemotron-SEA-LION-v4.8

    Last update: 2026-09-18

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region. Nemotron-SEA-LION-v4.8-30B-A3B-Base built upon the nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 architecture. NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 is a 30-billion parameter base large language model with 3 billion active parameters, built on a Mamba2-Transformer Hybrid Mixture of Experts (MoE) architecture. The model underwent continued pre-training on 150B high-quality tokens across QA, reasoning, code, and translation data using .

    Nemotron-SEA-LION-v4.8-30B-A3B built upon the nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 architecture. NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 is a 30-billion parameter base large language model with 3 billion active parameters. The Nemotron-SEA-LION-v4.8-30B-A3B-Base was fine-tuned with online on-policy distillation (OPD).

    Nemotron-SEA-LION-v4.8-120B-A12B-Base built upon the nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16 architecture. NVIDIA-Nemotron-3-Super-120B-A12B-BF16 is a large language model trained by NVIDIA, featuring a hybrid LatentMoE architecture with interleaved Mamba-2, MoE, and Attention layers, plus Multi-Token Prediction (MTP). This model has 120B total parameters (12B active), supports up to 128k token context, and is optimized for agentic workflows, long-context reasoning, and high-volume workloads. The model underwent continued pre-training on 150B high-quality tokens across QA, reasoning, code, and translation data using .

    Nemotron-SEA-LION-v4.8-120B-A12B built upon the nvidia/NVIDIA-Nemotron-3-Nano-120B-A12B-Base-BF16 architecture. NVIDIA-Nemotron-3-Nano-120B-A12B-Base-BF16 is a 120-billion parameter base large language model with 12 billion active parameters. Nemotron-SEA-LION-v4.8-120B-A12B-Base was fine-tuned with online on-policy distillation (OPD).

    SEA-LION v2

    SEA-LION version 2, released in July 2024, has been continued-pretrained on top of the that is 8 billion parameters in size, with context length of 8192 tokens.

    Using continued-pretraining let us leverage the powerful capabilities of the Llama3 base model and build a stronger model with far fewer resources than pre-training from scratch. Compared to the 980B tokens used in for SEA-LION v1, approximately 48B tokens across 5 SEA languages (English, Indonesia, Tamil, Thai and Vietnamese) was used for the continued pre-training of SEA-LION v2.

    At a glance:

    • Model type: Decoder

    • Tokenizer: Default tokenizer used in Llama 3 8B Instruct

    Folder for the HuggingFace checkpoints from the Mid-Training stage without learning rate annealing. suitable for continued pre-training (CPT) and fine tuning without learning rate warmup.

    1.5%

    LO - Lao

    0.5%

    MS - Malay

    4.75%

    MY - Burmese

    1.75%

    SU - Sundanese

    0.5%

    TA - Tamil

    4.5%

    TH - Thai

    8%

    TL - Filipino

    2.5%

    VI - Vietnamese

    8.5%

    ZH - Chinese

    14%

    MIT
    aisingapore/SEA-LION-E5-Embedding-600M
    aisingapore/SEA-LION-ModernBERT-Embedding-300M
    aisingapore/SEA-LION-ModernBERT-Embedding-600M
    aisingapore/SEA-LION-ModernBERT-300M
    aisingapore/SEA-LION-ModernBERT-600M
    aisingapore/SEA-LION-ModernBERT-300M-checkpoints
    aisingapore/SEA-LION-ModernBERT-600M-checkpoints
  • Customizing Tools

  • is set to
    "required"
    or specific tool is enforced
  • Tool calls are wrapped in ```tool_code blocks

  • Regex patterns needed for extraction

  • Llama-SEA-LION-v3-70B-IT:

    • Fully supports OpenAI-style tool calling

    • Uses tools and tool_choice in API requests

    • Returns structured tool_calls in response

    • Reliable for production tool calling applications

  • Llama-SEA-LION-v3.5-70B-R:

    • Reasoning model without tool calling capability

    • Tool-calling can be done via parsing from message response

    • Can reason about tool usage

    • Take note to parse from message content after reasoning segment, to prevent multiple redundant tool calls

    • Best used for complex reasoning tasks

  • Conversation Flow: Maintain proper conversation history by adding all messages (user, assistant, tool results) to the messages array.

    • Gemma 3 chat template enforces the alternating of user and assistant in message history, hence in the example function execute_tool_calls, the role returned is user and not tool for the tool result

  • Platform Considerations: Some models may behave differently on different platforms (e.g., Ollama vs cloud APIs). Test your implementation on your target platform.

  • Token Efficiency: The text-based approach may use more tokens than standard function calling. Monitor usage accordingly.

  • Tool Implementation Example

    Model-Specific Tool Calling Guides

    Gemma-SEA-LION-v4-27B-IT

    API Request Configuration

    Example Response (Tool-calling not enforced)

    Llama-SEA-LION-v3-70B-IT

    API Request Configuration

    Response Handling

    Example Response

    Llama-SEA-LION-v3.5-70B-R

    API Request Configuration

    Implementation Example

    Points to Take Note Of

    Model-Specific Considerations

    General Best Practices

    Security Considerations

    Performance Optimization

    Relevant Links

    SEA-LION API
    tool implementation page
    Tool Functions
    Tool Schema Definition
    System Prompt
    Response Parsing
    tools parameter
    this example
    tool implementation page
    Gemma 3 Function Calling Example
    OpenAI API Reference - tools
    OpenAI Function Calling Guide
    Tool Execution

    Update system prompts: Include your tool in the system message

    Tool Functions

    Weather Tool Implementation

    Time Tool Implementation

    Web Search Tool Implementation

    Tool Schema Definition

    System Prompt

    Response Parsing

    Tool Execution Framework

    Customizing Tools for Your Application

    # For Gemma-SEA-LION-v4-27B-IT, DO NOT include tools in request
    request_data = {
        "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT",
        "messages": messages,
        "temperature": 0,
        # Note: No tools or tool_choice parameters
    }
    # For models that support native tool calling, include tools and enforce specific tool
    request_data = {
        "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT",
        "messages": messages,
        "temperature": 0,
        "tools": build_tool_schema(),
        "tool_choice": {
            "type": "function",
            "function": {"name": "get_current_weather"}  # Force use of specific tool
        }
    }
    
    # Alternative: Force any tool call (not a specific one)
    request_data_any_tool = {
        "model": "aisingapore/Gemma-SEA-LION-v4-27B-IT", 
        "messages": messages,
        "temperature": 0,
        "tools": build_tool_schema(),
        "tool_choice": "required"  # Force model to use any available tool
    }
    {
      "choices": [{
        "message": {
          "content": "```tool_code\nget_time(timezone=\"Asia/Singapore\")\n```",
          "role": "assistant"
        }
      }]
    }
    # For Llama-SEA-LION-v3-70B-IT, include tools and tool_choice
    request_data = {
        "model": "aisingapore/Llama-SEA-LION-v3-70B-IT",
        "messages": messages,
        "temperature": 0,
        "tools": build_tool_schema(),
        "tool_choice": "auto"
    }
    def extract_tool_calls(data):
        """Extract tool calls from the response data."""
        choice = data.get("choices", [{}])[0] if data.get("choices") else {}
        return choice.get("message", {}).get("tool_calls")
    
    # Usage
    tool_calls = extract_tool_calls(response_data)
    if tool_calls:
        # Execute tool calls directly
        tool_results = await execute_tool_calls(tool_calls, session)
    {
      "choices": [{
        "message": {
          "content": null,
          "role": "assistant",
          "tool_calls": [{
            "function": {
              "arguments": "{\"timezone\": \"Asia/Singapore\"}",
              "name": "get_time"
            },
            "id": "chatcmpl-tool-920019c71dd14d96a262ec798b778ccd",
            "type": "function"
          }]
        }
      }]
    }
    # For reasoning models, do NOT include tools to avoid errors
    def is_reasoning_model(model_name):
        return model_name.endswith('-R')
    
    # Request configuration
    if is_reasoning_model(api_config["model"]):
        request_data = {
            "model": "aisingapore/Llama-SEA-LION-v3.5-70B-R",
            "messages": messages,
            "temperature": 0,
            # No tools or tool_choice parameters
        }
    else:
        request_data = {
            "model": api_config["model"],
            "messages": messages,
            "temperature": 0,
            "tools": tools,
            "tool_choice": "auto"
        }
    async def process_user_message(user_message, messages, api_config, session):
        """Process a user message and handle tool calls for different model types."""
        messages.append({"role": "user", "content": user_message})
        tools = build_tool_schema()
        
        # Check model type
        is_reasoning_model = api_config["model"].endswith('-R')
        
        # Configure request based on model type
        request_data = {
            "model": api_config["model"],
            "messages": messages,
            "temperature": 0,
        }
        
        # Only add tools for non-reasoning models
        if not is_reasoning_model:
            request_data["tools"] = tools
            request_data["tool_choice"] = "auto"
        
        headers = {"Authorization": f"Bearer {api_config['api_key']}"}
        
        async with session.post(
            api_config["api_url"],
            json=request_data,
            headers=headers,
            timeout=30
        ) as response:
            data = await response.json()
        
        assistant_message = data.get("choices", [{}])[0].get("message")
        if not assistant_message:
            return
            
        messages.append(assistant_message)
        
        # Handle tool calls based on model type
        tool_calls = extract_tool_calls(data)
        if not tool_calls:
            # Tool call not found, parse tool call from message content
            message_content = assistant_message.get("content", "")
            if is_reasoning_model:
                # Check for tool call only in non-reasoning content to prevent excess calls
                message_content = message_content.split("</think>")[1].strip()
            tool_calls = parse_tool_calls_from_text(message_content)
        
        if tool_calls:
            # Execute tools and get final response
            tool_results = await execute_tool_calls(tool_calls, session)
            messages.extend(tool_results)
            
            # Get final response with tool results
            final_response = await session.post(
                api_config["api_url"],
                json={"model": api_config["model"], "messages": messages, "temperature": 0},
                headers=headers,
                timeout=30
            )
            final_data = await final_response.json()
            
            final_message = final_data.get("choices", [{}])[0].get("message")
            if final_message:
                print(final_message["content"])
                messages.append(final_message)
        else:
            # No tool calls, show direct response
            print(assistant_message.get("content", ""))
    is_reasoning_model = model_name.endswith('-R')
    if not tool_calls or not isinstance(tool_calls, list):
        # Handle no tool calls case
    async def get_weather(location, session):
        """Get weather information using Open-Meteo API."""
        if not location or not isinstance(location, str):
            raise ValueError("Invalid location")
    
        # Geocoding request to resolve location
        geocode_url = "https://geocoding-api.open-meteo.com/v1/search"
        geocode_params = {
            "name": location,
            "count": 1,
            "language": "en",
            "format": "json",
        }
        
        async with session.get(geocode_url, params=geocode_params, timeout=20) as response:
            geo_data = await response.json()
        
        results = geo_data.get("results", [])
        if not results:
            raise ValueError(f"No results found for location: {location}")
        
        first = results[0]
        latitude = first["latitude"]
        longitude = first["longitude"]
        resolved = {
            "name": first["name"],
            "country": first["country"],
            "admin1": first.get("admin1"),
            "latitude": latitude,
            "longitude": longitude,
            "timezone": first.get("timezone"),
        }
    
        # Weather forecast request
        forecast_url = "https://api.open-meteo.com/v1/forecast"
        forecast_params = {
            "latitude": latitude,
            "longitude": longitude,
            "current": "temperature_2m,apparent_temperature,relative_humidity_2m,weather_code,wind_speed_10m",
            "wind_speed_unit": "kmh",
            "timezone": "auto",
        }
        
        async with session.get(forecast_url, params=forecast_params, timeout=20) as response:
            forecast_data = await response.json()
    
        current = forecast_data.get("current")
        units = forecast_data.get("current_units")
        if not current:
            raise ValueError("Weather data unavailable")
    
        return {
            "locationQueried": location,
            "resolvedLocation": resolved,
            "current": current,
            "units": units,
            "source": "open-meteo.com",
        }
    from datetime import datetime
    from zoneinfo import ZoneInfo
    
    async def get_current_time(timezone):
        """Get current time in specified timezone."""
        if not timezone or not isinstance(timezone, str):
            raise ValueError("Invalid timezone")
    
        try:
            now = datetime.now()
            tz = ZoneInfo(timezone)
            time_in_timezone = now.astimezone(tz)
            
            formatted_time = time_in_timezone.strftime("%m/%d/%Y, %I:%M:%S %p %Z")
            
            return {
                "timezone": timezone,
                "currentTime": formatted_time,
                "utcTime": now.isoformat() + "Z",
                "timestamp": int(now.timestamp() * 1000)
            }
        except Exception as err:
            raise ValueError(f"Invalid timezone: {timezone}")
    import os
    
    async def search_web(query, session):
        """Search web using SEARXNG (requires SEARXNG_URL environment variable)."""
        if not query or not isinstance(query, str):
            raise ValueError("Invalid search query")
    
        try:
            # You'll need to set up SEARXNG or use another search API
            search_url = f"{os.getenv('SEARXNG_URL')}/search"
            search_params = {
                "q": query,
                "format": "json",
                "engines": "google,duckduckgo,bing"
            }
            
            async with session.get(search_url, params=search_params, timeout=15) as response:
                search_data = await response.json()
    
            results = search_data.get("results", [])
            if not results:
                raise ValueError("No search results found")
    
            # Return top 5 results with cleaned data
            top_results = []
            for result in results[:5]:
                top_results.append({
                    "title": result.get("title", ""),
                    "url": result.get("url", ""),
                    "content": result.get("content") or result.get("snippet", ""),
                    "engine": result.get("engine", "")
                })
    
            return {
                "query": query,
                "resultsCount": len(results),
                "topResults": top_results,
                "source": "searxng"
            }
        except Exception as err:
            raise ValueError(f"Search failed: {str(err)}")
    def build_tool_schema():
        return [
            {
                "type": "function",
                "function": {
                    "name": "get_weather",
                    "description": "Get the current weather information for a location.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city or location to get weather for"
                            },
                        },
                        "required": ["location"],
                        "additionalProperties": False,
                    },
                },
            },
            {
                "type": "function",
                "function": {
                    "name": "get_time",
                    "description": "Get the current time in a specified timezone.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "timezone": {
                                "type": "string",
                                "description": 'The timezone to get time for (e.g., "America/New_York", "Europe/London", "Asia/Singapore")'
                            },
                        },
                        "required": ["timezone"],
                        "additionalProperties": False,
                    },
                },
            },
            {
                "type": "function",
                "function": {
                    "name": "search_web",
                    "description": "Search the web for information using SEARXNG search engine.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "query": {
                                "type": "string",
                                "description": "The search query to look for on the web"
                            },
                        },
                        "required": ["query"],
                        "additionalProperties": False,
                    },
                },
            },
        ]
    def build_system_message():
        return {
            "role": "system",
            "content": (
                "You are a helpful assistant with access to weather information, time checking, and web search capabilities. "
                "\n\nYou have three tools available: get_weather, get_time, and search_web. "
                "\n\nIMPORTANT: When you need to use a tool, you MUST wrap the function call in a tool_code code block using the exact format specified below:"
                "\n\nFOR WEATHER:\n```tool_code\nget_weather(location=\"City Name\")\n```"
                "\n\nFOR TIME:\n```tool_code\nget_time(timezone=\"Timezone\")\n```"
                "\n\nFOR WEB SEARCH:\n```tool_code\nsearch_web(query=\"search terms\")\n```"
                "\n\nCRITICAL REQUIREMENTS:"
                "\n- Always wrap tool calls in ```tool_code code blocks"
                "\n- Use the EXACT function call syntax shown above"
                "\n- Always use double quotes around parameter values"
                "\n- Do NOT use JSON format or any other format"
                "\n- When a user asks for weather, time, or current information, you MUST use the appropriate tool"
                "\n- Do NOT try to answer from your knowledge alone for these requests"
                "\n\nAfter receiving tool results, provide a helpful response based on the actual data returned."
            )
        }
    def parse_tool_calls_from_text(content):
        """Parse tool calls from text content using regex patterns."""
        if not content or not isinstance(content, str):
            return None
        
        # Extract content from tool_code blocks
        tool_code_pattern = r'```tool_code\s*([\s\S]*?)\s*```'
        tool_code_matches = re.findall(tool_code_pattern, content)
        
        search_content = '\n'.join(tool_code_matches) if tool_code_matches else content
        
        # Define regex patterns for different tool calls
        patterns = [
            (r'get_weather\s*\(\s*location\s*=\s*[\'"]([^\'"]+)[\'"]\s*\)', "get_weather", "location"),
            (r'get_time\s*\(\s*timezone\s*=\s*[\'"]([^\'"]+)[\'"]\s*\)', "get_time", "timezone"),
            (r'search_web\s*\(\s*query\s*=\s*[\'"]([^\'"]+)[\'"]\s*\)', "search_web", "query"),
        ]
        
        results = []
        for pattern, func_name, param_name in patterns:
            matches = re.findall(pattern, search_content)
            for i, match in enumerate(matches):
                results.append({
                    "id": f"text_parsed_{func_name}_{i}",
                    "function": {
                        "name": func_name,
                        "arguments": json.dumps({param_name: match})
                    }
                })
        
        return results if results else None
    async def execute_tool_calls(tool_calls, session):
        """Execute the tool calls and return results."""
        results = []
        
        for call in tool_calls:
            name = call.get("function", {}).get("name")
            args = call.get("function", {}).get("arguments")
            try:
                args = json.loads(args) if isinstance(args, str) else args
            except json.JSONDecodeError:
                args = {}
    
            try:
                if name == "get_weather":
                    location = args.get("location")
                    result = await get_weather(location, session)
                elif name == "get_time":
                    timezone = args.get("timezone")
                    result = await get_current_time(timezone)
                elif name == "search_web":
                    query = args.get("query")
                    result = await search_web(query, session)
                else:
                    result = {"error": f"Unknown tool: {name}"}
    
                results.append({
                    "tool_call_id": call.get("id"),
                    "role": "user",
                    "name": name,
                    "content": json.dumps(result)
                })
            except Exception as err:
                error_result = {"name": name, "error": str(err)}
                results.append({
                    "tool_call_id": call.get("id"),
                    "role": "user", 
                    "name": name,
                    "content": json.dumps(error_result)
                })
        
        return results
    # Custom database query tool
    async def query_database(table, filters):
        """Query database with filters."""
        if not table or not isinstance(table, str):
            raise ValueError("Invalid table name")
        
        # Your database logic here
        # This is just an example structure
        try:
            # connection = await get_db_connection()
            # results = await connection.fetch(f"SELECT * FROM {table} WHERE {filters}")
            results = [{"id": 1, "name": "example"}]  # placeholder
            
            return {
                "table": table,
                "filters": filters,
                "results": results,
                "count": len(results)
            }
        except Exception as err:
            raise ValueError(f"Database query failed: {str(err)}")
    
    # Add to tool schema
    {
        "type": "function",
        "function": {
            "name": "query_database",
            "description": "Query a database table with optional filters.",
            "parameters": {
                "type": "object",
                "properties": {
                    "table": {"type": "string", "description": "The table name to query"},
                    "filters": {"type": "string", "description": "SQL WHERE clause filters"}
                },
                "required": ["table"],
                "additionalProperties": False,
            },
        },
    }

    SEA-LION stands for Southeast Asian Languages In One Network.

    We performed CPT in English and SEA languages on nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16, a text generation model using the nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 architecture, to create Nemotron-SEA-LION-v4.8-30B-A3B-Base.

    For tokenization, the model employs the default tokenizer used in nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Base LLM (Mamba2-Transformer Hybrid MoE)

    • Context Length: 8K (Base model), 262K

    • Language(s): Balinese, Burmese, English, Indonesian, Javanese, Khmer, Lao, Malay, Mandarin, Sundanese, Tamil, Thai, and Vietnamese

    • License:

    • Finetuned from model:

    • Repository: SEA-LION v4.8 - an aisingapore Collection

    The continued pretraining dataset comprised 150B tokens on QA, CoT, Reasoning and parallel (translation) datasets adapted from

    • AI-MO/NuminaMath-CoT

    • aisingapore/SEA-Instruct-2602

    • HuggingFaceFW/finetranslations-edu

    • jhu-clsp/megawika-2

    Our continue pretraining workflow focused on parallel-only dataset for better multilingual and cross-lingual performance running on Megatron Bridge.

    The data are generated and consumed continuously through a collection of heterogeneous tasks and agent harnesses. The training data is a subset of aisingapore/SEA-Instruct-2602.

    For details on Nemotron-SEA-LION-v4.8 performance, please refer to the SEA-LION Leaderboard.

    The architecture is based on the highly efficient Nemotron-3-Super foundation. The detailed architecture can be found at nvidia/NVIDIA-Nemotron-3-Super-30B-A3B-Base-BF16 documentation. and nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 documentation.

    Use the code below to get started with the model with 🤗 Transformers libraries.

    We provide multiple quantization formats to optimize deployment trade-offs between memory footprint and output quality.

    • Nemotron-SEA-LION-v4.8-30B-A3B-NVFP4

    • Nemotron-SEA-LION-v4.8-30B-A3B-FP8

    • Nemotron-SEA-LION-v4.8-30B-A3B-GGUF

    • Nemotron-SEA-LION-v4.8-120B-A12B-NVFP4

    Model Weights included in each GGUF repository:

    • Q4_K_M 120B-A12B, 30B-A3B

    • Q6_K 120B-A12B, 30B-A3B

    • Q8_0 120B-A12B, 30B-A3B

    • F16 120B-A12B, 30B-A3B

    Each checkpoint was served with vLLM on NVIDIA H200 GPUs and benchmarked over the OpenAI-compatible chat endpoint with GuideLLM, an open-source throughput benchmark from the vLLM project.

    The prompts are our own Southeast Asian instructions from the SEA-instruct dataset, streamed with a fixed output length per request so that every checkpoint generates the same number of tokens.

    Time to first token is the time taken from sending the request until the first content token arrives, so it covers prompt processing (prefill) and network overhead on localhost. Tokens per second is a metric that measures the number of output tokens divided by that request's total time from send to final token. Both are reported as mean ± standard deviation over all requests completed in a 120-second run. The VRAM Usage is taken from vLLM upon loading.

    Model Variant
    Number of GPUs
    Actual VRAM Usage (GB)
    Time to First Token (s)
    Tokens per Second

    30B-A3B(BF16)

    1x H200 GPU(s)

    63.3 GB

    0.0456

    311.10 ± 25.12

    30B-A3B-FP8

    1x H200 GPU(s)

    Note: Benchmarks were captured on Hopper architecture (NVIDIA H200) GPUs; NVFP4 precision formats yield further hardware-level acceleration when executed natively on NVIDIA Blackwell infrastructure.

    All models were served at their full context length of 262,144 tokens with default vLLM settings. The tokens per second are reported as the aggregate across the GPUs used.

    FP8 checkpoints are a good default for reduced-precision deployment. NVFP4 checkpoints offer a 4-bit alternative designed for NVIDIA's Blackwell architecture.

    The figures reflect Hopper execution, and the checkpoints have not yet been benchmarked on Blackwell. We recommend measuring on your own workload before choosing a format.

    We recommend the FP8 static checkpoint as the default for both model sizes. It is the fastest format we ship, exceeding BF16 in both throughput and latency, and it matches BF16 within noise on SEA-HELM. The 30B fits on a single 40 GB GPU on a single H200. FP8 is also our recommended format for long-prompt, retrieval-style workloads.

    NVFP4 is the option when memory is the binding constraint on NVIDIA hardware. It has the smallest footprint of our formats, at a small quality cost relative to FP8. As it is specifically optimized for Blackwell GPUs, it is expected to run natively as W4A4, though we have not benchmarked this yet.

    You can serve the model using vllm [link]:

    You can serve the model using SGLang:

    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.

    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.

    BibTeX:

    Nemotron-SEA-LION-v4.8

    Megatron Bridge
    Automodel
    from transformers import AutoTokenizer, AutoModelForCausalLM
    import torch
    model_name = "aisingapore/Nemotron-SEA-LION-v4.8-30B-A3B"
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(
        model_name,
        torch_dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto"
    )
    messages = [
        {"role": "user", "content": "What is Nasi goreng?"},
    ]
    tokenized_chat = tokenizer.apply_chat_template(
        messages,
        tokenize=True,
        add_generation_prompt=True,
        return_tensors="pt"
    ).to(model.device)
    if not isinstance(tokenized_chat, torch.Tensor):
        input_ids = tokenized_chat["input_ids"]
    else:
        input_ids = tokenized_chat
    outputs = model.generate(
        input_ids,
        max_new_tokens=50,
        temperature=1.0,
        top_p=0.95,
        eos_token_id=tokenizer.eos_token_id
    )
    print(tokenizer.decode(outputs[0]))
    from vllm import LLM, SamplingParams
    llm = LLM(
        model="aisingapore/Nemotron-SEA-LION-v4.8-120B-A12B-FP8",
        trust_remote_code=True,   # needed for Nemotron hybrid Mamba/MoE configs
        max_model_len=8192,       # lower this if you hit KV-cache OOM
    )
    messages = [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Where is Lau Pa Sat? Tell me in a single sentence."},
    ]
    params = SamplingParams(temperature=0.7, top_p=0.9, max_tokens=512)
    outputs = llm.chat(messages, params)
    print(outputs[0].outputs[0].text)
    from sglang import Engine, SamplingParams
    # SGLang natively detects the pre-quantized FP8 checkpoint
    llm = Engine(
        model_path="aisingapore/Nemotron-SEA-LION-v4.8-120B-A12B-FP8",
        trust_remote_code=True,
    )
    messages = [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Where is Lau Pa Sat? Tell me in a single sentence."},
    ]
    # Configure generation constraints
    params = SamplingParams(temperature=0.7, top_p=0.9)
    # Execute inference using the OpenAI-compatible chat message format
    outputs = llm.chat(messages, params)
    print(outputs["text"])
    @misc{aisingapore2026sealionv48technicalreport,
          title={SEA-LION-v4.8: A Technical Report},
          author={Adila Aulia and Ahmed Dabeer and Ahn Jeongmi and Antonyrex Sajeban and Chan Hok Teng Adwin and Cheng Zi Yi Nicholas and Choa Hsueh Mei Esther and Heng Jonathan and Jann Railey Estrada Montalan and Lee Chwan Ren and Leong Wai Yi and Leong Wei Qi and Liew Rachel and Limkonchotiwat Peerat and Muhammad Ridzuan Bin Mokhtar and Nagarajan Karthik and Ng Boon Cheong Raymond and Ngee Chia Tai and Ngui Jian Gang and Nguyen Thanh Ngan and Ong Tat-Wee David and Pereira Mark and Phang Shi Wei Benjamin and Poon Joseph and Rengarajan Hamsawardhini and Susanto Yosephine and Sutaveephamochanon Anocha and Tan Choon Meng and Tan Chor Phin Evelyn and Tan Le Min Sheryl and Tan Siao Wei Jessica and Tan Yixian and Tasawong Panuthep and Tee Jun Yun and Teng Kok Wai Walter and Teo Eng Sipp Leslie and Tjhi William and Tuchinda Pume and Wu Donghang and Yong Xianbin and Zhang Zhou},
          year={2026},
          eprint={2609.18310},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2609.18310},
    }

    Model Details

    Model Description

    Model Sources

    Training Details

    Training Data for Base model

    Training Regime for Base model

    Training Data for On-Policy Distillation

    Training Regime for On-Policy Distillation

    Results

    Technical Specifications

    Model Architecture

    How to Get Started with the Model

    Available Quantized Versions

    Throughput Test

    Recommended Usage

    How to Get Started with a Quantized Model

    Using vLLM

    SGLang

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    Citation

    Training Data Size: 48B tokens of SEA data

  • Context Length: 8192

  • Available Formats:

    • Base (Llama-SEA-LION-v2-8B)

    • Instruct (Llama-SEA-LION-v2-8B-IT)

    • GGUF (Llama-SEA-LION-v2-8B-IT-GGUF)

  • Supported Languages:

    1. English

    2. Indonesian

    3. Thai

    4. Vietnamese

    5. Tamil

  • License: Llama3 Community License

  • Llama-SEA-LION-v2-8B was trained using MosaicML Composer on the following hardware:

    Training Details
    Llama-SEA-LION-v2-8B

    AWS EC2 p5d.24xlarge

    8 instances

    Nvidia H100 80GB GPU

    64

    Training Duration

    2 days

    Configuration

    HyperParameter
    Llama-SEA-LION-v2-8B

    Precision

    bfloat16

    Optimizer

    decoupled_adamw

    Scheduler

    weight_stable_decay

    Learning Rate

    1.0e-5

    Global Batch Size

    For tokenisation, the model employs the default tokenizer used in Llama 3 8B Instruct.

    The Llama-SEA-LION-v2-8B base model was continued pre-trained on 48B tokens of the following data:

    Data Source
    Unique Tokens (B)
    Multiplier
    Total Tokens (B)
    Percentage (%)

    Dolma RefinedWeb - English

    7.650

    1

    7.650

    15.90

    Dolma C4 - English

    Note:

    • All token counts are counted using Llama3 tokenizer

    • wiki* sources includes Wikipedia, Wiki Books, Wiki Source and Wiki Voyage

    • Tamil news is sourced with permission from Seithi

    We evaluated Llama-SEA-LION-v2-8B base model on general language capabilities.

    For the evaluation of general language capabilities in SEA languages, we employed the BHASA evaluation benchmark 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 Summarization (Summ), Causal Reasoning (Causal) and Natural Language Inference (NLI).

    The evaluation was done five-shot with native prompts and only a sample of 100-1000 instances for each dataset was used as per the setting described in the paper.

    For more details on Llama-SEA-LION-v2-8B benchmark performance, please refer to the SEA HELM leaderboard, https://leaderboard.sea-lion.ai/

    Llama-SEA-LION-v2-8B-IT is a multilingual instruction-following model which has been fine-tuned with around 100,000 English instruction-completion pairs alongside a smaller pool of around 50,000 instruction-completion pairs from other ASEAN languages, such as Indonesian, Thai and Vietnamese.

    These instructions have been carefully curated and rewritten to ensure the model was trained on truly open, commercially permissive and high quality datasets.

    The Llama-SEA-LION-v2-8B-IT model was fine-tuned using 8x A100-40GB using parameter efficient fine tuning in the form of LoRA.

    Llama-SEA-LION-v2-8B-IT was trained on a wide range of instructions that were manually and stringently verified by our team. A large portion of the effort was dedicated to ensuring that each instruction-completion pair that the model sees is of high quality and any errors were corrected and rewritten by native speakers or else dropped from our mix.

    In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data source.

    We evaluated Llama-SEA-LION-v2-8B-IT on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the BHASA evaluation benchmark 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 Summarization (Summ), Causal Reasoning (Causal) and Natural Language Inference (NLI).

    Note: BHASA is implemented following a strict answer format, and only spaces and punctuations are cleaned. For tasks where options are provided, the answer should only include one of the pre-defined options, nothing else. If the model continues to generate more tokens (e.g. to explain its answer), it will be considered to be a wrong response. For the F1 score metric (as used in Sentiment Analysis and Toxicity Detection), all answers that do not fall under the pre-defined labels will be treated as a separate label (to mark it as a wrong answer) and included in the calculations so that the model is penalized for not generating one of the pre-defined labels.

    The evaluation was done zero-shot with native prompts and only a sample of 100-1000 instances for each dataset was used as per the setting described in the paper.

    Since Llama-SEA-LION-v2-8B-IT is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, IFEval and MT-Bench.

    As these two datasets were originally in English, the linguists and native speakers in the team worked together to filter, localize and translate the datasets into the respective target languages to ensure that the examples remained reasonable, meaningful and natural.

    IFEval

    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. The metric used is accuracy normalized by language (if the model performs the task correctly but responds in the wrong language, it is judged to have failed the task).

    MT-Bench

    MT-Bench 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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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)). A tie is given a score of 0.5.

    The following quantized GGUF formats of our Llama-SEA-LION-v2-8B-IT model are available:

    • Llama-SEA-LION-v2-8B-IT-Q2_K

    • Llama-SEA-LION-v2-8B-IT-Q3_K_M

    • Llama-SEA-LION-v2-8B-IT-Q4_0

    • Llama-SEA-LION-v2-8B-IT-Q4_K_M

    • Llama-SEA-LION-v2-8B-IT-Q5_0

    • Llama-SEA-LION-v2-8B-IT-Q5_K_M

    • Llama-SEA-LION-v2-8B-IT-Q6_K

    • Llama-SEA-LION-v2-8B-IT-Q8_0

    Please refer to our Download the Model(s) section for more details on how to access them.

    SEA-LION v2 models are available for download via the following channels:

    HuggingFace SEA-LION v2 Collection

    Model
    Download

    Llama-SEA-LION-v2-8B

    Llama-SEA-LION-v2-8B-IT

    Llama-SEA-LION-v2-8B-IT-GGUF

    ,

    Llama-SEA-LION-v2-8B-IT can be run using the 🤗 Transformers library

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    Introduction

    Llama 3 8B Instruct model
    # Please use transformers==4.43.2
    
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v2-8B-IT"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    @misc{lowphansirikul2021wangchanberta,
        title={WangchanBERTa: Pretraining transformer-based Thai Language Models},
        author={Lalita Lowphansirikul and Charin Polpanumas and Nawat Jantrakulchai and Sarana Nutanong},
        year={2021},
        eprint={2101.09635},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
    }

    Llama-SEA-LION-v2-8B

    Training Infrastructure

    Tokenizer

    Training Data

    Benchmark Performance

    General Language Capabilities

    Llama-SEA-LION-v2-8B-IT

    Fine-Tuning Methodology

    Fine-Tuning Data

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Llama-SEA-LION-v2-8B-IT-GGUF

    Download the Model(s)

    Usage

    Disclaimer

    References

    Thai Pre-Training Data Reference

    Gemma-SEA-LION-v3-9B

    Introduction

    Our Gemma-SEA-LION-v3-9B models have been continued pre-trained on top of the Gemma2 base model that is 9 billion parameters in size, and has a context length of 8192.

    The training data for Gemma-SEA-LION-v3-9B comprises approximately 200B tokens of Burmese, Chinese, English, Filipino, Indonesia, Khmer, Lao, Malay, Tamil, Thai and Vietnamese. The training data is sampled from the Dolma dataset, the original SEA-LION pretraining data, and Wiki sources for Burmese, Chinese, English, Filipino, Khmer, Lao, Malay, Indonesian, Tamil, Thai and Vietnamese. In addition, the training data for SFT for the Instruct model includes Javanese and Sudanese.

    Gemma-SEA-LION-v3-9B benefits from the strong Gemma2 performance in Southeast Asian (SEA) languages, allowing it to significantly outperform its predecessors across SEA evaluation metrics, indicating improved language capabilities for the SEA region.

    Due to its pre-training and fine-tuning data mix, Gemma-SEA-LION-v3-9B exhibits a boost in natural language reasoning (NLR) abilities in Indonesian, Tamil, Thai and Vietnamese, and achieves state-of-the-art performances in SEA instruction-following and multi-turn chat, while retaining Gemma2’s general abilities.

    At a glance:

    • Model type: Decoder

    • Tokenizer: Default tokenizer used in Gemma2 9B

    • Training Data Size: 200B tokens of SEA data

    • Context Length: 8192

    • Available Formats:

      • Base (Gemma-SEA-LION-v3-9B)

      • Instruct (Gemma-SEA-LION-v3-9B-IT)

      • GGUF (Gemma-SEA-LION-v3-9B-IT-GGUF)

    • Supported Languages:

      1. Burmese

      2. Chinese

      3. English

      4. Filipino

    • License:

    Gemma-SEA-LION-v3-9B was trained using on the following hardware:

    Training Details
    Gemma-SEA-LION-v3-9B

    Configuration

    HyperParameter
    Gemma-SEA-LION-v3-9B

    For tokenisation, the model employs the default tokenizer used in Gemma2 9B.

    Gemma-SEA-LION-v3-9B base model was continued pre-trained on 200B tokens of the following data:

    Language
    Source
    Total Tokens (B)
    Percentage (%)
    Total percentage (%)

    Note:

    • All token counts are counted using Gemma2 9B tokenizer

    • SEA-LION Pile v1 is processed from Common Crawl WET, which is published . The cutoff date of this version is September 2020.

    • SEA-LION Pile v2 is processed from Common Crawl WARC from October 2020 to April 2024.

    • Tamil news is sourced with permission from

    We evaluated Gemma-SEA-LION-v3-9B base model on general language capabilities.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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 Summarization (Summ), Causal Reasoning (Causal) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done five-shot with native prompts on a sample of 100-1000 instances for each dataset.

    For more details on Gemma-SEA-LION-v3-9B base benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/

    Gemma-SEA-LION-v3-9B-IT is a multilingual instruction-following model which has been fine-tuned with around 500,000 English instruction-completion pairs alongside a larger pool of around 1,000,000 instruction-completion pairs from other ASEAN languages, such as Indonesian, Thai and Vietnamese.

    Gemma-SEA-LION-v3-9B-IT was built using a combination of a full parameter fine-tune, on-policy alignment, and model merges of the best performing checkpoints. The training process for fine-tuning was approximately 15 hours, with alignment taking 2 hours, both on 8x H100-80GB GPUs.

    Gemma-SEA-LION-v3-9B-IT was trained on a wide range of synthetic instructions, alongside publicly available instructions hand-curated by the team with the assistance of native speakers. In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data source.

    Our partners at GoTo have continued pretrained and instruction tuned a variant of Gemma-SEA-LION-v3-9B, specifically enhancing its capabilities for Indonesian, Javanese, and Sundanese languages. Find the continued pretrained model at , and its corresponding instructioned tuned version at .

    We evaluated Gemma-SEA-LION-v3-9B-IT on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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 Summarization (Summ), Causal Reasoning (Causal) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Since Gemma-SEA-LION-v3-9B-IT is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, and .

    As these two datasets were originally in English, the linguists and native speakers in the team worked together to filter, localize and translate the datasets into the respective target languages to ensure that the examples remained reasonable, meaningful and natural.

    IFEval

    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 normalized 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).

    MT-Bench

    MT-Bench 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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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). A tie is given a score of 0.5.

    For more details on Gemma-SEA-LION-v3-9B-IT benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/

    The following quantized GGUF formats of our Gemma-SEA-LION-v3-9B-IT model are available:

    • Gemma-SEA-LION-v3-9B-IT-F16

    • Gemma-SEA-LION-v3-9B-IT-Q2_K

    • Gemma-SEA-LION-v3-9B-IT-Q3_K_M

    • Gemma-SEA-LION-v3-9B-IT-Q4_0

    • Gemma-SEA-LION-v3-9B-IT-Q4_K_M

    Please refer to our section for more details on how to access them.

    Gemma-SEA-LION-v3-9B models are available for download via the following channels:

    Model
    Download

    NOTE This model has not been trained to use a system prompt or to use tool calling.

    Gemma-SEA-LION-v3-9B-IT can be run using the 🤗 Transformers library

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. Current SEA-LION models, including this commercially permissive release, have 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.

    Llama-SEA-LION-v3-8B

    Introduction

    Our Llama-SEA-LION-v3-8B models have been continued pre-trained on top of Llama 3.1 8B Instruct that is 8 billion parameters in size, with context length of 128K tokens, making it one of the SEA-LION models with the longest context length to date. It achieves state-of-the-art performance on regional benchmarks like SEA-HELM and outperforms models such as Llama 3.3 70B Instruct on key metrics.

    Llama-SEA-LION-v3-8B was trained on data comprised of approximately 200B tokens across 11 SEA languages: Burmese, Chinese, English, Filipino, Indonesia, Khmer, Lao, Malay, Tamil, Thai and Vietnamese.

    Llama-SEA-LION-v3-8B-IT was fine-tuned in two stages on approximately 12.3M English instruction-completion pairs alongside a pool of 4.5M Southeast Asian instruction-completion pairs from SEA languages such as Indonesian, Javanese, Sundanese, Tamil, Thai and Vietnamese.

    At a glance:

    • Model type: Decoder

    • Tokenizer: Default tokenizer used in Llama 3.1 8B Instruct

    • Context Length: 128K

    • Available Formats:

      • Base (Llama-SEA-LION-v3-8B)

      • Instruct (Llama-SEA-LION-v3-8B-IT)

      • GGUF (Llama-SEA-LION-v3-8B-IT-GGUF)

    • Supported Languages:

      1. Burmese

      2. Chinese

      3. English

      4. Filipino

    • License:

    Llama-SEA-LION-v3-8B was trained using on the following hardware:

    Training Details
    Llama-SEA-LION-v3-8B

    Configuration

    HyperParameter
    Llama-SEA-LION-v3-8B

    For tokenisation, the model employs the default tokenizer used in Llama 3.1 8B Instruct.

    Llama-SEA-LION-v3-8B base model was continued pre-trained on 200B tokens of the following data:

    Language
    Source
    Total Tokens (B)
    Percentage (%)
    Total percentage (%)

    Note:

    • All token counts are counted using Llama 3.1 8B Instruct tokenizer

    • SEA-LION Pile v1 is processed from Common Crawl WET, which is published . The cutoff date of this version is September 2020.

    • SEA-LION Pile v2 is processed from Common Crawl WARC from October 2020 to April 2024.

    • Tamil data from Sangraha is published . The paper can be found .

    We evaluated Llama-SEA-LION-v3-8B base model on general language capabilities and constraint-following behaviour.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done five-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Following the implementation of IFEval in OpenLLM leaderboard, we also implement SEA-IFEval to provide a comparison of the ability of the model to follow specific constraints in English and in SEA languages.

    SEA-IFEval

    Based on , 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.

    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).

    For more details on Llama-SEA-LION-v3-8B base benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    Llama-SEA-LION-v3-8B-IT is a multilingual instruction-following model that has been fine-tuned in two stages on approximately 12.3M English instruction-completion pairs alongside a pool of 4.5M Southeast Asian instruction-completion pairs from SEA languages such as Indonesian, Javanese, Sundanese, Tamil, Thai and Vietnamese.

    We performed instruction tuning in English and also in SEA languages such as Indonesian, Javanese, Sundanese, Tamil, Thai and Vietnamese on our continued pre-trained Llama-SEA-LION-v3-8B, to create Llama-SEA-LION-v3-8B-IT.

    Llama-SEA-LION-v3-8B-IT was trained on a wide range of synthetic instructions, alongside publicly available instructions hand-curated by the team with the assistance of native speakers. In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data source.

    We evaluated Llama-SEA-LION-v3-8B Instruct on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Since Llama-SEA-LION-v3-8B-IT is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, SEA-IFEval (based on ) and SEA-MTBench (based on ).

    As these 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.

    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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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). A tie is given a score of 0.5.

    For more details on Llama-SEA-LION-v3-8B-IT benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    The following quantized GGUF formats of our Llama-SEA-LION-v3-8B-IT model are available:

    • Llama-SEA-LION-v3-8B-IT-F16

    • Llama-SEA-LION-v3-8B-IT-Q2_K

    • Llama-SEA-LION-v3-8B-IT-Q3_K_M

    • Llama-SEA-LION-v3-8B-IT-Q4_0

    • Llama-SEA-LION-v3-8B-IT-Q4_K_M

    Please refer to our section for more details on how to access them.

    Llama-SEA-LION-v3-8B models are available for download via the following channels:

    Model
    Download

    Llama-SEA-LION-v3-8B-IT can be run using the 🤗 Transformers library

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    Gemma-SEA-LION-Guard-v2

    SEA-LION-Guard is a collection of safety-focused Large Language Models (LLMs) designed specifically for the Southeast Asia (SEA) region. Alongside releasing the open model weights, we also offer a single API endpoint that exclusively serves this decision-based finetuned Gemma model. You can generate an API key to access this model at sea-lion api key manager.

    Model Details

    SEA-LION stands for Southeast Asian Languages In One Network and is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Model Description

    Unlike the SEA-Guard (renamed as SEA-LION-Guard v1) series, which is designed exclusively for Content Moderation, the SEA-LION-Guard-v2 series supports both Content Moderation and Action Governance.

    Key enhancements in SEA-LION-Guard-v2 over SEA-Guard:

    • Multi-turn Conversation Evaluation: Evaluates safety across multi-turn interactions.

    • Bring Your Own Policy (BYOP): Allows users to define and enforce their own sets of safety rules and policies.

    • Tool Interaction Evaluation: Evaluates tool calls and tool responses to ensure safe and policy-compliant agent behavior.

    For tokenization, the model employs the default tokenizer used in and .

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: National Research Foundation Singapore

    • Shared by: AI Products Pillar, AI Singapore

    • Context length: 256K tokens for 31B and 128K for E4B/E2B

    This model is optimized to function as a decision model that produces structured probabilistic judgments rather than generating free-form text. it was fine-tuned to answer three core questions: content_moderation, which assigns individual probability scores (0.0–1.0) to the categories safe, sensitive, and unsafe; rule_violation, which estimates the probability (0.0–1.0) that the input violates the specified rules; and rule_applicability, which estimates the probability (0.0–1.0) that the specified rules apply to the input. However, users must be aware that the model is subject to the limitations common to generative AI, including the potential to hallucinate and produces ungrounded probability. Due to these inherent risks, human oversight is advised, and the model’s outputs should not be treated as absolute determinations without secondary verification.

    Install decision interface server

    Deploy the model using any inference engine, e.g., vLLM.

    Create decision inference server

    Compatible with SystemOne API and OpenAI's Decisions API

    We use to evaluate our SEA-LION-Guard-v2.

    AUPRC is the primary metric to evaluate the safety classification of our models.

    Model
    General Safety (EN + SEA)
    SEA-Specific Safety (EN + SEA)
    EN
    TA
    TH
    FIL
    MS
    ID
    MY
    VI
    Multi-turn

    It is important for users to be aware that our model exhibits certain limitations that warrant consideration. Although optimized to estimate probability scores for content_moderation, rule_violation, and rule_applicability, the model can still hallucinate or occasionally produce ungrounded score distributions. Users should exercise caution in interpreting and validating the model's outputs—particularly near decision thresholds—due to potential biases and underlying generative inconsistencies.

    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.

    SEA-LION API

    The SEA-LION API provides a quick and simple interface to our various SEA-LION models for text generation, translation, summarization, and more.

    Usage of the SEA-LION API is subject to our Terms of Use and Privacy Policy

    Getting an API Key

    To get started with SEA-LION API, you'll need to first create an API key via our SEA-LION Playground:

    1. Sign in to SEA-LION Playground via your Google account

    2. Navigate to our API Key Manager page by clicking on

    • API Key on the side menu, or

    • Launch Key Manager on the home dashboard

    1. Click on the "Create New Trial API Key" button, and enter a name for your API key.

    An API key will be generated for you after you click "Create". Make sure to copy or download the generated key and keep it in a safe place since you won't be able to view it again.

    Only 1 API key is allowed to be created per user.

    To find the available SEA-LION models for your API key, use the following curl command.

    Replace YOUR_API_KEY with your generated API key.

    SEA-LION's API endpoints for chat are compatible with OpenAI's API and libraries.

    The SEA-LION v4.5 model supports function calling, enabling agentic workflows where the model autonomously decides which tools to call, processes results, and continues until the task is complete.

    Our v3.5 models offers dynamic reasoning capabilities, and defaults to reasoning with thinking_mode="on" passed to the chat template. To use non-thinking mode ie. standard generations, pass thinking_mode="off" to the chat template instead.

    Our safety model, aisingapore/SEA-Guard, can be used to evaluate potentially harmful content. It returns a binary classification of safe and unsafe, and supports 3 flexible input modes, depending on your use case.

    Mode 1: Prompt-only Classification

    Mode 2: Prompt + Response Classification

    Mode 3: Response-only Classification

    produces 1024-dimensional embeddings and supports 11 Southeast Asian languages with an 8k token context window.

    Embeddings can be used to measure semantic similarity between sentences using cosine similarity.

    Sentences with similar meaning (e.g. food-related) score higher (≈0.95) than unrelated ones (≈0.63–0.65).

    Limits help us mitigate misuse and manage API capacity and help ensure that everyone has fair access to the API.

    SEA-LION API usage frequency will be subject to rate limits applied on requests per minute (RPM).

    As of 04 Jun 2026, our rate limits is set to 10 requests per minute per user.

    If you have any questions or want to speak about getting a rate limit increase, reach out to sealion@aisingapore.org.

    Strands Agents SDK

    This guide demonstrates how to use SEA-LION models as intelligent agents using AWS's Strands Agent SDK. The examples show how to build both general-purpose agents with multiple tools and specialized single-purpose agents.

    Prerequisites

    • Python 3.10+

    • AWS Strands Agents SDK installed (Quickstart)

    • SEA-LION API or Bedrock access

    • Environment variables configured

    The sample code in this guide will be configuring the model via SEA-LION API, which follows . Strands Agent ADK is also compatible with other model providers. For configuring SEA-LION in Strands SDK via Bedrock, you may refer to . For setting up of SEA-LION in Bedrock, refer to .

    Create a .env file with your configuration:

    Here's how to create a basic SEA-LION agent with tool-calling capabilities:

    agent.py

    Refer to for more examples of in-built tools.

    You can create custom tools for your agents. Here's an example of custom web search tool using :

    tools.py

    Create a specialized agent that can be used as a tool by other agents:

    translate_agent.py

    Combine multiple tools for a comprehensive agent, making use of Strands tools, custom tools and agents as tools:

    agent_multi.py

    • Use aisingapore/Llama-SEA-LION-v3-70B-IT for complex reasoning and tool-calling

    • Use aisingapore/Gemma-SEA-LION-v3-9B-IT for specialized, single-purpose agents

    • Use clear, descriptive names for your agents

    • Provide specific instructions about tool usage guidelines

    • Include examples when tools have specific parameter formats

    • Clearly define the agent's role and capabilities

    • Agent conversation history can be accessed via the agent.messages property

    • To handle long-context conversations, SlidingWindowConversationManager can be configured

    • More information and examples on conversation/state/session management available

    Always provide clear docstrings for custom tools, including:

    • Purpose and functionality

    • Parameter descriptions with types

    • Return value format

    • Usage examples

    • Exception handling

    Common Issues:

    1. Tool not being called: Ensure your system prompt mentions the tool and its use cases

    2. API connection errors: Verify your API_KEY and API_BASE_URL in the .env file

    3. Timeout issues: Adjust the timeout parameters in your tools

    4. Memory usage: Use streaming responses for better performance with large outputs

    Performance Tips:

    • Use appropriate model sizes for your use case

    • Implement proper error handling and fallbacks

    • Monitor token usage to optimize costs

    Strands Agents SDK Specific

    • Configuring specialised agents as tools allows for them to do focused singular tasks. For using agents in a workflow or loop, consider other multi-agents systems in Strands SDK like or

    Getting the models

    SEA-LION models are available for download via the following channels:

    Gemma-SEA-LION-Guard-v2

    Model
    Download

    Google ADK

    This guide demonstrates how to use SEA-LION models as intelligent agents using Google's Agent Development Kit (ADK). The examples show how to build both general-purpose agents with multiple tools and specialized single-purpose agents.

    • Python 3.9+

    • Google ADK installed ()

    • or access

    512

    Micro Batch Size

    2

    1.160

    1

    1.16

    9.21

    Dolma Reddit - English

    1.339

    1

    1.339

    2.42

    Dolma Semantic Scholar

    0.959

    1

    0.959

    2.79

    Dolma arXiv

    0.469

    1

    0.469

    1.99

    Dolma StarCoder

    4.422

    1

    4.422

    0.98

    SEA-LION Pile - Indonesian

    3.4

    2

    6.8

    14.17

    Wiki* - Indonesian

    0.3

    4

    1.2

    2.50

    SEA-LION Pile - Tamil

    5.6

    1

    5.6

    11.67

    Wiki* + News - Tamil

    0.6

    4

    2.4

    5.00

    SEA-LION Pile - Thai

    2.28

    1

    2.28

    4.75

    WangChanBERTa - Thai

    5

    1

    5

    10.42

    Wiki* - Thai

    0.18

    4

    0.72

    1.50

    SEA-LION Pile - Vietnamese

    6.76

    1

    6.76

    14.08

    Wiki* - Vietnamese

    0.31

    4

    1.24

    2.58

    HuggingFace
    HuggingFace
    HuggingFace
    Ollama

    33.4 GB

    0.0350

    365.18 ± 31.50

    30B-A3B-NVFP4

    1x H200 GPU(s)

    20.5 GB

    0.0339

    340.29 ± 8.68

    120B-A12B(BF16)

    2x H200 GPU(s)

    242.5 GB

    0.0936

    150.31 ± 12.80

    120B-A12B-FP8

    2x H200 GPU(s)

    128.6 GB

    0.0449

    161.36 ± 3.05

    120B-A12B-NVFP4

    2x H200 GPU(s)

    80.4 GB

    0.0446

    156.36 ± 2.64

    Other
    nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16
    nvidia/Nemotron-SFT-OpenCode-v1
    nvidia/Nemotron-SFT-SWE-v2
    nvidia/Nemotron-SFT-Agentic-v2
    nvidia/Nemotron-SFT-Competitive-Programming-v2
    nvidia/Nemotron-SFT-Math-v3
    nvidia/OpenMathInstruct-2
    nvidia/OpenScienceReasoning-2
    KingNish/reasoning-base-20k
    ZombitX64/Medical-o1-Reasoning-SFT-Thai
    Nemotron-SEA-LION-v4.8-120B-A12B-FP8
    Nemotron-SEA-LION-v4.8-120B-A12B-GGUF

    Indonesia

  • Khmer

  • Lao

  • Malay

  • Tamil

  • Thai

  • Vietnamese

  • Micro Batch Size

    1

    37.5

    18.75

    25

    Fineweb-Edu

    7.5

    3.75

    Others

    5

    2.5

    Chinese

    SEA-LION Pile v1

    12

    6

    13

    Others

    14

    7

    Vietnamese

    SEA-LION Pile v1

    8.4

    4.2

    13

    VinBigData

    16

    8

    Others

    1.6

    0.8

    Indonesian

    SEA-LION Pile v1

    7

    3.5

    13

    SEA-LION Pile v2

    7

    3.5

    Others

    12

    6

    Thai

    SEA-LION Pile v1

    10.7

    5.35

    10

    WangChanBERTa

    8.5

    4.25

    Others

    0.8

    0.4

    Filipino - Malay - Tamil

    SEA-LION Pile v1

    4.28

    2.14

    3

    Others

    1.72

    0.86

    Khmer - Lao - Burmese

    SEA-LION Pile v1

    5.2

    2.6

    3

    Others

    0.8

    0.4

    Gemma-SEA-LION-v3-9B-IT-Q5_0

  • Gemma-SEA-LION-v3-9B-IT-Q5_K_M

  • Gemma-SEA-LION-v3-9B-IT-Q6_K

  • Gemma-SEA-LION-v3-9B-IT-Q8_0

  • SingTel HGX-100

    8 instances

    Nvidia H100 80GB GPU

    64

    Training Duration

    10 days

    Precision

    bfloat16

    Optimizer

    decoupled_adamw

    Scheduler

    weight_stable_decay

    Learning Rate

    1.0e-5

    Global Batch Size

    Code

    Stackv2

    40

    20

    20

    English

    Gemma-SEA-LION-v3-9B

    HuggingFace, Kaggle

    Gemma-SEA-LION-v3-9B-IT

    HuggingFace, Kaggle

    Gemma-SEA-LION-v3-9B-IT-GGUF

    HuggingFace, Ollama

    Gemma-SEA-LION-v3-9B

    Training Infrastructure

    Tokenizer

    Training Data

    Benchmark Performance

    General Language Capabilities

    Gemma-SEA-LION-v3-9B-IT

    Fine-Tuning Methodology

    Fine-Tuning Data

    Indonesian, Javanese & Sudanese Specific SEA-LION

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Gemma-SEA-LION-v3-9B-IT-GGUF

    Download the Model(s)

    Usage

    Disclaimer

    References

    Thai Pre-Training Data Reference

    Gemma Community License
    MosaicML Composer
    here
    Seithi
    SEA-HELM
    Gemma2 9B CPT SahabatAIv1 Base
    Gemma2 9B CPT SahabatAIv1 Instruct
    SEA-HELM
    IFEval
    MT-Bench
    Download the Model(s)
    HuggingFace SEA-LION v3 Collection

    512

    Dolma

    Indonesia

  • Javanese (Instruct/GGUF only)

  • Khmer

  • Lao

  • Malay

  • Sundanese (Instruct/GGUF only)

  • Tamil

  • Thai

  • Vietnamese

  • 37.5

    18.75

    25

    Fineweb-Edu

    7.5

    3.75

    Others

    5

    2.5

    Chinese

    SEA-LION Pile v1

    12

    6

    13

    Others

    14

    7

    Vietnamese

    SEA-LION Pile v1

    8.4

    4.2

    13

    VinBigData

    16

    8

    Others

    1.6

    0.8

    Indonesian

    SEA-LION Pile v1

    7

    3.5

    13

    SEA-LION Pile v2

    7

    3.5

    Others

    12

    6

    Thai

    SEA-LION Pile v1

    10.7

    5.35

    10

    WangChanBERTa

    8.5

    4.25

    Others

    0.8

    0.4

    Filipino - Malay - Tamil

    SEA-LION Pile v1, AI4Bharat Sangraha

    4.28

    2.14

    3

    Others

    1.72

    0.86

    Khmer - Lao - Burmese

    SEA-LION Pile v1

    5.2

    2.6

    3

    Others

    0.8

    0.4

    Tamil news is sourced with permission from Seithi

    Llama-SEA-LION-v3-8B-IT-Q5_0

  • Llama-SEA-LION-v3-8B-IT-Q5_K_M

  • Llama-SEA-LION-v3-8B-IT-Q6_K

  • Llama-SEA-LION-v3-8B-IT-Q8_0

  • AWS p5e.48xlarge

    8 instances

    Nvidia H200 140GB GPU

    64

    Training Duration

    136 Hours

    Precision

    bfloat16

    Optimizer

    decoupled_adamw

    Scheduler

    weight_stable_decay

    Learning Rate

    1.0e-5

    Global Batch Size

    512

    Code

    Stackv2

    40

    20

    20

    English

    Llama-SEA-LION-v3-8B

    HuggingFace, Kaggle

    Llama-SEA-LION-v3-8B-IT

    HuggingFace, Kaggle

    Llama-SEA-LION-v3-8B-IT-GGUF

    HuggingFace, Ollama

    Llama-SEA-LION-v3-8B

    Training Infrastructure

    Tokenizer

    Training Data

    Benchmark Performance

    General Language Capabilities and Constraint-following Behaviour

    Llama-SEA-LION-v3-8B-IT

    Fine-Tuning Methodology

    Fine-Tuning Data

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Llama-SEA-LION-v3-8B-IT-GGUF

    Download the Model(s)

    Usage

    Disclaimer

    References

    Thai Pre-Training Data Reference

    Llama3.1 Community License
    MosaicML Composer
    here
    here
    here
    SEA-HELM
    IFEval
    SEA-HELM
    IFEval
    MT-Bench
    Download the Model(s)
    HuggingFace SEA-LION v3 Collection

    Dolma

    Environment Setup

    Basic Agent Setup

    Custom Tool Development

    Agent as a Tool

    Multi-Tool Agent Example

    Best Practices

    Model Selection

    Agent Configuration

    Session Management

    Tool Documentation

    Troubleshooting

    an OpenAI-compatible format
    this page
    this link
    the documentation
    a locally-deployed SearXNG search engine
    here
    Workflow
    Graph

    How To Use Your API Key

    Step 1. Find the Available Models

    Step 2: Call the API

    Calling our Instruct models

    Agentic Tool Use

    Calling our Reasoning models

    If you are not observing any changes in response when toggling thinking_mode on/off, your API responses might have been cached.

    You can disable cache temporarily for your testing by setting the no-cache flag to true

    Calling our Guard model

    Note: The safety model does not support system prompts or multi-turn conversations.

    Calling our Embedding models

    Sentence Similarity

    Rate Limits

    SEA-LION-ModernBERT-Embedding-600M
    Environment variables configured

    The sample code in this guide will be configuring the model via SEA-LION API through LiteLLM, which follows an OpenAI-compatible format. Google ADK is also compatible with other model providers including Google's own Vertex AI. For configuring SEA-LION in Google ADK, you may refer to this page. Click here for instructions on deploying SEA-LION in Vertex AI.

    Create a .env file with your configuration:

    Here's how to create a basic SEA-LION agent with tool-calling capabilities:

    agent.py

    __init__.py

    You can create custom tools for your agents. Here's an example of custom web search tool using a locally-deployed SearXNG search engine:

    tools.py

    Create a specialized agent that can be used as a tool by other agents:

    translator.py

    Google ADK provides a built-in web interface. Simply run:

    This will start a web server accessible at http://localhost:8000 using your agent.py configuration.

    For command-line interaction, you can use the optional CLI script:

    chat-cli.py

    To run the CLI:

    • Use aisingapore/Llama-SEA-LION-v3-70B-IT for complex reasoning and tool-calling

    • Use aisingapore/Gemma-SEA-LION-v3-9B-IT for specialized, single-purpose agents

    • Use clear, descriptive names for your agents

    • Provide specific instructions about tool usage guidelines

    • Include examples when tools have specific parameter formats

    • Clearly define the agent's role and capabilities

    • Google ADK uses session-based interactions for maintaining context

    • Use InMemorySessionService for development and testing

    • Consider persistent session storage for production applications

    • More information and examples on session/memory management available here

    Always provide clear docstrings for custom tools, including:

    • Purpose and functionality

    • Parameter descriptions with types

    • Return value format

    • Usage examples

    • Exception handling

    Common Issues:

    1. Tool not being called: Ensure your instruction mentions the tool and its use cases

    2. LiteLLM connection errors: Verify your API keys and base URLs in the .env file

    3. Function declaration issues: Set GOOGLE_GENAI_USE_VERTEXAI=TRUE if not using Google AI Studio

    4. Session creation failures: Check your session service configuration and permissions

    5. Async/await issues: Ensure proper async handling in CLI implementations

    Performance Tips:

    • Use appropriate model sizes for your use case

    • Implement proper error handling and fallbacks

    • Monitor token usage to optimize costs

    Google ADK Specific:

    • Web interface (adk web) is the recommended way to interact with agents

    • CLI implementation requires proper session management

    • Agent composition using AgentTool allows for specialised agents to do focused singular tasks. For using agents in a workflow or loop, consider the difference between sub-agents and agent tools. If it suits your use-case, you can explore workflow agents and sub-agents

    Prerequisites

    Quickstart
    SEA-LION API
    Google Vertex AI

    Environment Setup

    Project Structure

    Basic Agent Setup

    Custom Tool Development

    Agent as a Tool

    Running the Agent

    Web Interface (Recommended)

    CLI Interface (Optional)

    Best Practices

    Model Selection

    Agent Configuration

    Session Management

    Tool Documentation

    Troubleshooting

    # Please use transformers==4.45.2
    
    import transformers
    import torch
    
    model_id = "aisingapore/Gemma-SEA-LION-v3-9B-IT"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    @misc{lowphansirikul2021wangchanberta,
        title={WangchanBERTa: Pretraining transformer-based Thai Language Models},
        author={Lalita Lowphansirikul and Charin Polpanumas and Nawat Jantrakulchai and Sarana Nutanong},
        year={2021},
        eprint={2101.09635},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
    }
    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3-8B-IT"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    @misc{lowphansirikul2021wangchanberta,
        title={WangchanBERTa: Pretraining transformer-based Thai Language Models},
        author={Lalita Lowphansirikul and Charin Polpanumas and Nawat Jantrakulchai and Sarana Nutanong},
        year={2021},
        eprint={2101.09635},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
    }
    API_KEY=your-api-key-here
    API_BASE_URL=https://api.sea-lion.ai/v1
    MODEL=aisingapore/Llama-SEA-LION-v3-70B-IT
    
    # Environment variable for custom tool
    SEARXNG_URL=https://your-searxng-instance-url-here
    import os
    from dotenv import load_dotenv
    from strands import Agent
    from strands.models.openai import OpenAIModel
    from strands_tools import calculator, current_time
    
    load_dotenv()
    
    # Configure the SEA-LION model
    model = OpenAIModel(
        client_args={
            "api_key": os.environ.get("API_KEY"),
            "base_url": os.environ.get("API_BASE_URL"),
        },
        model_id=os.environ.get("MODEL", "aisingapore/Llama-SEA-LION-v3-70B-IT"),
        params={
            "max_tokens": 1000,
            "stream": True,
        },
    )
    
    # Initialize the agent
    agent = Agent(
        model=model,
        system_prompt="You are a helpful assistant who answers questions in a concise and informative manner. You can use tools to assist with calculations and current time queries.",
        tools=[current_time, calculator]
    )
    
    # Use the agent
    demo_prompts = [
        "What is the current time in Singapore?",
        "What is sixty five + 34?"
    ]
    
    for prompt in demo_prompts:
        agent(prompt)
    import os
    import requests
    
    from dotenv import load_dotenv
    from strands import tool
    from typing import Optional, List, Dict, Any
    from urllib.parse import urljoin
    
    load_dotenv()
    
    @tool
    def searxng_search(
        query: str,
        categories: Optional[List[str]] = None,
        engines: Optional[List[str]] = None,
        language: Optional[str] = None,
        pageno: int = 1,
        time_range: Optional[str] = None,
        format: str = "json",
        safesearch: int = 1,
        timeout: int = 10
    ) -> Dict[str, Any]:
        """
        Send a search query to a SearXNG search engine.
        
        Args:
            query: The search query string
            categories: List of search categories (e.g., ["general", "images"])
            engines: List of specific engines to use (e.g., ["google", "bing"])
            language: Language code (e.g., "en", "de")
            pageno: Page number for pagination (default: 1)
            time_range: Time range filter ("day", "month", "year")
            format: Output format ("json", "csv", "rss")
            safesearch: Safe search level (0=off, 1=moderate, 2=strict)
            timeout: Request timeout in seconds
        
        Returns:
            Dictionary containing search results
        """
        
        search_url = urljoin(os.getenv("SEARXNG_URL", "http://localhost:8080"), '/search')
        
        params = {
            'q': query,
            'pageno': pageno,
            'format': format,
            'safesearch': safesearch
        }
        
        # Add optional parameters
        if categories:
            params['categories'] = ','.join(categories)
        if engines:
            params['engines'] = ','.join(engines)
        if language:
            params['language'] = language
        if time_range:
            params['time_range'] = time_range
        
        try:
            response = requests.get(search_url, params=params, timeout=timeout)
            response.raise_for_status()
            
            if format == 'json':
                return response.json()
            else:
                return {'raw_response': response.text, 'status_code': response.status_code}
                
        except requests.RequestException as e:
            raise requests.RequestException(f"SearXNG search failed: {str(e)}")
    import os
    import sys
    
    from dotenv import load_dotenv
    from strands import Agent, tool
    from strands.models.openai import OpenAIModel
    
    load_dotenv()
    
    # Use a smaller model for specialized tasks
    translation_model = OpenAIModel(
        client_args={
            "api_key": os.environ.get("API_KEY"),
            "base_url": os.environ.get("API_BASE_URL"),
        },
        model_id="aisingapore/Gemma-SEA-LION-v3-9B-IT",
        params={
            "max_tokens": 1000,
            "stream": True,
        },
    )
    
    @tool
    def translator(input_text: str, target_language: str) -> str:
        """
        Translates the input text to the target language.
        
        Args:
            input_text (str): The text to translate.
            target_language (str): The language to translate to (e.g. "English").
            
        Returns:
            str: The translated text.
        """
        TRANSLATOR_PROMPT = f"""
        You are a translation engine. Your sole purpose is to translate text.
    
        - If the input is not in {target_language}, translate it to {target_language}.
        - If language is not specified or unclear, default to English.
    
        You must only output the translated text. Do not include any additional explanations, notes, formatting, or any other text besides the translated content.
        """
        
        try:
            agent = Agent(
                model=translation_model,
                system_prompt=TRANSLATOR_PROMPT,
                tools=[]  # No tools needed for translation
            )
            response = agent(input_text)
            return response
        except Exception as e:
            return f"Translation failed: {str(e)}"
    
    # Usage example
    if __name__ == "__main__":
        try:
            print("🤖 Strands Translator Agent CLI")
            language = input("Enter the target language (e.g. English): ").strip()
    
            if not language:
                language = "English"
            print(f"Target language set to: {language}")
            print("Type your text below. Type 'quit', 'exit', or press Ctrl+C to exit.")
    
            # Initialize the agent
            
            while True:
                try:
                    
                    # Get user input
                    user_input = input("\nUser: ").strip()
                    
                    # Check for exit commands
                    if user_input.lower() in ['quit', 'exit', 'q']:
                        print("Goodbye! 👋")
                        break
                    
                    # Skip empty inputs
                    if not user_input:
                        continue
                    
                    # Get agent response
                    print("Translation: ", end="", flush=True)
                    translator(user_input,language)
                    
                except KeyboardInterrupt:
                    print("\n\nGoodbye! 👋")
                    break
                except EOFError:
                    print("\nGoodbye! 👋")
                    break
    
        except Exception as e:
            print(f"An error occurred initializing the agent: {e}")
            sys.exit(1)
    import os
    
    from dotenv import load_dotenv
    from strands import Agent
    from strands.models.openai import OpenAIModel
    from strands_tools import calculator, current_time
    
    # Import your custom tools from your tools.py script, or place in this script with @tools decorator
    from .tools import searxng_search
    
    # Import your specialised agent from your agent's script, or place in this script with @tools decorator
    from .translate_agent import translator
    
    load_dotenv()
    # Configure model
    model = OpenAIModel(
        client_args={
            "api_key": os.environ.get("API_KEY"),
            "base_url": os.environ.get("API_BASE_URL"),
        },
        model_id=os.environ.get("MODEL", "aisingapore/Llama-SEA-LION-v3-70B-IT"),
        params={
            "max_tokens": 1000,
            "stream": True,
        },
    )
    
    # Create comprehensive agent
    agent = Agent(
        model=model,
        system_prompt="""You are a helpful assistant who answers questions in a concise and informative manner. 
        You can use tools to assist with calculations, current time queries, web search, and translation. 
        For current_time, you can specify a timezone in the format 'Asia/Singapore'. 
        For searxng_search, make sure to provide the links to user as well. 
        If you need more information, ask the user for clarification.""",
        tools=[current_time, calculator, searxng_search, translator]
    )
    
    # Interactive CLI
    def main():
        print("🤖 SEA-LION Agent CLI")
        print("Type your questions below. Type 'quit' to exit.")
        
        while True:
            try:
                user_input = input("\nUser: ").strip()
                
                if user_input.lower() in ['quit', 'exit', 'q']:
                    print("Goodbye! 👋")
                    break
                
                if not user_input:
                    continue
                
                print("Agent: ", end="", flush=True)
                agent(user_input)
                
            except KeyboardInterrupt:
                print("\n\nGoodbye! 👋")
                break
    
    if __name__ == "__main__":
        main()
    curl 'https://api.sea-lion.ai/v1/models' \
      -H 'Authorization: Bearer YOUR_API_KEY'
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
        "model": "aisingapore/Qwen-SEA-LION-v4.5-27B-IT",
        "messages": [
          {
            "role": "user",
            "content": "Tell me a Singlish joke!"
          }
        ]
      }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/Qwen-SEA-LION-v4.5-27B-IT",
        messages=[
            {
                "role": "user",
                "content": "Tell me a Singlish joke!"
            }
        ]
    )
    
    print(completion.choices[0].message.content)
    from openai import OpenAI
    import json
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    tools = [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "description": "Get the current weather for a city",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {"type": "string", "description": "The city name"}
                    },
                    "required": ["city"]
                }
            }
        }
    ]
    
    def get_weather(city):
        # Replace with a real weather API call
        mock_data = {"Singapore": "32°C, humid", "Jakarta": "30°C, cloudy"}
        return mock_data.get(city, "Weather data unavailable")
    
    messages = [{"role": "user", "content": "What is the weather in Singapore and Jakarta?"}]
    
    # Agentic loop: runs until the model stops calling tools
    while True:
        response = client.chat.completions.create(
            model="aisingapore/Qwen-SEA-LION-v4.5-27B-IT",
            messages=messages,
            tools=tools,
            tool_choice="auto"
        )
        msg = response.choices[0].message
        messages.append(msg)
    
        if response.choices[0].finish_reason == "tool_calls":
            for tc in msg.tool_calls:
                args = json.loads(tc.function.arguments)
                result = get_weather(args["city"])
                messages.append({"role": "tool", "tool_call_id": tc.id, "content": result})
        else:
            print(msg.content)
            break
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
        "model": "aisingapore/Llama-SEA-LION-v3.5-70B-R",
        "messages": [
          {
            "role": "user",
            "content": "Tell me a Singlish joke!"
          }
        ],
        "chat_template_kwargs": {
    	    "thinking_mode": "off"
        }
      }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/Llama-SEA-LION-v3.5-70B-R",
        messages=[
            {
                "role": "user",
                "content": "Tell me a Singlish joke!"
            }
        ],
        extra_body={
            "chat_template_kwargs": {
                "thinking_mode": "off"
            }
        },
    )
    
    print(completion.choices[0].message.content)
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
      "messages": [
        {
          "role": "user",
          "content": {PROMPT}
        }
      ],
      "model": "aisingapore/SEA-Guard",
      "stream": false
    }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/SEA-Guard",
        messages=[
            {
                "role": "user",
                "content": {PROMPT}
            }
        ],
    )
    
    print(completion.choices[0].message.content)
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
      "messages": [
        {
          "role": "user",
          "content": "Human user:{PROMPT}\nAI assistant:{RESPONSE}."
        }
      ],
      "model": "aisingapore/SEA-Guard",
      "stream": false
    }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/SEA-Guard",
        messages=[
            {
                "role": "user",
                "content": "Human user:{PROMPT}\nAI assistant:{RESPONSE}."
            }
        ],
    )
    
    print(completion.choices[0].message.content)
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
      "messages": [
        {
          "role": "user",
          "content": "Human user:\nAI assistant:{RESPONSE}."
        }
      ],
      "model": "aisingapore/SEA-Guard",
      "stream": false
    }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/SEA-Guard",
        messages=[
            {
                "role": "user",
                "content": "Human user:\nAI assistant:{RESPONSE}."
            }
        ],
    )
    
    print(completion.choices[0].message.content)
    curl https://api.sea-lion.ai/v1/embeddings \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
        "model": "aisingapore/SEA-LION-ModernBERT-Embedding-600M",
        "input": [
          "Singapore is a tropical island city-state.",
          "The Lion City sits at the tip of the Malay Peninsula."
        ]
      }'
    from openai import OpenAI
    
    client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.sea-lion.ai/v1/embeddings")
    
    result = client.embeddings.create(
        model="aisingapore/SEA-LION-ModernBERT-Embedding-600M",
        input=[
            "Singapore is a tropical island city-state.",
            "The Lion City sits at the tip of the Malay Peninsula.",
        ],
    )
    
    for item in result.data:
        print(f"index {item.index}: dim={len(item.embedding)}")
    import math
    import requests
    
    def get_embeddings(texts, api_key):
        response = requests.post(
            "https://api.sea-lion.ai/v1/embeddings",
            headers={
                "Authorization": f"Bearer {api_key}",
                "Content-Type": "application/json"
            },
            json={"model": "aisingapore/SEA-LION-ModernBERT-Embedding-600M", "input": texts}
        )
        response.raise_for_status()
        return [item["embedding"] for item in response.json()["data"]]
    
    def cosine_similarity(a, b):
        dot = sum(x * y for x, y in zip(a, b))
        norm_a = math.sqrt(sum(x ** 2 for x in a))
        norm_b = math.sqrt(sum(x ** 2 for x in b))
        return dot / (norm_a * norm_b)
    
    api_key = YOUR_API_KEY
    
    sentences = [
        "The food in Singapore is delicious.",
        "Singapore has amazing cuisine.",
        "The weather today is very hot.",
    ]
    
    embeddings = get_embeddings(sentences, api_key)
    
    for i in range(len(sentences)):
        for j in range(i + 1, len(sentences)):
            sim = cosine_similarity(embeddings[i], embeddings[j])
            print(f"[{i}] vs [{j}] similarity: {sim:.4f}")
            print(f"  '{sentences[i]}'")
            print(f"  '{sentences[j]}'")
    curl https://api.sea-lion.ai/v1/chat/completions \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
        "model": "aisingapore/Llama-SEA-LION-v3.5-70B-R",
        "messages": [
          {
            "role": "user",
            "content": "Tell me a Singlish joke!"
          }
        ],
        "chat_template_kwargs": {
    	    "thinking_mode": "off"
        },
        "cache": {
          "no-cache": true
        }
      }'
    from openai import OpenAI
    
    client = OpenAI(
        api_key=YOUR_API_KEY,
        base_url="https://api.sea-lion.ai/v1"
    )
    
    completion = client.chat.completions.create(
        model="aisingapore/Llama-SEA-LION-v3.5-70B-R",
        messages=[
            {
                "role": "user",
                "content": "Tell me a Singlish joke!"
            }
        ],
        extra_body={
            "chat_template_kwargs": {
                "thinking_mode": "off"
            },
            "cache": {
                "no-cache": True
            }
        },
    )
    
    print(completion.choices[0].message.content)
    ## For using SEA-LION API, uncomment if needed
    OPENAI_API_KEY=your-sea-lion-api-key-here
    OPENAI_API_BASE=https://api.sea-lion.ai/v1
    MODEL=aisingapore/Llama-SEA-LION-v3-70B-IT
    
    ## For using Google Vertex AI, uncomment if needed
    # GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
    # GOOGLE_CLOUD_LOCATION="YOUR_VERTEX_AI_LOCATION" # e.g., us-central1
    GOOGLE_GENAI_USE_VERTEXAI=TRUE # Set to TRUE if NOT using Google AI Studio, due to function declaration issue: https://github.com/google/adk-python/issues/26#issuecomment-2911749485
    
    # Environment variable for custom tool
    SEARXNG_URL=https://your-searxng-instance-url-here
    parent_folder/
        adk_agent/
            __init__.py
            agent.py
            .env
            tools.py
            translator.py
            chat-cli.py
    import os
    import sys
    
    from dotenv import load_dotenv
    from google.adk.agents import Agent
    from google.adk.models.lite_llm import LiteLlm
    from google.adk.tools.agent_tool import AgentTool
    
    # Import your custom tools from your tools.py script, or place in this script
    from .tools import searxng_search
    
    # Import your specialised agent from your agent's script, or place in this script
    from .translator import root_agent as translator
    
    load_dotenv()
    
    try:
       root_agent = Agent(
          name="root_agent",
          model=LiteLlm(
             model=f"openai/{os.getenv('MODEL', 'aisingapore/Llama-SEA-LION-v3-70B-IT')}"
          ),
          description="Agent to answer questions using search and translation tools.",
          instruction="You are a helpful assistant who answers questions in a concise and informative manner. " \
          "You can use tools to assist with searches (`searxng_search`) and translations (`translator`). "\
          "If using `searxng_search`, make sure to provide the links you use at the end of your response, if not already provided",
          tools=[searxng_search, AgentTool(agent=translator)],
       )
    except Exception as e:
       print(f"An error occurred while creating the root agent: {e}")
       sys.exit(1)
    from . import agent
    import requests
    from dotenv import load_dotenv
    import os
    from typing import Optional, List, Dict, Any
    from urllib.parse import urljoin
    
    load_dotenv()
    SEARXNG_URL = os.getenv("SEARXNG_URL", "http://localhost:8080")
    
    def searxng_search(
        query: str,
        categories: Optional[List[str]] = None,
        engines: Optional[List[str]] = None,
        language: Optional[str] = None,
        pageno: int = 1,
        time_range: Optional[str] = None,
        format: str = "json",
        safesearch: int = 1,
        timeout: int = 10
    ) -> Dict[str, Any]:
        """
        Send a search query to a SearXNG search engine.
        Quick local set up for SearXNG via Docker can be found at
        https://docs.searxng.org/admin/installation-docker.html
        
        Args:
            query: The search query string
            categories: List of search categories (e.g., ["general", "images"])
            engines: List of specific engines to use (e.g., ["google", "bing"])
            language: Language code (e.g., "en", "de")
            pageno: Page number for pagination (default: 1)
            time_range: Time range filter ("day", "month", "year")
            format: Output format ("json", "csv", "rss")
            safesearch: Safe search level (0=off, 1=moderate, 2=strict)
            timeout: Request timeout in seconds
        
        Returns:
            Dictionary containing search results
        
        Raises:
            requests.RequestException: If the request fails
            ValueError: If the response is not valid JSON (when format="json")
        """
        
        # Prepare the search endpoint URL
        search_url = urljoin(SEARXNG_URL, '/search')
        
        # Build parameters
        params = {
            'q': query,
            'pageno': pageno,
            'format': format,
            'safesearch': safesearch
        }
        
        # Add optional parameters
        if categories:
            params['categories'] = ','.join(categories)
        
        if engines:
            params['engines'] = ','.join(engines)
        
        if language:
            params['language'] = language
        
        if time_range:
            params['time_range'] = time_range
        
        # Make the request
        try:
            response = requests.get(search_url, params=params, timeout=timeout)
            response.raise_for_status()
            
            if format == 'json':
                return response.json()
            else:
                return {'raw_response': response.text, 'status_code': response.status_code}
                
        except requests.RequestException as e:
            raise requests.RequestException(f"SearXNG search failed: {str(e)}")
        except ValueError as e:
            if format == 'json':
                raise ValueError(f"Invalid JSON response from SearXNG: {str(e)}")
            raise
    import os
    
    from dotenv import load_dotenv
    from google.adk.agents import LlmAgent
    from google.adk.models.lite_llm import LiteLlm
    
    load_dotenv()
    
    TRANSLATOR_PROMPT = """
    You are a translation engine. Your sole purpose is to translate text. You do not have any tools or additional capabilities.
    
    - Translate the input text provided to the target language instructed to you.
    - If the target language is not specified or unclear, default to English.
    
    You must only output the translated text. Do not include any additional explanations, notes, formatting, or any other text besides the translated content.
    """
    
    root_agent = LlmAgent(
       name="translator_agent",
       model=LiteLlm(
            model=f"openai/{os.getenv('MODEL', 'aisingapore/Gemma-SEA-LION-v3-9B-IT')}"
        ),
       description="Agent that translates text to a specified language.",
       instruction=TRANSLATOR_PROMPT,
       tools=[]
    )
    adk web
    import asyncio
    import datetime
    import getpass
    import os
    import sys
    
    from dotenv import load_dotenv
    from google.adk.agents import Agent
    from google.adk.models.lite_llm import LiteLlm
    from google.adk.sessions import InMemorySessionService
    from google.adk.tools.agent_tool import AgentTool
    from google.adk.runners import Runner
    from google.genai.types import Content, Part
    
    # Import your custom tools from your tools.py script, or place in this script
    from .tools import searxng_search
    
    # Import your specialised agent from your agent's script, or place in this script
    from .translator import root_agent as translator
    
    load_dotenv()
    
    # Set up session service and identifiers
    session_service = InMemorySessionService()
    APP_NAME = "google-adk-agent"
    SESSION_ID = f"session-{datetime.datetime.now().strftime('%Y%m%d%H%M%S')}"
    USER_ID = f"user-{getpass.getuser()}"
    
    async def setup_session():
       try:
          session = await session_service.create_session(
             app_name=APP_NAME,
             user_id=USER_ID,
             session_id=SESSION_ID,
             state={}
          )
          print(f"Session created with ID: {SESSION_ID} for user: {USER_ID}")
          return session
       except Exception as e:
          print(f"An error occurred while creating the session: {e}")
          sys.exit(1)
    
    try:
       root_agent = Agent(
          name="root_agent",
          model=LiteLlm(
             model=f"openai/{os.getenv('MODEL', 'aisingapore/Llama-SEA-LION-v3-70B-IT')}"
          ),
          description="Agent to answer questions using search and translation tools.",
          instruction="You are a helpful assistant who answers questions in a concise and informative manner. " \
          "If you deem necessary, use tools to assist with searches (`searxng_search`) and translations (`translator`). " \
          "If using `searxng_search`, make sure to provide the links at the end of your response, if not already provided",
          tools=[searxng_search, AgentTool(agent=translator)],
       )
    except Exception as e:
       print(f"An error occurred while creating the root agent: {e}")
       sys.exit(1)
    
    async def main():
       try:
          await setup_session()
          print("🤖 Google ADK Agent CLI")
          print("Type your questions below. Type 'quit', 'exit', or press Ctrl+C to exit.")
    
          # Initialize the agent runner
          runner = Runner(
             app_name=APP_NAME,
             agent=root_agent,
             session_service=session_service,
             )
    
          while True:
             try:
                # Get user input
                user_input = input("\nUser: ").strip()
    
                # Check for exit commands
                if user_input.lower() in ['quit', 'exit', 'q']:
                   print("Goodbye! 👋")
                   break
    
                # Run the agent with the user input
                user_message = Content(role='user', parts=[Part(text=user_input)])
    
                agent_response_text = ""
                print("Bot: ", end="", flush=True)
    
                async for event in runner.run_async(
                      user_id=USER_ID,
                      session_id=SESSION_ID,
                      new_message=user_message
                ):
                      if event.content and event.content.parts:
                         text_chunk = event.content.parts[0].text
                         if text_chunk:
                            print(text_chunk, end="", flush=True)
                            if event.is_final_response():
                                  agent_response_text += text_chunk
    
                      if event.is_final_response():
                         if not agent_response_text and event.content and event.content.parts and event.content.parts[0].text:
                            agent_response_text = event.content.parts[0].text
                         print()
                         break
    
                if not agent_response_text:
                      if event and event.error_message:
                         print(f"\nError: {event.error_message}")
                      else:
                         print("\n(No text response from bot)")
    
             except KeyboardInterrupt:
                print("\nExiting... Goodbye! 👋")
                break
    
       except Exception as e:
          print(f"An error occurred: {e}")
       finally:
          print("\nExiting the agent CLI. Goodbye! 👋")
    
    if __name__ == "__main__":
       asyncio.run(main())
    python -m adk_agent.chat-cli

    Language(s): Burmese, English, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese

  • License: MIT

  • Base model: Gemma-4-31B-IT and Gemma-4-E4B/E2B

  • BYOP
    Tool Eval

    ShieldGemma-9B

    80.3

    68.5

    82.1

    80.2

    82.4

    81.3

    81.3

    81.9

    72.9

    81.3

    ⛔

    ⛔

    ⛔

    LlamaGuard-3-8B

    90.8

    71.0

    93.0

    89.0

    90.2

    pip install decision-ui
    vllm serve aisingapore/Gemma-SEA-LION-Guard-v2-31B \
    --host localhost \
    --port 8000
    decision-ui serve http://localhost:8000/v1 \
    --port 9000
    from typesafe_sdk import Choice, Noul, TypeSafeClient
    with TypeSafeClient(base_url="http://localhost:9000/v1", api_key="EMPTY") as client:
        decision = client.system_one(
            model="aisingapore/Gemma-SEA-LION-Guard-v2-31B",
            state={"conversation":
                [
                    {"role": "user", "content": "..."},
                    {"role": "assistant", "content": "..."},
                ]
            },
            questions={
                "content_moderation": Choice(
                    instructions="Is the latest conversation turn safe, sensitive, or unsafe?",
                    criteria={"safe": None, "sensitive": None, "unsafe": None},
                ),
                "rule_applicability": Noul(
                    instructions=(
                      "Is the latest conversation turn applicable to the following rule?\n"
                      "- <your_rule>"
                    ),
                ),
                "rule_violation": Noul(
                    instructions=(
                      "Does the latest conversation turn violate the following rule?\n"
                      "- <your_rule>"
                    ),
                ),
            },
       )
    print(decision.choices["content_moderation"].probabilities)
    print(decision.nouls["rule_applicability"].noul)
    print(decision.nouls["rule_violation"].noul)
    from openai import OpenAI
    client = OpenAI(base_url="http://localhost:9000/v1", api_key="EMPTY")
    decision = client.decisions.create(
        model="aisingapore/Gemma-SEA-LION-Guard-v2-31B",
        input=[
            {"role": "user", "content": "..."},
            {"role": "assistant", "content": "..."},
        ],
        questions=[
            {
                "type": "choice",
                "name": "content_moderation",
                "instructions": "Is the latest conversation turn safe, sensitive, or unsafe?",
                "choices": [
                    {"value": "safe"},
                    {"value": "sensitive"},
                    {"value": "unsafe"},
                ],
            },
            {
                "type": "predicate",
                "name": "rule_applicability",
                "instructions": (
                    "Is the latest conversation turn applicable to the following rule?\n"
                    "- <your_rule>"
                ),
            },
            {
                "type": "predicate",
                "name": "rule_violation",
                "instructions": (
                    "Does the latest conversation turn violate the following rule?\n"
                    "- <your_rule>"
                ),
            },
        ],
    )
    answers = {a.name: a for a in decision.answers}
    print({p.value: p.probability for p in answers["content_moderation"].probabilities})
    print(answers["rule_applicability"].probability)
    print(answers["rule_violation"].probability)

    Intended Uses and Limitations

    Uses

    How to Get Started with the Model

    Evaluation

    Testing Data, Factors & Metrics

    Metrics

    Comparison Table

    Uses

    Bias, Risks, and Limitations

    Out-of-Scope Use

    Gemma-4-31B-IT
    Gemma-4-E4B/E2B
    SEA-SafeguardBench
    Universal Safety vs SEA-Specific Safety performance
    Universal Safety vs SEA-Specific Safety performance
    Comparative AUPRC performance across 8 SEA languages and safety categories
    Comparative AUPRC performance across 8 SEA languages and safety categories

    Full HuggingFace SEA-LION v4.8 Collection

    Nemotron-SEA-LION-v4.8

    Model
    Download

    Nemotron-SEA-LION-v4.8-30B-A3B-Base

    ,

    Nemotron-SEA-LION-v4.8-30B-A3B

    ,

    Nemotron-SEA-LION-v4.8-30B-A3B-GGUF

    ,

    Nemotron-SEA-LION-v4.8-30B-A3B-NVFP4

    Nemotron-SEA-LION-v4.8-30B-A3B-FP8

    Full HuggingFace SEA-LION v4.5 Collection

    Gemma-SEA-LION-v4.5-E2B-IT

    Model
    Download

    Gemma-SEA-LION-v4.5-E2B-IT

    ,

    Gemma-SEA-LION-v4.5-E2B-IT-GGUF

    ,

    Qwen-SEA-LION-v4.5-27B-IT

    Model
    Download

    Qwen-SEA-LION-v4.5-27B-IT

    ,

    Qwen-SEA-LION-v4.5-27B-IT-SpecDecoder

    Qwen-SEA-LION-v4.5-27B-IT-GGUF

    ,

    Full HuggingFace SEA-LION-Embedding Collection

    Model
    Download

    SEA-LION-ModernBERT-300M-checkpoints

    SEA-LION-ModernBERT-600M-checkpoints

    SEA-LION-ModernBERT-300M

    SEA-LION-ModernBERT-600M

    SEA-LION-ModernBERT-Embedding-300M

    Full HuggingFace SEA-LION v4 Collection

    Apertus-SEA-LION-v4-8B

    Model
    Download

    Apertus-SEA-LION-v4-8B-IT

    Gemma-SEA-LION-v4-VL

    Model
    Download

    Gemma-SEA-LION-v4-4B-VL

    Gemma-SEA-LION-v4-27B-VL

    Gemma-SEA-LION-v4-27B

    Model
    Download

    Gemma-SEA-LION-v4-27B

    Gemma-SEA-LION-v4-27B-IT

    Gemma-SEA-LION-v4-27B-IT-GGUF

    ,

    Gemma-SEA-LION-v4-27B-IT-NVFP4

    Gemma-SEA-LION-v4-27B-IT-FP8-Dynamic

    Qwen-SEA-LION-v4-VL

    Model
    Download

    Qwen-SEA-LION-v4-4B-VL

    Qwen-SEA-LION-v4-8B-VL

    Qwen-SEA-LION-v4-32B-IT

    Model
    Download

    Qwen-SEA-LION-v4-32B-IT

    Qwen-SEA-LION-v4-32B-IT-4BIT

    Qwen-SEA-LION-v4-32B-IT-8BIT

    Full HuggingFace SEA-LION v3.5 Collection

    Llama-SEA-LION-v3.5-8B

    Model
    Download

    Llama-SEA-LION-v3.5-8B-R

    Llama-SEA-LION-v3.5-8B-R-GGUF

    ,

    Llama-SEA-LION-v3.5-70B

    Model
    Download

    Llama-SEA-LION-v3.5-70B-R

    Llama-SEA-LION-v3.5-70B-R-GGUF

    ,

    Full HuggingFace SEA-LION v3 Collection

    Gemma-SEA-LION-v3-9B

    Model
    Download

    Gemma-SEA-LION-v3-9B

    Gemma-SEA-LION-v3-9B-IT

    Gemma-SEA-LION-v3-9B-IT-GGUF

    ,

    Llama-SEA-LION-v3-8B

    Model
    Download

    Llama-SEA-LION-v3-8B

    ,

    Llama-SEA-LION-v3-8B-IT

    Llama-SEA-LION-v3-8B-IT-GGUF

    ,

    Llama-SEA-LION-v3-70B

    Model
    Download

    Llama-SEA-LION-v3-70B

    Llama-SEA-LION-v3-70B-IT

    Llama-SEA-LION-v3-70B-IT-GGUF

    ,

    Full HuggingFace SEA-LION v2 Collection

    Model
    Download

    Llama-SEA-LION-v2-8B

    Llama-SEA-LION-v2-8B-IT

    Llama-SEA-LION-v2-8B-IT-GGUF

    ,

    Full HuggingFace SEA-LION v1 Collection

    Model
    Download

    SEA-LION-v1-3B

    SEA-LION-v1-7B

    SEA-LION-v1-7B-IT

    SEA-LION-v1-7B-IT-GGUF

    Full HuggingFace SEA-LION-GUARD v1 Collection

    Model
    Download

    Qwen-SEA-Guard-4B

    Qwen-SEA-Guard-8B

    Llama-SEA-Guard-8B

    Gemma-SEA-Guard-12B

    Gemma-SEA-LION-Guard-v2-31B

    HuggingFace

    Gemma-SEA-LION-Guard-v2-E4B

    HuggingFace

    Gemma-SEA-LION-Guard-v2-E2B

    SEA-LION-GUARD v2 (Latest)

    Full HuggingFace SEA-LION-GUARD v2 Collection

    SEA-LION v4.8

    SEA-LION v4.5

    SEA-LION Embedding

    SEA-LION v4

    SEA-LION v3.5

    SEA-LION v3

    SEA-LION v2

    SEA-LION v1

    SEA-GUARD (renamed as SEA-LION-GUARD v1)

    Gemma-SEA-LION-v4-27B

    Last updated: 2025-08-25

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    Introduction

    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 that has undergone continued pre-training on approximately 500B tokens, sampled from a pool of 1 trillion tokens across 11 SEA languages: Burmese, English, Indonesia, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese, to create Gemma-SEA-LION-v4-27B. Subsequently, we performed post-training on Gemma-SEA-LION-v4-27B using multiple RL algorithms to produce Gemma-SEA-LION-v4-27B-IT.

    Gemma-SEA-LION-v4-27B inherits Gemma 3’s:

    • Large 128K context length

    • Image and text understanding capabilities, including document comprehension, visual Q&A, and image-grounded reasoning

    • Advanced function calling and structured outputs to allow for seamless integration into larger systems

    For tokenization, the model employs the default tokenizer used in Gemma 3 27B IT.

    At a glance:

    • Developed by: Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: Products Pillar, AI Singapore

    • Model type: Decoder

    As of 25 Aug 2025, Gemma-SEA-LION-v4-27B-IT excels at Southeast Asian (SEA) tasks when compared to other open models with fewer than 200 billion parameters and demonstrates performance comparable to that of larger and top closed models. For detailed rankings, please refer to the .

    The dataset comprises Burmese, English, Indonesia, Khmer, Lao, Malay, Mandarin, 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.

    The 500 billion tokens are sampled from a much larger pool of 1 trillion tokens from open-sourced datasets with the optimal datamix shown below determined by our experiments.

    Language
    Dataset Name
    Total Tokens (B)
    Percentage (%)
    Total percentage (%)

    Note:

    • All token counts are counted using Gemma 3 tokenizer.

    • Pre-training was conducted with batches of 8k token lengths.

    • SEA-Pile v1 is processed from Common Crawl WET, which is published . The main proportion is from mC4 dataset (corpus ). The cutoff date of this version is September 2020.

    • SEA-Pile v2 is processed from Common Crawl WARC from October 2020 to April 2024.

    Training regime:

    Hyperparameter
    Gemma-SEA-LION-v4-27B

    Gemma-SEA-LION-v4-27B has undergone post-training using a QA pairs dataset in Burmese, English, Indonesia, Khmer, Lao, Malay, Tagalog, Tamil, Thai and Vietnamese, comprising approximately 10M samples in total, to create Gemma-SEA-LION-v4-27B-IT.

    The instruction fine-tuning dataset combines our SEA-Instruct, Infinity-Instruct, and OpenMath-Instruct 2 with open-source datasets. For the Online RL datasets, open sourced datasets such as nvidia/Llama-Nemotron-Post-Training-Dataset (RL set) and zwhe99/DeepMath-103K were used. For alignment, rejected-chosen pairs are generated from the target model, with the chosen responses obtained by rewriting and improving upon the rejected outputs. 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 then followed by on-policy alignment via APO.

    We evaluated Gemma-SEA-LION-v4-27B models on both general language capabilities and instruction-following capabilites.

    We evaluated Gemma-SEA-LION-v4-27B models on both general language capabilities and instruction-following capabilites.

    General language capabilities

    For the evaluation of general language capabilities, we employed the 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 ) and SEA-MTBench (based on ) 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.

    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).

    The following metrics were used:

    Task
    Metric

    For details on Gemma-SEA-LION-v4-27B model performances, please refer to the SEA-HELM leaderboard, .

    The following quantized versions of our Gemma-SEA-LION-v4-27B-IT model are available:

    • Gemma-SEA-LION-v4-27B-IT-Q4_K_M

    • Gemma-SEA-LION-v4-27B-IT-Q8_0

    • Gemma-SEA-LION-v4-27B-IT-BF16

    • Gemma-SEA-LION-v4-27B-IT-NVFP4

    • Gemma-SEA-LION-v4-27B-IT-FP8-Dynamic

    Please refer to our section for more details on how to access them.

    Gemma-SEA-LION-v4-27B models are available for download via the following channels: 🤗

    Model
    Download

    Use the code below to get started with the model using the 🤗 Transformers library.

    The models have 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.

    The models were not tested for robustness against adversarial prompting. It is important for users to be aware that our models exhibit certain limitations that warrant consideration. Like many LLMs, the models 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 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.

    This is the repository for the commercial instruction-tuned model. The models have 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.

    For more info, please contact us at or sealion@aisingapore.org

    Llama-SEA-LION-v3-70B

    Introduction

    Our Llama-SEA-LION-v3-70B models have been continued pre-trained on top of Llama 3.1 70B Instruct that is 70 billion parameters in size. Similar to our Llama-SEA-LION-v3-8B model, our Llama-SEA-LION-v3-70B also has a context length of 128K tokens, making them our SEA-LION models with the longest context length to date.

    Llama-SEA-LION-v3-70B was trained on data comprised of approximately 200B tokens across 11 SEA languages: Burmese, Chinese, English, Filipino, Indonesia, Khmer, Lao, Malay, Tamil, Thai and Vietnamese.

    Llama-SEA-LION-v3-70B-IT was fine-tuned in two stages on approximately 12.3M English instruction-completion pairs alongside a pool of 4.5M Southeast Asian instruction-completion pairs from SEA languages such as Indonesian, Javanese, Sundanese, Tamil, Thai and Vietnamese.

    At a glance:

    • Model type: Decoder

    • Tokenizer: Default tokenizer used in Llama 3.1 70B Instruct

    • Available Formats:

      • Base (Llama-SEA-LION-v3-70B)

      • Instruct (Llama-SEA-LION-v3-70B-IT)

      • GGUF (Llama-SEA-LION-v3-70B-IT-GGUF)

    • Languages supported:

      1. Burmese

      2. Chinese

      3. English

      4. Filipino

    • License:

    Llama-SEA-LION-v3-70B was trained in two stages using on the following hardware:

    Stage
    Training Details
    Llama-SEA-LION-v3-70B
    HyperParameter
    Llama-SEA-LION-v3-70B

    For tokenisation, the model employs the default tokenizer used in Llama 3.1 70B Instruct.

    Llama-SEA-LION-v3-70B base model was continued pre-trained on 200B tokens of the following data:

    Language
    Source
    Total Tokens (B)
    Percentage (%)
    Total percentage (%)

    Note:

    • All token counts are counted using Llama 3.1 70B Instruct tokenizer

    • SEA-LION Pile v1 is processed from Common Crawl WET, which is published . The cutoff date of this version is September 2020.

    • SEA-LION Pile v2 is processed from Common Crawl WARC from October 2020 to April 2024.

    • Tamil data from Sangraha is published . The paper can be found .

    We evaluated Llama-SEA-LION-v3-70B base model on general language capabilities and constraint-following behaviour.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done five-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Following the implementation of IFEval in OpenLLM leaderboard, we also implement SEA-IFEval to provide a comparison of the ability of the model to follow specific constraints in English and in SEA languages.

    SEA-IFEval

    Based on , 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.

    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).

    For more details on Llama-SEA-LION-v3-70B base benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    Llama-SEA-LION-v3-70B-IT is a multilingual instruction-following model that has been tuned using a combination of a full parameter fine-tune, on-policy alignment, and model merges of the best performing checkpoints. The training process for fine-tuning was approximately 3200 GPU hours, on a single node of 8x H100-80GB GPUs.

    Llama-SEA-LION-v3-70B-IT was trained on a wide range of synthetic instructions, alongside publicly available instructions hand-curated by the team with the assistance of native speakers. In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data sources.

    We evaluated Llama-SEA-LION-v3-70B-IT on both general language capabilities and instruction-following capabilities.

    For the evaluation of general language capabilities, we employed the (also known as BHASA) evaluation benchmark 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) and Natural Language Inference (NLI).

    Note: SEA-HELM is implemented using prompts to elicit answers in a strict format. For all tasks, the model is expected to provide an answer tag from which the answer is automatically extracted. For tasks where options are provided, the answer should comprise one of the pre-defined options. The scores for each task is normalised to account for baseline performance due to random chance.

    The evaluation was done zero-shot with native prompts on a sample of 100-1000 instances for each dataset.

    Since Llama-SEA-LION-v3-70B-IT is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, SEA-IFEval (based on ) and SEA-MTBench (based on ).

    As these 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.

    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-1106-preview as the judge model and compare against gpt-3.5-turbo-0125 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). A tie is given a score of 0.5.

    For more details on Llama-SEA-LION-v3-70B-IT benchmark performance, please refer to the SEA-HELM leaderboard, https://leaderboard.sea-lion.ai/.

    The following quantized GGUF formats of our Llama-SEA-LION-v3-70B-IT model are available:

    • Llama-SEA-LION-v3-70B-IT-F16

    • Llama-SEA-LION-v3-70B-IT-Q2_K

    • Llama-SEA-LION-v3-70B-IT-Q3_K_M

    • Llama-SEA-LION-v3-70B-IT-Q4_0

    • Llama-SEA-LION-v3-70B-IT-Q4_K_M

    Please refer to our section for more details on how to access them.

    Llama-SEA-LION-v3-70B models are available for download via the following channels:

    Model
    Download

    Llama-SEA-LION-v3-70B-IT can be run using the 🤗 Transformers library

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    88.0

    90.1

    90.8

    81.5

    90.8

    ✅

    ⛔

    ✅

    PolyGuard-Ministral-8B

    80.3

    67.7

    90.3

    84.7

    89.0

    79.4

    84.7

    86.9

    82.9

    86.9

    ⛔

    ⛔

    ⛔

    Qwen3Guard-Gen-8B

    91.9

    74.0

    93.4

    90.0

    91.5

    90.4

    90.5

    91.7

    88.8

    92.1

    ✅

    ⛔

    ⛔

    SEA-Guard-4B

    90.9

    76.8

    91.9

    87.1

    91.6

    91.1

    91.0

    91.9

    86.7

    91.4

    ⛔

    ⛔

    ⛔

    SEA-Guard-8B

    92.1

    77.3

    93.2

    88.6

    92.1

    91.7

    92.5

    92.5

    88.9

    92.3

    ⛔

    ⛔

    ⛔

    SEA-Guard-12B

    92.4

    78.1

    93.4

    89.7

    92.2

    92.7

    92.3

    92.5

    90.7

    92.1

    ⛔

    ⛔

    ⛔

    SEA-LION-Guard-v2-E2B

    93.3

    77.4

    94.2

    92.2

    92.6

    91.7

    93.0

    92.7

    91.6

    92.4

    ✅

    ✅

    ✅

    SEA-LION-Guard-v2-E4B

    93.5

    77.9

    94.1

    92.5

    93.3

    93.1

    93.2

    93.2

    91.6

    92.8

    ✅

    ✅

    ✅

    SEA-LION-Guard-v2-31B

    93.5

    78.7

    94.3

    93.1

    93.7

    93.0

    92.2

    93.0

    91.7

    93.1

    ✅

    ✅

    ✅

    Context length: 128k
  • Language(s): Burmese, English, Indonesia, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese

  • License:

  • Continued pretrained and finetuned from model:

  • Tamil news is sourced with permission from

  • We utilized 0.5% of synthetically generated datasets for the low-resource language, Khmer.

  • Code

    StarCoder (OLMo 2 Version)

    50B

    10

    10

    Precision

    bfloat16

    Optimizer

    decoupled_adamw

    Scheduler

    CosineAnnealing

    Learning Rate

    4.00E-08

    Global Batch Size

    1024

    Sentiment Analysis

    Accuracy

    Extractive QA (ID, VI, TH, TA)

    ChrF++

    MCQ-QA (TL, MY, MS)

    Accuracy

    Metaphor

    Accuracy

    Abstractive Summarisation

    Gemma-SEA-LION-v4-27B

    Gemma-SEA-LION-v4-27B-IT

    Gemma-SEA-LION-v4-27B-IT-GGUF

    ,

    Gemma-SEA-LION-v4-27B-IT-NVFP4

    Gemma-SEA-LION-v4-27B-IT-FP8-Dynamic

    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

    Training Procedure

    Evaluation

    Testing Data, Factors & Metrics

    Testing Data

    Factors

    Metrics

    Results

    Gemma-SEA-LION-v4-27B-IT Quantized Version

    How to Get Started with the Model

    Download the Models

    Usage

    Disclaimer

    Bias, Risks, and Limitations

    More Information

    leaderboard
    here
    link
    SEA-HELM evaluation benchmark
    IFEval
    MT-Bench
    Leaderboard results on SEA-HELM
    Download the Models
    HuggingFace SEA-LION v4 Collection
    🤗 google/gemma-3-27b-it
    SEA-LION Inquiry Form

    Indonesia

  • Javanese (Instruct/GGUF only)

  • Khmer

  • Lao

  • Malay

  • Sundanese (Instruct/GGUF only)

  • Tamil

  • Thai

  • Vietnamese

  • Tamil news is sourced with permission from

    Llama-SEA-LION-v3-70B-IT-Q5_0

  • Llama-SEA-LION-v3-70B-IT-Q5_K_M

  • Llama-SEA-LION-v3-70B-IT-Q6_K

  • Llama-SEA-LION-v3-70B-IT-Q8_0

  • First Stage

    AWS p5e.48xlarge

    8 instances

    Nvidia H200 140GB GPU

    64

    Training Duration

    200 hrs (step 0 - 9000)

    Precision

    bfloat16

    Optimizer

    decoupled_adamw

    Scheduler

    weight_stable_decay

    Learning Rate

    1.0e-5

    Global Batch Size

    512

    Code

    Stackv2

    40

    20

    20

    English

    Llama-SEA-LION-v3-70B

    Llama-SEA-LION-v3-70B-IT

    Llama-SEA-LION-v3-70B-IT-GGUF

    ,

    import transformers
    import torch
    
    model_id = "aisingapore/Llama-SEA-LION-v3-70B-IT"
    
    pipeline = transformers.pipeline(
        "text-generation",
        model=model_id,
        model_kwargs={"torch_dtype": torch.bfloat16},
        device_map="auto",
    )
    messages = [
        {"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
    ]
    
    outputs = pipeline(
        messages,
        max_new_tokens=256,
    )
    print(outputs[0]["generated_text"][-1])
    @misc{lowphansirikul2021wangchanberta,
        title={WangchanBERTa: Pretraining transformer-based Thai Language Models},
        author={Lalita Lowphansirikul and Charin Polpanumas and Nawat Jantrakulchai and Sarana Nutanong},
        year={2021},
        eprint={2101.09635},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
    }

    Llama-SEA-LION-v3-70B

    Training Infrastructure

    Configuration

    Tokenizer

    Training Data

    Benchmark Performance

    General Language Capabilities and Constraint-following Behaviour

    Llama-SEA-LION-v3-70B-IT

    Fine-Tuning Methodology

    Fine-Tuning Data

    Benchmark Performance

    General Language Capabilities

    Instruction-following Capabilities

    Llama-SEA-LION-v3-70B-IT-GGUF

    Download the Model(s)

    Usage

    Disclaimer

    References

    Thai Pre-Training Data Reference

    Llama3.1 Community License
    MosaicML Composer
    here
    here
    here
    SEA-HELM
    IFEval
    SEA-HELM
    IFEval
    MT-Bench
    Download the Model(s)
    HuggingFace SEA-LION v3 Collection

    Nemotron-SEA-LION-v4.8-120B-A12B-Base

    ,

    Nemotron-SEA-LION-v4.8-120B-A12B

    ,

    Nemotron-SEA-LION-v4.8-120B-A12B-GGUF

    ,

    Nemotron-SEA-LION-v4.8-120B-A12B-NVFP4

    Nemotron-SEA-LION-v4.8-120B-A12B-FP8

    SEA-LION-ModernBERT-Embedding-600M

    SEA-LION-E5-Embedding-600M

    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    Kaggle
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace

    EN

    Fineweb-Edu

    80B

    16

    40

    DCLM-OLMo2-HQ

    80B

    16

    Non-CC-EN

    40B

    8

    ZH

    SEA-LION Pile v1

    13.5B

    2.7

    9

    Fineweb2

    13.5B

    2.7

    Fineweb2-HQ

    4.5B

    0.9

    VI

    SEA-LION Pile v1

    4.25B

    0.85

    8.5

    SEA-LION Pile v2

    12.75B

    2.55

    Fineweb2

    8.5B

    1.7

    Non-CC-VI

    17B

    3.4

    ID

    SEA-LION Pile v1

    5.66B

    1.13

    8.5

    SEA-LION Pile v2

    17B

    3.4

    Fineweb2

    11.33B

    2.27

    Non-CC-ID

    8.5B

    1.7

    TH

    SEA-LION Pile v1

    3.035B

    0.61

    8.5

    SEA-LION Pile v2

    9.107B

    1.82

    Fineweb2

    3.035B

    0.61

    WangChanBERTa

    3.035B

    0.61

    Dolmav1

    3.035B

    0.61

    Non-CC-TH

    21.25B

    4.25

    TL, TA, MS, KM, LO and MY

    ALL_LANG

    77.5B

    15.5

    15.5

    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

    Gemma Terms of Use
    Gemma-3-27B-IT
    Seithi
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace

    Second Stage

    SingTel HGX-100

    16 instances

    Nvidia H100 80GB GPU

    128

    Training Duration

    495 hrs (step 9000 - 47684)

    Dolma

    37.5

    18.75

    25

    Fineweb-Edu

    7.5

    3.75

    Others

    5

    2.5

    Chinese

    SEA-LION Pile v1

    12

    6

    13

    Others

    14

    7

    Vietnamese

    SEA-LION Pile v1

    8.4

    4.2

    13

    VinBigData

    16

    8

    Others

    1.6

    0.8

    Indonesian

    SEA-LION Pile v1

    7

    3.5

    13

    SEA-LION Pile v2

    7

    3.5

    Others

    12

    6

    Thai

    SEA-LION Pile v1

    10.7

    5.35

    10

    WangChanBERTa

    8.5

    4.25

    Others

    0.8

    0.4

    Filipino - Malay - Tamil

    SEA-LION Pile v1, AI4Bharat Sangraha

    4.28

    2.14

    3

    Others

    1.72

    0.86

    Khmer - Lao - Burmese

    SEA-LION Pile v1

    5.2

    2.6

    3

    Others

    0.8

    0.4

    Seithi
    HuggingFace
    HuggingFace
    HuggingFace
    Ollama

    Qwen-SEA-LION-v4.5

    Last update: 2026-05-19

    SEA-LION is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region.

    The Qwen-SEA-LION-v4.5-27B-IT sub-collection — comprising the standard high-fidelity model and its speed-optimized companion, the 27B-IT-SpecDecoder — is built upon the Qwen3.6-27B dense architecture, a 27-billion parameter model featuring a hybrid Linear and Full Attention design. To ensure deep domain adaptation, both models underwent extensive distillation from Qwen/Qwen3.5-397B-A17B on the updated aisingapore/SEA-Instruct-2602 dataset. This instills native multilingual and multicultural fluency across English and key SEA languages (Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese), with the SpecDecoder variant specifically engineered to maximize throughput and minimize inference latency in production environments.

    Qwen-SEA-LION-v4.5-27B-IT-SpecDecoder is a draft model using speculative decoding method to employ a lightweight block diffusion model to draft multiple tokens in parallel trained from Qwen-SEA-LION-v4.5-27B-IT. This is the drafter model, which must be paired with aisingapore/Qwen-SEA-LION-v4.5-27B-IT.

    Qwen-SEA-LION-v4.5-27B-IT inherits the following features from Qwen3.6:

    • Context Window (262K): Reduce if facing OOM errors but keep ≥128K to preserve full reasoning capabilities.

    • Unified Vision-Language: Early fusion training delivers good performance across multimodal reasoning, coding, and visual tasks.

    • Scalable RL: Trained in million-agent environments for robust, real-world SEA adaptability.

    • Broad Linguistic Coverage: Deeply specialized in SEA cultural nuances while supporting 201 languages globally.

    • Advanced Infrastructure: Utilizes highly efficient multimodal training and asynchronous RL frameworks.

    • Agentic Coding: High-precision handling of repository-level reasoning and frontend workflows.

    • Thinking Preservation: Retains historical reasoning context to streamline iterative development and reduce compute overhead.

    SEA-LION stands for Southeast Asian Languages In One Network.

    We performed post-training in English and SEA languages on Qwen3.6-27B, a multimodal learning model using the Qwen3.6 architecture, to create Qwen-SEA-LION-v4.5.

    For tokenization, the model employs the default tokenizer used in Qwen3.6.

    • Developed by: AI Products Pillar, AI Singapore

    • Funded by: Singapore NRF

    • Shared by: AI Products Pillar, AI Singapore

    • Model type: Causal Language Model with Vision Encoder

    SpecDecoder was Finedtuned from targeted to

    Qwen-SEA-LION-v4.5-27B-IT models are available for download via the following channels:

    Model
    Download

    Use the code below to get started with the model with 🤗 Transformers libraries.

    Agentic Example:

    Output

    Use the code below to get aisingapore/Qwen-SEA-LION-v4.527B-IT-SpecDecoder booster with vLLM.

    🤗

    Our post-training workflow consists solely of distillation and model merging.

    We evaluated Qwen-SEA-LION-v4.5 on general language, multi-turn chat and instruction-following capabilities.

    For details on Qwen-SEA-LION-v4.5-27B-IT performance, please refer to the .

    The architecture is based on the highly efficient Qwen3.6 foundation. The detailed architecture can be found at .

    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.

    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.

    Training Stage: Post-Training (Logit Distillation & Model Merging))

  • Context length: 262k

  • Language(s): fine-tuned on Burmese, Indonesian, Filipino, Malay, Tamil, Thai, and Vietnamese

  • License:

  • Finetuned from model:

  • Qwen-SEA-LION-v4.5-27B-IT

    ,

    Qwen-SEA-LION-v4.5-27B-IT-SpecDecoder

    Qwen-SEA-LION-v4.5-27B-IT-GGUF

    ,

    pip install "transformers>=4.57.0" accelerate vllm
    # ============================================================
    # TEXT-ONLY INFERENCE example
    # ============================================================
    
    import torch
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    MODEL_ID = "aisingapore/Qwen-SEA-LION-v4.5-27B-IT"
    
    # ── Load tokenizer ──
    tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
    
    # ── Load model in bfloat16 across all available GPUs ──
    # attn_implementation="sdpa" is safer for the hybrid DeltaNet arch;
    # flash_attention_2 compatibility depends on your transformers version
    model = AutoModelForCausalLM.from_pretrained(
        MODEL_ID,
        torch_dtype=torch.bfloat16,
        device_map="auto",
        attn_implementation="sdpa",  # use sdpa for DeltaNet hybrid layers
    )
    
    # ── Message: text-only, same Malay query from original snippet ──
    messages = [
        {
            "role": "user",
            "content": "Tolong carikan flat 4-bilik dekat Tampines, bajet bawah $500,000. "
                       "Nak tahu juga berapa anggaran pinjaman bulanan."
        }
    ]
    
    # ── Apply chat template — text-only, thinking disabled ──
    # enable_thinking=False → instruct/non-thinking mode
    # Qwen3.6 does NOT support /no_think soft switch unlike Qwen3
    text = tokenizer.apply_chat_template(
        messages,
        tokenize=False,
        add_generation_prompt=True,
        enable_thinking=False,      # hard-disable CoT thinking blocks
    )
    
    # ── Tokenize ──
    inputs = tokenizer(text, return_tensors="pt").to(model.device)
    
    # ── Generate — non-thinking mode params ──
    # presence_penalty=1.5 is important for Qwen3.6 non-thinking mode
    # to suppress repetition; not available in model.generate() directly,
    # so use do_sample=True with the temperature/top_p/top_k trio
    generated_ids = model.generate(
        **inputs,
        max_new_tokens=512,
        do_sample=True,
        temperature=0.7,    # non-thinking instruct mode
        top_p=0.80,
        top_k=20,
        # Note: presence_penalty requires vLLM/SGLang for full effect;
        # in transformers use repetition_penalty as a proxy
        repetition_penalty=1.1,
    )
    
    # ── Decode only newly generated tokens ──
    output_ids = generated_ids[0][inputs["input_ids"].shape[1]:]
    response = tokenizer.decode(output_ids, skip_special_tokens=True).strip()
    print(response)
    # ============================================================
    # TOOL CALLING (Transformers, local)
    # ============================================================
    
    import torch
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    MODEL_ID = "aisingapore/Qwen-SEA-LION-v4.5-27B-IT"
    
    tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
    
    model = AutoModelForCausalLM.from_pretrained(
        MODEL_ID,
        torch_dtype=torch.bfloat16,
        device_map="auto",
        attn_implementation="sdpa",
    )
    
    messages = [
        {
            "role": "user",
            "content": "Tolong carikan flat 4-bilik dekat Tampines, bajet bawah $500,000. "
                       "Nak tahu juga berapa anggaran pinjaman bulanan."
        }
    ]
    
    tools = [
        {
            "type": "function",
            "function": {
                "name": "search_hdb_listings",
                "description": "Search for HDB flats available for sale",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "Town or area name"
                        },
                        "flat_type": {
                            "type": "string",
                            "description": "Flat type e.g. 3-room, 4-room, 5-room"
                        },
                        "max_price": {
                            "type": "number",
                            "description": "Maximum price in SGD"
                        }
                    },
                    "required": ["location", "flat_type"]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "name": "calculate_mortgage",
                "description": "Calculate estimated monthly mortgage payment",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "loan_amount": {
                            "type": "number",
                            "description": "Loan amount in SGD"
                        },
                        "interest_rate": {
                            "type": "number",
                            "description": "Annual interest rate as percentage"
                        },
                        "loan_tenure_years": {
                            "type": "integer",
                            "description": "Loan period in years"
                        }
                    },
                    "required": ["loan_amount"]
                }
            }
        }
    ]
    
    # ============================================================
    # apply_chat_template returns BatchEncoding with keys:
    #   input_ids, attention_mask (and sometimes token_type_ids)
    # ============================================================
    
    inputs = tokenizer.apply_chat_template(
        messages,
        tools=tools,
        return_tensors="pt",
        return_dict=True,          # ← returns BatchEncoding dict with attention_mask
        add_generation_prompt=True,
        enable_thinking=False,     # disable CoT for structured tool call output
    ).to(model.device)
    
    # ── Unpack BatchEncoding dict with ** — fixes the AttributeError ──
    generated_ids = model.generate(
        **inputs,                  # ← unpack: passes input_ids + attention_mask
        max_new_tokens=512,
        do_sample=False,
    )
    
    # ── Decode only new tokens — slice off the prompt portion ──
    output_ids = generated_ids[0][inputs["input_ids"].shape[1]:]
    response = tokenizer.decode(output_ids, skip_special_tokens=True).strip()
    print(response)
    
    # ============================================================
    # NO-VLLM AGENTIC LOOP
    # ============================================================
    
    import os
    import json
    import re
    import torch
    from transformers import AutoTokenizer, AutoModelForCausalLM
    from dotenv import load_dotenv
    
    load_dotenv()
    
    MODEL_ID = "aisingapore/Qwen-SEA-LION-v4.5-27B-IT"
    
    print("Loading tokenizer...")
    tokenizer = AutoTokenizer.from_pretrained(
        MODEL_ID,
        token=os.getenv("HF_TOKEN"),
    )
    
    print("Loading model across GPUs...")
    model = AutoModelForCausalLM.from_pretrained(
        MODEL_ID,
        token=os.getenv("HF_TOKEN"),
        torch_dtype=torch.bfloat16,
        device_map="auto",
        attn_implementation="sdpa",
    )
    
    device_info = getattr(model, "hf_device_map", None) or str(model.device)
    print(f"Model loaded. Device: {device_info}")
    
    TOOLS = [
        {
            "type": "function",
            "function": {
                "name": "search_hdb_listings",
                "description": "Search for HDB flats available for sale",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {"type": "string", "description": "Town or area name"},
                        "flat_type": {"type": "string", "description": "e.g. 4-room"},
                        "max_price": {"type": "number", "description": "Max price in SGD"},
                    },
                    "required": ["location", "flat_type"],
                },
            },
        },
        {
            "type": "function",
            "function": {
                "name": "calculate_mortgage",
                "description": "Calculate estimated monthly mortgage payment",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "loan_amount": {"type": "number", "description": "Loan amount SGD"},
                        "interest_rate": {"type": "number", "description": "Annual rate %"},
                        "loan_tenure_years": {"type": "integer", "description": "Loan years"},
                    },
                    "required": ["loan_amount"],
                },
            },
        },
    ]
    
    def execute_tool(name: str, arguments: dict) -> str:
        """Mock tool executor — replace with real API calls."""
        if name == "search_hdb_listings":
            return json.dumps({
                "listings": [
                    {
                        "address": "Blk 472 Tampines St 43",
                        "flat_type": arguments.get("flat_type"),
                        "resale_price": 488000,
                        "floor_area_sqm": 93,
                        "remaining_lease": "67 years",
                    },
                    {
                        "address": "Blk 512 Tampines Ave 4",
                        "flat_type": arguments.get("flat_type"),
                        "resale_price": 475000,
                        "floor_area_sqm": 89,
                        "remaining_lease": "62 years",
                    },
                ]
            })
        elif name == "calculate_mortgage":
            principal = arguments["loan_amount"]
            r = (arguments.get("interest_rate", 2.6) / 100) / 12
            n = arguments.get("loan_tenure_years", 25) * 12
            monthly = principal * (r * (1 + r) ** n) / ((1 + r) ** n - 1)
            return json.dumps({
                "loan_amount": principal,
                "monthly_repayment_sgd": round(monthly, 2),
            })
        return json.dumps({"error": f"Unknown tool: {name}"})
    
    def generate_response(messages: list) -> str:
        """
        Single model.generate() call.
        Returns the raw decoded string (may contain tool call JSON).
        """
        # ── Render chat template to string first ──
        text = tokenizer.apply_chat_template(
            messages,
            tools=TOOLS,
            tokenize=False,
            add_generation_prompt=True,
            enable_thinking=False,      # no  blocks for tool calling
     )
    
     # ── Tokenize separately ──
     inputs = tokenizer(text, return_tensors="pt").to(model.device)
    
     # ── Generate ──
     with torch.no_grad(): # saves memory during inference
     generated_ids = model.generate(
     **inputs,
     max_new_tokens=512,
     do_sample=False, # greedy for deterministic tool JSON
     )
    
     # ── Decode new tokens only ──
     output_ids = generated_ids[0][inputs["input_ids"].shape[1]:]
     return tokenizer.decode(output_ids, skip_special_tokens=True).strip()
    
    def parse_tool_calls(response_text: str) -> list:
     """
     Parse Hermes-style tool call JSON from model output.
     Qwen3.6 emits tool calls wrapped in ... tags.
     Returns list of {"name": ..., "arguments": {...}} dicts.
     Falls back to empty list if no tool calls found.
     """
     import re
     tool_calls = []
    
     # ── Match {...} blocks ──
     pattern = r"(.*?)"
     matches = re.findall(pattern, response_text, re.DOTALL)
    
     for match in matches:
     try:
     call = json.loads(match.strip())
     tool_calls.append(call)
     except json.JSONDecodeError:
     print(f" [WARN] Could not parse tool call JSON: {match[:100]}")
    
     return tool_calls
    
    def run_agent(user_query: str, max_steps: int = 10) -> str:
     """
     Transformers-native agentic loop — no vLLM or API server needed.
    
     Loop:
     1. Generate response
     2. Parse tool calls from output
     3. Execute tools, append results
     4. Repeat until no tool calls in response
     """
     messages = [
     {
     "role": "system",
     "content": (
     "You are a helpful Singapore housing assistant. "
     "Always call the relevant tools to get accurate data before answering. "
     "Give a clear, concise summary after gathering all information."
     ),
     },
     {"role": "user", "content": user_query},
     ]
    
     print(f"\n{'='*60}")
     print(f"USER: {user_query}")
     print(f"{'='*60}")
    
     for step in range(max_steps):
     print(f"\n[Step {step + 1}] Generating...")
    
     response_text = generate_response(messages)
     print(f" Raw output: {response_text[:200]}...")
    
     # ── Try to parse tool calls from the response ──
     tool_calls = parse_tool_calls(response_text)
    
     if tool_calls:
     print(f" → Found {len(tool_calls)} tool call(s)")
    
     # ── Append assistant turn with raw response ──
     messages.append({
     "role": "assistant",
     "content": response_text,
     })
    
     # ── Execute each tool and append results ──
     for call in tool_calls:
     fn_name = call.get("name", "")
     fn_args = call.get("arguments", {})
    
     # ── arguments may be a string or dict depending on model output ──
     if isinstance(fn_args, str):
     fn_args = json.loads(fn_args)
    
     print(f" • {fn_name}({json.dumps(fn_args, ensure_ascii=False)})")
     result = execute_tool(fn_name, fn_args)
     print(f" ↳ {result[:150]}")
    
     # ── Append tool result as tool role message ──
     messages.append({
     "role": "tool",
     "name": fn_name,
     "content": result,
     })
    
     continue # loop back for next generation
    
     # ── No tool calls — this is the final answer ──
     print(f"\n{'='*60}")
     print(f"AGENT FINAL ANSWER:\n{response_text}")
     print(f"{'='*60}\n")
     return response_text
    
     return "[Agent stopped: exceeded maximum steps]"
    
    # ── Run examples ──
    if __name__ == "__main__":
    
     run_agent(
     "Tolong carikan flat 4-bilik dekat Tampines, bajet bawah $500,000. "
     "Nak tahu juga berapa anggaran pinjaman bulanan."
     )
    ============================================================
    AGENT FINAL ANSWER:
    
    Tampines
    
    4-room
    
    500000
    
    ============================================================
    CUDA_VISIBLE_DEVICES=0 vllm serve aisingapore/Qwen-SEA-LION-v4.5-27B-IT \
    --speculative-config '{"method": "dflash", "model": "aisingapore/Qwen-SEA-LION-v4.5-27B-IT-SpecDecoder", "num_speculative_tokens": 16}' \
    --attention-backend flash_attn \
    --max-num-batched-tokens 32768 \
    --gdn-prefill-backend triton

    Model Details

    Model Description

    Model Sources

    How to Get Started with the Model

    Tool Calling example

    Training Details

    Training Data

    Training Regime

    Evaluation

    Testing Data, Factors & Metrics

    Results

    Technical Specifications

    Model Architecture

    Uses

    Out-of-Scope Use

    Bias, Risks, and Limitations

    z-lab/Qwen3.6-27B-DFlash
    Qwen-SEA-LION-v4.5-27B-IT
    HuggingFace SEA-LION v4.5 Collection
    aisingapore/SEA-Instruct-2602
    SEA-LION Leaderboard
    https://huggingface.co/Qwen/Qwen3.6-27B#model-overview
    Apache-2.0
    https://huggingface.co/Qwen/Qwen3.6-27B
    HuggingFace
    Ollama
    HuggingFace
    HuggingFace
    Ollama

    SEA-LION v1

    Introduction

    SEA-LION version 1, released in December 2023, was our first collection of Large Language Models (LLMs) that were specifically pretrained and instruct-tuned for the Southeast Asia (SEA) region, making a significant leap forward in the field of Natural Language Processing in understanding the SEA regional context.

    SEA-LION v1 comes in two model sizes – one with 3 billion parameters (SEA-LION-v1-3B) and another with 7 billion parameters (SEA-LION-v1-7B). Both variants are built on the robust MPT architecture and utilise a vocabulary size of 256K, with context length of 2048 tokens.

    Our SEA-LION-v1-7B model was then further instruct-tuned to produce SEA-LION-v1-7B-IT.

    At a glance:

    • Model type: Decoder

    • Tokenizer: Custom SEABPETokenizer

    • Available Formats:

      • 3B Base (SEA-LION-v1-3B)

      • 7B Base (SEA-LION-v1-7B)

      • 7B Instruct (SEA-LION-v1-7B-IT)

    • Languages:

      1. English

      2. Chinese

      3. Indonesian

      4. Malay

    • License: MIT

    SEA-LION-v1-3B and SEA-LION-v1-7B are both decoder models built on the robust MPT architecture:

    Parameter
    SEA-LION-v1-3B
    SEA-LION-v1-7B

    SEA-LION v1 was trained using on the following hardware:

    Training Details
    SEA-LION-v1-3B
    SEA-LION-v1-7B

    Configuration:

    HyperParameter
    SEA-LION-v1-3B
    SEA-LION-v1-7B

    For full details on our SEA-LION v1 training infrastructure and configuration, please refer to our

    For tokenization, both SEA-LION-v1-3B and SEA-LION-v1-7B employed our custom SEABPETokenizer, which is specially tailored for SEA languages, ensuring optimal model performance.

    SEABPETokenizer was trained by sampling 20M lines from the model training data, using the SentencePiece framework. The tokenizer type is Byte-Pair Encoding (BPE).

    SEA-LION-v1-3B and SEA-LION-v1-7B were trained on 980B tokens of text data from 11 languages spoken across SEA:

    • English

    • Chinese

    • Indonesian

    • Malay

    • Thai

    These 980B tokens comprised of the following data mix:

    Data Source
    Unique Tokens
    Multiplier
    Total Tokens
    Percentage

    The dataset is available here: .

    SEA-LION-v1-3B and SEA-LION-v1-7B base models had an average performance on general tasks in English (as measured by Hugging Face's LLM Leaderboard):

    Model
    ARC
    HellaSwag
    MMLU
    TruthfulQA
    Average

    For up-to-date comparison of SEA-LION performance against other latest models, please refer to our

    SEA-LION-v1-7B-IT is a multilingual model which has been fine-tuned with thousands of English and Indonesian instruction-completion pairs alongside a smaller pool of instruction-completion pairs from other ASEAN languages, using our pre-trained SEA-LION-v1-7B as base.

    These instructions have been carefully curated and rewritten to ensure the model was trained on truly open, commercially permissive and high quality datasets.

    The SEA-LION-v1-7B-IT was fine-tuned using 8x A100-40GB using parameter efficient fine tuning in the form of LoRA.

    To perform similar fine-tuning on our SEA-LION-v1-7B base model using the HuggingFace TRL library, you can refer to sample configurations provided in our

    SEA-LION-v1-7B-IT was trained on a wide range of instructions that were manually and stringently verified by our team. A large portion of the effort was dedicated to ensuring that each instruction-completion pair that the model sees is of a high quality and any errors were corrected and rewritten by native speakers or else dropped from our mix.

    In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data source.

    We evaluated SEA-LION-v1-7B-IT on the BHASA benchmark ( and ) across a variety of tasks.

    BHASA stands out amongst other evaluations for SEA languages for its holistic approach to evaluation, including not just traditional Natural Language Processing (NLP) benchmarking tasks (such as sentiment analysis and question answering), but also linguistic and cultural diagnostic tests which are meticulously handcrafted.

    The evaluation was done zero-shot with Indonesian prompts and only a sample of 100-1000 instances for each dataset was used as per the setting described in the BHASA paper.

    • For Natural Language Understanding (NLU) tasks, we tested the model on Sentiment Analysis (Sentiment) using the NusaX dataset, Question Answering (QA) using the TyDiQA dataset, and Toxicity Detection (Toxicity) using the Indonesian Multi-Label Hate Speech Detection dataset. The metrics used are F1 scores for all three tasks.

    • For Natural Language Generation (NLG) tasks, we tested the model on Machine Translation from English to Indonesian (Eng>Indo) and from Indonesian to English (Indo>Eng) using the FLORES-200 dataset, and Abstractive Summarization (Summary) using the XLSum dataset. The metrics used for Machine Translation and Abstractive Summarization are ChrF++ and ROUGE-L respectively.

    • For Natural Language Reasoning (NLR) tasks, we tested the model on Natural Language Inference (NLI) using the IndoNLI lay dataset and on Causal Reasoning (Causal) using the XCOPA dataset. The metrics are based on accuracy for both tasks.

    SEA-LION v1 models achieved better or competitive performances on tasks in regional languages at the time of release:

    Model
    QA (F1)
    Sentiment (F1)
    Toxicity (F1)
    Eng>Indo (ChrF++)
    Indo>Eng (ChrF++)
    Summary (ROUGE-L)
    NLI (Acc)
    Causal (Acc)

    For up-to-date comparison of SEA-LION performance against other latest models, please refer to our

    Support for SEA-LION-v1-IT-GGUF was merged into llama.cpp as of 4th Apr 2024.

    SEA-LION can be run using the llama.cpp library from commit id or later.

    Prompt Template:

    Recommended llama.cpp command:

    To convert & quantize your own SEA-LION model:

    For other parameters and how to use them, please refer to

    The following quantized GGUF formats of our SEA-LION-v1-7B-IT model are available:

    • sea-lion-7b-instruct-Q2_K

    • sea-lion-7b-instruct-Q3_K_M

    • sea-lion-7b-instruct-Q4_0

    • sea-lion-7b-instruct-Q4_K_M

    • sea-lion-7b-instruct-Q5_0

    Please refer to our section for more details on how to access them.

    SEA-LION v1 models are available for download via the following channels:

    Model
    Download

    SEA-LION-v1-7B-IT can be run using the 🤗 Transformers library

    A basic prompting guide for the SEALION v1 models is provided

    It is important for users to be aware that our models exhibits certain limitations that warrant consideration:

    1. 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 in its reasoning.

    2. 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.

    3. It should be noted that the model has not been optimized for multi-turn dialogue interactions, which may result in reduced effectiveness in extended conversations.

    Thai Pre-Training Data Reference

    7B GGUF (SEA-LION-v1-7B-IT-GGUF)

    Thai

  • Vietnamese

  • Filipino

  • Tamil

  • Burmese

  • Khmer

  • Lao

  • Vietnamese

  • Filipino

  • Tamil

  • Burmese

  • Khmer

  • Lao

  • sea-lion-7b-instruct-Q5_K_M

  • sea-lion-7b-instruct-Q6_K

  • sea-lion-7b-instruct-Q8_0

  • Layers

    32

    32

    d_model

    2560

    4096

    head_dim

    20

    32

    AWS EC2 p4d.24xlarge

    30 instances

    32 instances

    Nvidia A100 40GB GPU

    240

    256

    Training Duration

    14 days

    22 days

    Precision

    bfloat16

    bfloat16

    Optimizer

    decoupled_adamw

    decoupled_adamw

    Scheduler

    cosine_with_warmup

    cosine_with_warmup

    RefinedWeb - English

    571.3B

    1

    571.3B

    58.20%

    mC4 - Chinese

    SEA-LION-v1-3B

    36.26

    64.59

    24.07

    36.46

    40.35

    SEA-LION-7B-Instruct-Research

    ### USER:
    {{prompt}}
    
    ### RESPONSE:
    
    ./main -m sea-lion-7b-instruct-Q4_0.gguf --temp 0 --repeat-penalty 1.2 -e -ngl 32 -p "### USER:\nwhat is a sea lion?\n\n### RESPONSE:\n"
    python convert-hf-to-gguf.py {{model path}}
    
    ./quantize ggml-model-f16.gguf {{Quant Type}}

    SEA-LION-v1-3B

    SEA-LION-v1-7B

    SEA-LION-v1-7B-IT

    SEA-LION-v1-7B-IT-GGUF

    # Please use transformers==4.37.2
    from transformers import AutoModelForCausalLM, AutoTokenizer
    
    tokenizer = AutoTokenizer.from_pretrained("aisingapore/SEA-LION-v1-7B-IT", trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained("aisingapore/SEA-LION-v1-7B-IT", trust_remote_code=True)
    
    prompt_template = "### USER:\n{human_prompt}\n\n### RESPONSE:\n"
    prompt = """Apa sentimen dari kalimat berikut ini?
    Kalimat: Buku ini sangat membosankan.
    Jawaban: """
    full_prompt = prompt_template.format(human_prompt=prompt)
    
    tokens = tokenizer(full_prompt, return_tensors="pt")
    output = model.generate(tokens["input_ids"], max_new_tokens=20, eos_token_id=tokenizer.eos_token_id)
    print(tokenizer.decode(output[0], skip_special_tokens=True))
    @misc{lowphansirikul2021wangchanberta,
        title={WangchanBERTa: Pretraining transformer-based Thai Language Models},
        author={Lalita Lowphansirikul and Charin Polpanumas and Nawat Jantrakulchai and Sarana Nutanong},
        year={2021},
        eprint={2101.09635},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
    }

    SEA-LION-v1-3B / SEA-LION-v1-7B

    Model Architecture

    Training Infrastructure

    Tokenizer

    Training Data

    Performance

    SEA-LION-v1-7B-IT

    Fine-Tuning Methodology

    Fine-Tuning Data

    Benchmarks

    Performance

    SEA-LION-7B-Instruct-GGUF

    Download the Model(s)

    Usage

    Prompting Guide

    Disclaimer

    References

    MosaicML Composer
    SEA-LION Pre-Training Setup Guide
    SEA-LION-PILE
    SEA-LION Leaderboard
    SEA-LION QLoRA Fine-Tuning Guide.
    arXiv
    GitHub
    SEA-LION Leaderboard
    bb43cf7
    llama.cpp documentation.
    Download the Model(s)
    HuggingFace SEA-LION v1 Collection
    here

    Vocabulary

    256000

    256000

    Sequence Length

    2048

    2048

    Learning Rate

    1.6e-4

    6.0e-5

    Global Batch Size

    1200

    2048

    Micro Batch Size

    5

    4

    91.2B

    1

    91.2B

    9.29%

    mC4 - Indonesian

    3.68B

    4

    14.7B

    1.50%

    mC4 - Malay

    0.72B

    4

    2.9B

    0.29%

    mC4 - Filipino

    1.32B

    4

    5.3B

    0.54%

    mC4 - Burmese

    1.2B

    4

    4.9B

    0.49%

    mC4 - Vietnamese

    63.4B

    1

    63.4B

    6.46%

    mC4 - Thai

    5.8B

    2

    11.6B

    1.18%

    WangChanBERTa - Thai

    5B

    2

    10B

    1.02%

    mC4 - Lao

    0.27B

    4

    1.1B

    0.12%

    mC4 - Khmer

    0.97B

    4

    3.9B

    0.40%

    mC4 - Tamil

    2.55B

    4

    10.2B

    1.04%

    the Stack - Python

    20.9B

    2

    41.8B

    4.26%

    the Stack - Javascript

    55.6B

    1

    55.6B

    5.66%

    the Stack - Shell

    1.2B5

    2

    2.5B

    0.26%

    the Stack - SQL

    6.4B

    2

    12.8B

    1.31%

    the Stack - Markdown

    26.6B

    1

    26.6B

    2.71%

    RedPajama - StackExchange

    21.2B

    1

    21.2B

    2.16%

    RedPajama - ArXiv

    30.6B

    1

    30.6B

    3.12%

    SEA-LION-v1-7B

    39.93

    68.51

    26.87

    35.09

    42.60

    24.86

    76.13

    24.45

    52.50

    46.82

    15.44

    33.20

    23.80

    SEA-LION-7B-Instruct

    68.41

    91.45

    17.98

    57.48

    58.04

    17.54

    53.10

    60.80

    SeaLLM 7B v1

    30.96

    56.29

    22.60

    62.23

    41.55

    14.03

    26.50

    56.60

    SeaLLM 7B v2

    44.40

    80.13

    55.24

    64.01

    63.28

    17.31

    43.60

    82.00

    Sailor-7B

    65.43

    59.48

    20.48

    64.27

    60.68

    8.69

    15.10

    38.40

    Llama 2 7B Chat

    11.12

    52.32

    0.00

    44.09

    57.58

    9.24

    0.00

    0.00

    Mistral 7B Instruct v0.1

    38.85

    74.38

    20.83

    30.60

    51.43

    15.63

    28.60

    50.80

    GPT-4

    73.60

    74.14

    63.96

    69.38

    67.53

    18.71

    83.20

    96.00

    HuggingFace
    HuggingFace
    HuggingFace
    HuggingFace