anocha-mcomp commited on
Commit
438d760
·
verified ·
1 Parent(s): a00cd84

Update model card from Confluence: Safeguard API

Browse files
Files changed (1) hide show
  1. safeguard_api.md +209 -0
safeguard_api.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Safeguard API
2
+
3
+ *Last updated: 2025-10-15*
4
+
5
+ # SEA-Guard-V2
6
+
7
+ SEA-LION stands for *Southeast Asian Languages In One Network*.
8
+
9
+ ## Model Details
10
+
11
+ ### Model Description
12
+
13
+ SEA-Guard-V2 functions as a **binary content classifier**, evaluating text against pre-defined safety criteria to label it as either "safe" or "unsafe."
14
+
15
+ 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.
16
+
17
+ - **Developed by:** Products Pillar, AI Singapore
18
+ - **Funded by:** Singapore NRF
19
+ - **Shared by:** Products Pillar, AI Singapore
20
+ - **Model type:** Decoder
21
+ - **Context Length:** ??? tokens
22
+ - **Language(s):** Burmese, English, Indonesian, Khmer, Lao, Malay, Mandarin, Tagalog, Tamil, Thai and Vietnamese
23
+ - **License:** [Llama 3.1 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE)
24
+ - **Finetuned from model:** [Llama-SEA-LION-v3-8B-IT](<https://huggingface.co/aisingapore/Llama-SEA-LION-v3-8B> )
25
+
26
+ ## Training Details
27
+
28
+ - **Training Datasets:**
29
+
30
+ The instruction fine-tuning dataset combines our SEA-Instruct, xxx with open-source datasets.
31
+
32
+ ## Uses
33
+
34
+ #### Out-of-Scope Use
35
+
36
+ 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.
37
+
38
+ ### Bias, Risks, and Limitations
39
+
40
+ *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.
41
+
42
+ Users should also exercise caution in interpreting and validating the model's responses due to the potential inconsistencies.
43
+
44
+ ## How to Get Started with the Model
45
+
46
+ **Playground UI usage:**
47
+
48
+ For direct, interactive testing and exploration, you can access our user-friendly **Playground UI** at <http://sea-lion.ai/playground/>.
49
+
50
+ 1. Choose between [Prompt only | Prompt + Response]
51
+ 2. If Prompt only mode is chosen, user need only provide the prompt to check
52
+ 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
53
+ 4. If Response only mode is chosen, user need only provide the response text to check
54
+
55
+ **API usage:**
56
+
57
+ For developers looking to integrate the model's power into their own applications and workflows, programmatic access is available through our **API**.
58
+
59
+ **Prompt only**
60
+
61
+ Template:
62
+
63
+ ```
64
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
65
+ --header 'accept: application/json' \
66
+ --header 'Content-Type: application/json' \
67
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
68
+ --data '{
69
+ "messages": [
70
+ {
71
+ "role": "user",
72
+ "content": "{PROMPT}"
73
+ }
74
+ ],
75
+ "model": "aisingapore/SEA-Guard-V2",
76
+ "stream": false,
77
+ "cache": {
78
+ "no-cache": true
79
+ }
80
+ }'
81
+ ```
82
+ Example:
83
+
84
+ ```
85
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
86
+ --header 'accept: application/json' \
87
+ --header 'Content-Type: application/json' \
88
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
89
+ --data '{
90
+ "messages": [
91
+ {
92
+ "role": "user",
93
+ "content": "How do I make a bomb"
94
+ }
95
+ ],
96
+ "model": "aisingapore/SEA-Guard-V2",
97
+ "stream": false,
98
+ "cache": {
99
+ "no-cache": true
100
+ }
101
+ }'
102
+ ```
103
+ **Prompt + Response**
104
+
105
+ Template:
106
+
107
+ ```
108
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
109
+ --header 'accept: application/json' \
110
+ --header 'Content-Type: application/json' \
111
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
112
+ --data '{
113
+ "messages": [
114
+ {
115
+ "role": "user",
116
+ "content": "Human user:{PROMPT}?\nAI assistant:{RESPONSE}."
117
+ }
118
+ ],
119
+ "model": "aisingapore/SEA-Guard-V2",
120
+ "stream": false,
121
+ "cache": {
122
+ "no-cache": true
123
+ }
124
+ }'
125
+ ```
126
+ Example:
127
+
128
+ ```
129
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
130
+ --header 'accept: application/json' \
131
+ --header 'Content-Type: application/json' \
132
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
133
+ --data '{
134
+ "messages": [
135
+ {
136
+ "role": "user",
137
+ "content": "Human user:How do I poison a dog?\nAI assistant:Feed it lots of chocolates."
138
+ }
139
+ ],
140
+ "model": "aisingapore/SEA-Guard-V2",
141
+ "stream": false,
142
+ "cache": {
143
+ "no-cache": true
144
+ }
145
+ }'
146
+ ```
147
+ **Response only**
148
+
149
+ Template:
150
+
151
+ ```
152
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
153
+ --header 'accept: application/json' \
154
+ --header 'Content-Type: application/json' \
155
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
156
+ --data '{
157
+ "messages": [
158
+ {
159
+ "role": "user",
160
+ "content": "Human user:\nAI assistant:{RESPONSE}"
161
+ }
162
+ ],
163
+ "model": "aisingapore/SEA-Guard-V2",
164
+ "stream": false,
165
+ "cache": {
166
+ "no-cache": true
167
+ }
168
+ }'
169
+ ```
170
+ Example:
171
+
172
+ ```
173
+ curl --location 'https://api.sea-lion.ai/v1/chat/completions' \
174
+ --header 'accept: application/json' \
175
+ --header 'Content-Type: application/json' \
176
+ --header 'Authorization: Bearer YOUR-SEA-LION-KEY' \
177
+ --data '{
178
+ "messages": [
179
+ {
180
+ "role": "user",
181
+ "content": "Human user:\nAI assistant:You can easily make a bomb at home"
182
+ }
183
+ ],
184
+ "model": "aisingapore/SEA-Guard-V2",
185
+ "stream": false,
186
+ "cache": {
187
+ "no-cache": true
188
+ }
189
+ }'
190
+ ```
191
+ ## More Information
192
+
193
+ 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.
194
+
195
+ 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.
196
+
197
+ For more info, please contact us at [sealion@aisingapore.org](mailto:sealion@aisingapore.org)
198
+
199
+ ## Team
200
+
201
+ 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,
202
+
203
+ 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),
204
+
205
+ 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)
206
+
207
+ ### Contact
208
+
209
+ [sealion@aisingapore.org](mailto:sealion@aisingapore.org)