safety_settings doesn't work for Gemini #3287
MichaelZhangCN
started this conversation in
General
Replies: 1 comment 1 reply
-
in proxy mode, seems satety filter is not used in Proxy async completions |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I tested Gemini find the safety setting does't work.
This is the config.yaml file:
litellm_settings:
drop_params: True
set_verbose: False
vertex_project: ""
vertex_location: "us-central1"
general_settings:
master_key: sk-1234
model_list:
litellm_params:
model: vertex_ai/gemini-1.0-pro-001
temperature: 0.5
safety_settings:
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
litellm_params:
model: vertex_ai/gemini-1.0-pro-002
temperature: 0.5
safety_settings:
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
litellm_params:
model: vertex_ai/gemini-1.5-pro-preview-0409
temperature: 0.5
safety_settings:
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
threshold: BLOCK_ONLY_HIGH
And this is the curl command:
curl --location '/completions'
--header 'Authorization: Bearer sk-1234'
--header 'Content-Type: application/json'
--data '{
"model": "gemini-1.0-pro-001",
"prompt": "You are a language translation master with ten years of translation experience. You need to translate the content provided by the user as close as possible to the language habits of the English-speaking country according to the user'''s requirements. You should retain the original punctuation marks. The user has given reference terms. If the content involves terminology When using a word, you must refer to the correct translation of the word term. For other words that are not within the scope, you only need to output the translation result without any additional explanation or explanation.\n Content:到我这边来,不然你们都会被强风刮走的! Terminology:"
}'
This curl will return failure due to the safety filter of Gemini. But in Google Cloud Gemini console, when I set the safety filter to BLOCK FEW, it will return successfully.
I suspect the safety filter doesn't work when I use litellm
Beta Was this translation helpful? Give feedback.
All reactions