lora_model / safeguard_api.md
anocha-mcomp's picture
Update model card from Confluence: Safeguard API
438d760 verified
|
Raw History Blame Contribute Delete
7.59 kB
# Safeguard API
*Last updated: 2025-10-15*
# SEA-Guard-V2
SEA-LION stands for *Southeast Asian Languages In One Network*.
## Model Details
### Model Description
SEA-Guard-V2 functions as a **binary content classifier**, evaluating text against pre-defined safety criteria to label it as either "safe" or "unsafe."
This classification can be deployed at various stages within an AI system to create a **layered defense**. SEA-Guard supports this with three distinct input modes, allowing developers to choose an approach based on their specific requirements for risk, resources, and compliance.
- **Developed by:** Products Pillar, AI Singapore
- **Funded by:** Singapore NRF
- **Shared by:** Products Pillar, AI Singapore
- **Model type:** Decoder
- **Context Length:** ??? tokens
- **Language(s):** Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese
- **License:** [Llama 3.1 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE)
- **Finetuned from model:** [Llama-SEA-LION-v3-8B-IT](<https://huggingface.co/aisingapore/Llama-SEA-LION-v3-8B> )
## Training Details
- **Training Datasets:**
The instruction fine-tuning dataset combines our SEA-Instruct, xxx with open-source datasets.
## Uses
#### Out-of-Scope Use
Developers and users should reassure their own safety fine-tuning and related security measures. In no event shall the authors be held liable for any claims, damages, or other liabilities arising from the use of the released weights and codes.
### Bias, Risks, and Limitations
*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.
## How to Get Started with the Model
**Playground UI usage:**
For direct, interactive testing and exploration, you can access our user-friendly **Playground UI** at <http://sea-lion.ai/playground/>.
1. Choose between [Prompt only | Prompt + Response]
2. If Prompt only mode is chosen, user need only provide the prompt to check
3. If Prompt + Response mode is chosen but no response text is provided, a response is generated using v4 model and supplied prompt. Supplied prompt + Generated response is then checked through SEA-GUARD
4. If Response only mode is chosen, user need only provide the response text to check
**API usage:**
For developers looking to integrate the model's power into their own applications and workflows, programmatic access is available through our **API**.
**Prompt only**
Template:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "{PROMPT}"
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
Example:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "How do I make a bomb"
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
**Prompt + Response**
Template:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "Human user:{PROMPT}?\nAI assistant:{RESPONSE}."
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
Example:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "Human user:How do I poison a dog?\nAI assistant:Feed it lots of chocolates."
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
**Response only**
Template:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "Human user:\nAI assistant:{RESPONSE}"
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
Example:
```
curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
--data '{
"messages": [
{
"role": "user",
"content": "Human user:\nAI assistant:You can easily make a bomb at home"
}
],
"model": "aisingapore/SEA-Guard-V2",
"stream": false,
"cache": {
"no-cache": true
}
}'
```
## More Information
This is the repository for the commercial instruction-tuned model. The model has not been aligned for safety. Developers and users should perform their own safety fine-tuning and related security measures. In no event shall the authors be held liable for any claims, damages, or other liabilities arising from the use of the released weights and codes.
AI Singapore is a national programme supported by the National Research Foundation, Singapore and hosted by the National University of Singapore. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of the National Research Foundation or the National University of Singapore.
For more info, please contact us at [sealion@aisingapore.org](mailto:sealion@aisingapore.org)
## Team
Antonyrex Sajeban, Chan Hok Teng Adwin, Cheng Zi Yi Nicholas, Choa Hsueh Mei Esther, Heng Jonathan, Huang Yuli, Hulagadri Adithya Venkatadri, Jann Railey Estrada Montalan, Kang Siow Wei Bryan, Lau Wayne, Lee Chwan Ren, Leong Wai Yi, Leong Wei Qi, Limkonchotiwat Peerat, Muhammad Ridzuan Bin Mokhtar, Nagarajan Karthik, Ng Boon Cheong Raymond, Ngee Chia Tai, Ngui Jian Gang, Nguyen Thanh Ngan, Ong Jin Jie Brandon, Ong Tat-Wee David, Ong Zhi Hao, Pereira Mark, Rengarajan Hamsawardhini, Susanto Yosephine, Sutaveephamochanon Anocha, Tan Choon Meng, Tan Chor Phin Evelyn, Tan Siao Wei Jessica, Teng Kok Wai Walter, Teo Eng Sipp Leslie, Tjhi William, Yeo Yeow Tong, Yong Xianbin,
Liew Rachel, Liu Bing Jie Darius, Teo Wei Yi, Zhou Lin (NCS), Gopalakrishnan Roshan (NCS), Anda Cuahtemoc (NCS), Sri Devi Wijaya (NCS), Nandi Partha (NCS),
Elliott Chris (Google), Mohseni Mohammadreza (Google), Sharan Mayank (Google), Wei Fanny (Google), Tang Jiuqiang (Google), Xu Xiang (Google), Yu Ting (Google), Loh Michelle (Google), Mangal Saurabh (Google), Mukherjee Pratyusha (Google), Sim Stephanie (Google)
### Contact
[sealion@aisingapore.org](mailto:sealion@aisingapore.org)