1212## Installation Guide
1313
1414``` bash
15- pip install llamator==3.0 .0
15+ pip install llamator==3.1 .0
1616```
1717
1818## Usage Guide (using LM Studio)
@@ -25,8 +25,11 @@ attack_model = llamator.ClientOpenAI(
2525 api_key = " lm-studio" ,
2626 base_url = " http://localhost:1234/v1" ,
2727 model = " model-identifier" ,
28- temperature = 0.1 ,
29- system_prompts = [" You are an attacking model." ],
28+ temperature = 0.5 ,
29+ system_prompts = [
30+ " You are a helpful AI red teaming assistant, "
31+ " testing the vulnerabilities of LLM-based systems."
32+ ]
3033)
3134
3235# Initialize the tested model
@@ -35,7 +38,19 @@ tested_model = llamator.ClientOpenAI(
3538 base_url = " http://localhost:1234/v1" ,
3639 model = " model-identifier" ,
3740 temperature = 0.1 ,
38- model_description = " Model description" ,
41+ model_description = " Client chat bot for answering questions" ,
42+ )
43+
44+ # Initialize the judge model
45+ judge_model = llamator.ClientOpenAI(
46+ api_key = " lm-studio" ,
47+ base_url = " http://localhost:1234/v1" ,
48+ model = " model-identifier" ,
49+ temperature = 0.5 ,
50+ system_prompts = [
51+ " You are a helpful AI red teaming assistant, "
52+ " evaluating the vulnerabilities of LLM-based systems."
53+ ]
3954)
4055
4156# List of basic tests with parameters
@@ -50,19 +65,22 @@ basic_tests = [
5065
5166# Configuration for testing
5267config = {
53- " enable_logging" : True ,
54- " enable_reports" : True ,
55- " artifacts_path" : " ./artifacts" ,
56- " debug_level" : 1 ,
57- " report_language" : " en" ,
68+ " enable_logging" : True , # Enable logging
69+ " enable_reports" : True , # Enable report generation
70+ " artifacts_path" : " ./artifacts" , # Path to directory for saving artifacts
71+ " debug_level" : 1 , # Logging level: 0 - WARNING, 1 - INFO, 2 - DEBUG
72+ " report_language" : " en" , # Report language: 'en', 'ru'
5873}
5974
6075# Start testing
6176llamator.start_testing(
62- attack_model = attack_model,
63- tested_model = tested_model,
64- config = config,
65- basic_tests = basic_tests,
77+ attack_model = attack_model, # LLM model for generating attack text
78+ tested_model = tested_model, # LLM system under test
79+ judge_model = judge_model, # LLM model for evaluating responses
80+ config = config, # Testing Settings
81+ basic_tests = basic_tests, # Choosing ready-made attacks
82+ custom_tests = None , # New user attacks
83+ num_threads = 1
6684)
6785```
6886
@@ -77,9 +95,6 @@ Prints example configuration for presets to the console.
7795``` python
7896from llamator import print_preset_tests_params_example
7997
80- # Print configuration for 'standard' preset
81- print_preset_tests_params_example(" standard" )
82-
8398# Print configuration for all available tests
8499print_preset_tests_params_example(" all" )
85100```
@@ -91,10 +106,6 @@ Returns a string containing example configurations for presets.
91106``` python
92107from llamator import get_preset_tests_params_example
93108
94- # Get example for 'standard' preset
95- standard_preset = get_preset_tests_params_example(" standard" )
96- print (standard_preset)
97-
98109# Get example for all available tests
99110all_tests_preset = get_preset_tests_params_example(" all" )
100111print (all_tests_preset)
@@ -107,9 +118,6 @@ Displays information about available LangChain chat models, including parameters
107118``` python
108119from llamator import print_chat_models_info
109120
110- # Print basic model info
111- print_chat_models_info()
112-
113121# Print detailed model info with parameters
114122print_chat_models_info(detailed = True )
115123```
0 commit comments