add initial Garak tests

This commit is contained in:
Adam Wilson
2025-05-03 12:00:18 -06:00
parent b1b145569d
commit 84f75af123
3 changed files with 26 additions and 2 deletions
+2 -2
View File
@@ -37,5 +37,5 @@ jobs:
nohup python -m tests.api.server > server.log 2>&1 &
sleep 2
curl -X POST -i localhost:9999 -d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' || true
cat server.log
garak --list_probes
garak -v --config ${{ github.workspace }}/tests/tools/garak.config.yml --generator_option_file ${{ github.workspace }}/tests/tools/garak.rest.json --model_type=rest
cat server.log
+5
View File
@@ -0,0 +1,5 @@
run:
generations: 1
plugins:
probe_spec: promptinject.HijackHateHumansMini
+19
View File
@@ -0,0 +1,19 @@
{
"rest": {
"RestGenerator": {
"name": "Microsoft ONNX Phi-3 LLM/GenAI REST API Service",
"uri": "http://localhost:9999/",
"method": "post",
"headers": {
"Content-Type": "application/json"
},
"req_template_json_object": {
"prompt": "$INPUT"
},
"response_json": true,
"response_json_field": "response",
"request_timeout": 120,
"verify_ssl": false
}
}
}