You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"model":"llama3","created_at":"2024-06-27T19:33:28.276246646Z","response":"Hello! It's nice to meet you. Is there something I can help you with, or would you like to chat?","done":true,"done_reason":"stop","context":[128006,882,128007,271,9906,0,128009,128006,78191,128007,271,9906,0,1102,596,6555,311,3449,499,13,2209,1070,2555,358,649,1520,499,449,11,477,1053,499,1093,311,6369,30,128009],"total_duration":16211714695,"load_duration":10832429646,"prompt_eval_count":12,"prompt_eval_duration":1136599000,"eval_count":26,"eval_duration":4196455000}
Traceback (most recent call last):
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/bin/garak", line 8, in <module> sys.exit(main())
^^^^^^
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/__main__.py", line 9, in main
cli.main(sys.argv[1:])
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/cli.py", line 486, in main
command.probewise_run(generator, probe_names, evaluator, buff_names)
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/command.py", line 212, in probewise_run
probewise_h.run(generator, probe_names, evaluator, buffs)
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/harnesses/probewise.py", line 106, in run
h.run(model, [probe], detectors, evaluator, announce_probe=False)
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/harnesses/base.py", line 93, in run
attempt_results = probe.probe(model)
^^^^^^^^^^^^^^^^^^
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/probes/base.py", line 204, in probe
attempts_completed = self._execute_all(attempts_todo)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/probes/base.py", line 182, in _execute_all
result = self._execute_attempt(this_attempt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/probes/base.py", line 145, in _execute_attempt
this_attempt.outputs = self.generator.generate(this_attempt.prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bruno/Researches/LLMAttacks/tools/garak-pip/garak_env/lib/python3.11/site-packages/garak/generators/base.py", line 130, in generate
assert isinstance(
^^^^^^^^^^^
AssertionError: _call_model must return a list
I tried with the stream set to true, but it didn't work either.
According to the log file, it appears that garak is unable to deserialize the json. By curl the json looks normal, but by garak it looks like it is returning the json as a byte string.
Hello!
I installed the latest version with the fix.
I managed to run garak. It finished the scan and generated the report. Apparently, the fix resolved the problem.
Thanks!
Hello!
I'm trying to scan an LLM in Ollama, but garak is unable to deserialize the json returned by the API.
Testing the connection to the Ollama and LLM llama3 endpoint.
curl -v https://<IP>/api/generate -H 'Content-Type: application/json' -d '{"model": "llama3","prompt": "Hello!","stream": false}'
the API returns the data in json successfully.
{"model":"llama3","created_at":"2024-06-27T19:33:28.276246646Z","response":"Hello! It's nice to meet you. Is there something I can help you with, or would you like to chat?","done":true,"done_reason":"stop","context":[128006,882,128007,271,9906,0,128009,128006,78191,128007,271,9906,0,1102,596,6555,311,3449,499,13,2209,1070,2555,358,649,1520,499,449,11,477,1053,499,1093,311,6369,30,128009],"total_duration":16211714695,"load_duration":10832429646,"prompt_eval_count":12,"prompt_eval_duration":1136599000,"eval_count":26,"eval_duration":4196455000}
Running a scan with garak on the same endpoint.
config.json file:
Command:
garak --model_type rest -G config.json --probes xss
Traceback:
I tried with the stream set to true, but it didn't work either.
According to the log file, it appears that garak is unable to deserialize the json. By curl the json looks normal, but by garak it looks like it is returning the json as a byte string.
Would anyone know how to resolve it?
Thanks!
The text was updated successfully, but these errors were encountered: