autochecklist
autochecklist
¶
autochecklist: A library of checklist generation and scoring methods for LLM evaluation.
Checklist
¶
Bases: BaseModel
A collection of checklist items.
Source code in autochecklist/models.py
by_category()
¶
Group items by category, returning a dict of sub-checklists.
Items with category=None are placed under "ungrouped".
Key order matches the first occurrence of each category.
Source code in autochecklist/models.py
save(path)
¶
load(path)
classmethod
¶
to_text(numbered=True)
¶
Format checklist as text for prompts.
Source code in autochecklist/models.py
ChecklistItem
¶
Bases: BaseModel
A single checklist item (yes/no question).
Source code in autochecklist/models.py
Score
¶
Bases: BaseModel
Complete scoring result.
Source code in autochecklist/models.py
pass_rate
property
¶
Proportion of items answered 'yes'.
primary_score
property
¶
Returns whichever metric the pipeline designated as primary.
scaled_score_1_5
property
¶
Scale pass_rate to 1-5 range (InteractEval style).
Formula: score = pass_rate * 4 + 1 - pass_rate=0.0 → score=1.0 - pass_rate=0.5 → score=3.0 - pass_rate=1.0 → score=5.0
ItemScore
¶
Bases: BaseModel
Score for a single checklist item.
Source code in autochecklist/models.py
ChecklistItemAnswer
¶
ConfidenceLevel
¶
Bases: str, Enum
Confidence levels for normalized scoring (RocketEval-style).
Source code in autochecklist/models.py
GroupedScore
¶
Bases: BaseModel
Scoring result grouped by category (e.g., per-dimension scores).
Produced when scoring sub-checklists from Checklist.by_category().
Source code in autochecklist/models.py
per_group_pass_rates
property
¶
Pass rate for each category.
pass_rate
property
¶
Macro-averaged pass rate (each category weighted equally).
micro_pass_rate
property
¶
Micro-averaged pass rate (pooled across all items).
mean_score
property
¶
Mean of Score.primary_score across all categories.
flatten()
¶
Merge all sub-scores into a single Score.
Source code in autochecklist/models.py
DeductiveInput
¶
Bases: BaseModel
Input for deductive (dimension-based) generation (CheckEval, InteractEval).
Source code in autochecklist/models.py
FeedbackInput
¶
Bases: BaseModel
Input for feedback-based checklist generation.
Source code in autochecklist/models.py
InteractiveInput
¶
Bases: BaseModel
Input for interactive (think-aloud based) generation (InteractEval).
Source code in autochecklist/models.py
ChecklistResponse
¶
WeightedChecklistResponse
¶
CategorizedChecklistResponse
¶
Bases: BaseModel
LLM response schema for categorized checklist generation (OpenRubrics CRG).
Source code in autochecklist/models.py
GeneratedCategorizedQuestion
¶
Bases: GeneratedQuestion
A generated yes/no question with a category label.
Source code in autochecklist/models.py
DirectGenerator
¶
Bases: InstanceChecklistGenerator
Generate checklists using a prompt template + structured JSON output.
Can be configured via pipeline presets (built-in methods) or custom prompts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method_name
|
str
|
Pipeline preset name (e.g., "tick") or custom name. If a known preset, loads config from PIPELINE_PRESETS. |
'custom'
|
custom_prompt
|
Optional[Union[str, Path]]
|
Custom prompt template. Pass a Path to load from file, or a str for raw prompt text. Overrides preset template. |
None
|
response_schema
|
Optional[type]
|
Pydantic model for JSON validation. Default: ChecklistResponse. |
None
|
format_name
|
Optional[str]
|
Format prompt file name (e.g., "checklist"). Default from preset. |
None
|
max_items
|
int
|
Maximum checklist items to return. |
10
|
min_items
|
int
|
Minimum expected items. |
2
|
**kwargs
|
Any
|
Passed to InstanceChecklistGenerator (model, temperature, etc.) |
{}
|
Source code in autochecklist/generators/instance_level/direct.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
prompt_text
property
¶
The raw prompt template text.
generate(input, target=None, reference=None, history='', **kwargs)
¶
Generate checklist from input using template + structured output.
Automatically detects which placeholders the template needs and passes only those. This allows the same class to handle TICK (input only), RocketEval (input + reference + history), RLCF-direct (input + reference), etc.
Source code in autochecklist/generators/instance_level/direct.py
ContrastiveGenerator
¶
Bases: DirectGenerator
Generate checklists by comparing candidate responses (RLCF candidate modes).
Extends DirectGenerator with candidate auto-generation. Candidates are generated by smaller models and included in the prompt for contrastive analysis.
Two modes: - rlcf_candidate: input + reference + candidates - rlcf_candidates_only: input + candidates (no reference)
Source code in autochecklist/generators/instance_level/contrastive.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
generate(input, target=None, reference=None, candidates=None, **kwargs)
¶
Generate checklist from input + candidates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
The instruction/query |
required |
target
|
Optional[str]
|
Alias for reference |
None
|
reference
|
Optional[str]
|
Expert/reference target (optional for candidates_only) |
None
|
candidates
|
Optional[Union[List[str], Dict[str, str]]]
|
Candidate responses. Can be: - List[str]: multiple candidates (RLCF or listwise) - Dict with "chosen"/"rejected" keys (pairwise CRG) - None: auto-generated if candidate_models is set |
None
|
**kwargs
|
Any
|
Additional arguments |
{}
|
Source code in autochecklist/generators/instance_level/contrastive.py
InductiveGenerator
¶
Bases: CorpusChecklistGenerator
Generator that induces checklists from observations.
Takes a collection of evaluative observations (e.g., reviewer feedback, user complaints, quality notes, strengths/weaknesses) and generates a comprehensive yes/no checklist that addresses them.
The pipeline applies multiple refinement steps: - Deduplication (merge similar questions) - Tagging (filter for applicability) - Selection (beam search for diverse subset)
Source code in autochecklist/generators/corpus_level/inductive.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
generate(observations, domain='general responses', skip_dedup=False, skip_tagging=False, skip_selection=False, skip_unit_testing=True, references=None, verbose=False, **kwargs)
¶
Generate a checklist from observations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observations
|
List[str]
|
List of evaluative observation strings (feedback, review comments, quality notes, etc.) |
required |
domain
|
str
|
Domain description for the prompt |
'general responses'
|
skip_dedup
|
bool
|
Skip deduplication step |
False
|
skip_tagging
|
bool
|
Skip tagging/filtering step |
False
|
skip_selection
|
bool
|
Skip subset selection step |
False
|
skip_unit_testing
|
bool
|
Skip unit testing step (default True) |
True
|
references
|
Optional[List[str]]
|
Optional reference targets for unit testing |
None
|
verbose
|
bool
|
Print progress at each pipeline stage |
False
|
**kwargs
|
Any
|
Additional arguments |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Generated and refined Checklist |
Source code in autochecklist/generators/corpus_level/inductive.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
DeductiveGenerator
¶
Bases: CorpusChecklistGenerator
Generate checklists from evaluation dimension definitions.
CheckEval creates binary yes/no evaluation questions organized by dimension and sub-dimension. Questions can be provided as seeds or generated from dimension definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Optional[str]
|
OpenRouter model ID for generation |
None
|
augmentation_mode
|
str | AugmentationMode
|
One of seed, elaboration, or diversification |
SEED
|
task_type
|
str
|
Type of task being evaluated (e.g., "summarization", "dialog") |
'general'
|
Example
checkeval = DeductiveGenerator(model="openai/gpt-4o-mini") dimensions = [ ... DeductiveInput( ... name="coherence", ... definition="The response should maintain logical flow.", ... sub_dimensions=["Logical Flow", "Consistency"] ... ) ... ] checklist = checkeval.generate(dimensions=dimensions)
Source code in autochecklist/generators/corpus_level/deductive.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
method_name
property
¶
Return the method name for this generator.
generate(dimensions, seed_questions=None, augment=True, max_questions=None, apply_filtering=False, verbose=False, **kwargs)
¶
Generate a checklist from dimension definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimensions
|
List[DeductiveInput]
|
List of DeductiveInput with name, definition, sub_dimensions |
required |
seed_questions
|
Optional[Dict[str, Dict[str, List[str]]]]
|
Optional pre-defined questions by dimension/sub-aspect Format: {dimension: {sub_aspect: [questions]}} |
None
|
augment
|
bool
|
Whether to augment seed questions (default True) |
True
|
max_questions
|
Optional[int]
|
Maximum number of questions to include |
None
|
apply_filtering
|
bool
|
Whether to apply Tagger and Deduplicator refiners (default False) |
False
|
verbose
|
bool
|
Print progress at each stage (default False) |
False
|
**kwargs
|
Any
|
Additional parameters passed to generation |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with generated questions |
Source code in autochecklist/generators/corpus_level/deductive.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
generate_grouped(dimensions, **kwargs)
¶
Generate a checklist and split it by dimension category.
Convenience wrapper around generate().by_category().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimensions
|
List[DeductiveInput]
|
List of DeductiveInput with name, definition, sub_dimensions |
required |
**kwargs
|
Any
|
Additional arguments passed to generate() |
{}
|
Returns:
| Type | Description |
|---|---|
Dict[str, Checklist]
|
Dict mapping dimension name to sub-Checklist |
Source code in autochecklist/generators/corpus_level/deductive.py
AugmentationMode
¶
Bases: str, Enum
Augmentation modes for question generation.
Source code in autochecklist/generators/corpus_level/deductive.py
InteractiveGenerator
¶
Bases: CorpusChecklistGenerator
Generate checklists from interactive think-aloud attributes.
InteractEval takes pre-collected think-aloud attributes (considerations about evaluating a dimension) and transforms them through a 5-stage pipeline into a validated checklist of yes/no questions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Optional[str]
|
OpenRouter model ID for generation |
None
|
max_components
|
int
|
Maximum number of components to extract (default 5) |
5
|
Example
interacteval = InteractiveGenerator(model="openai/gpt-4o-mini") input = InteractiveInput( ... source="human_llm", ... dimension="coherence", ... attributes=["Check for logical flow", "Ensure consistency"], ... ) checklist = interacteval.generate( ... inputs=[input], ... rubric="Coherence measures the logical flow and consistency...", ... )
Source code in autochecklist/generators/corpus_level/interactive.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | |
method_name
property
¶
Return the method name for this generator.
generate(inputs, rubric='', max_questions=None, **kwargs)
¶
Generate a checklist from think-aloud attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
List[InteractiveInput]
|
List of InteractiveInput with attributes from human/LLM sources |
required |
rubric
|
str
|
Definition/rubric for the evaluation dimension |
''
|
max_questions
|
Optional[int]
|
Maximum number of questions to include |
None
|
**kwargs
|
Any
|
Additional parameters |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with generated questions |
Source code in autochecklist/generators/corpus_level/interactive.py
ChecklistGenerator
¶
Bases: ABC
Base class for all checklist generators.
Source code in autochecklist/generators/base.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
generation_level
abstractmethod
property
¶
Return 'instance' or 'corpus'.
method_name
abstractmethod
property
¶
Return the method name (e.g., 'tick', 'rlcf').
generate(**kwargs)
abstractmethod
¶
generate_stream(**kwargs)
¶
Stream checklist generation (for UI).
Default implementation just yields the final result. Override for true streaming support.
Source code in autochecklist/generators/base.py
InstanceChecklistGenerator
¶
Bases: ChecklistGenerator
Base for instance-level generators (one checklist per input).
Source code in autochecklist/generators/base.py
generate(input, target=None, reference=None, **kwargs)
abstractmethod
¶
Generate checklist for an input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
The input/query/instruction text |
required |
target
|
Optional[str]
|
Optional target response to evaluate |
None
|
reference
|
Optional[str]
|
Optional reference target for comparison |
None
|
**kwargs
|
Any
|
Method-specific arguments |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Generated Checklist |
Source code in autochecklist/generators/base.py
CorpusChecklistGenerator
¶
Bases: ChecklistGenerator
Base for corpus-level generators (one checklist for entire dataset).
Source code in autochecklist/generators/base.py
generate(inputs, **kwargs)
abstractmethod
¶
Generate checklist from corpus inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
List[Dict[str, Any]]
|
List of input items (feedback, dimensions, think-aloud, etc.) |
required |
**kwargs
|
Any
|
Method-specific arguments |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Generated Checklist |
Source code in autochecklist/generators/base.py
ChecklistScorer
¶
Configurable checklist scorer that supports batch and per-item modes.
Consolidates the former BatchScorer, ItemScorer, WeightedScorer, and NormalizedScorer into a single class. All three aggregate metrics (pass_rate, weighted_score, normalized_score) are always computed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
|
'batch'
|
capture_reasoning
|
bool
|
Item mode only — include per-item reasoning. |
False
|
use_logprobs
|
bool
|
Item mode only — use logprobs for confidence scoring. |
False
|
primary_metric
|
str
|
Which metric |
'pass'
|
custom_prompt
|
Optional[Union[str, Path]]
|
Override the default prompt template (str text or Path). |
None
|
model
|
Optional[str]
|
LLM model identifier. |
None
|
temperature
|
float
|
Sampling temperature. |
0.0
|
api_key
|
Optional[str]
|
Provider API key. |
None
|
provider
|
Optional[str]
|
LLM provider name. |
None
|
base_url
|
Optional[str]
|
Override base URL. |
None
|
client
|
Any
|
Pre-configured LLM client. |
None
|
api_format
|
Optional[str]
|
API format ( |
None
|
max_tokens
|
int
|
Maximum response tokens. |
2048
|
reasoning_effort
|
Optional[str]
|
Reasoning effort hint for supported models. |
None
|
Example
scorer = ChecklistScorer(mode="batch") score = scorer.score(checklist, target="The response text...") print(score.primary_score) # uses primary_metric
Source code in autochecklist/scorers/base.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | |
scoring_method
property
¶
Backward-compat scoring method string for Score metadata.
prompt_text
property
¶
The raw prompt template text.
score(checklist, target, input=None, **kwargs)
¶
Score a target response against a checklist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
The checklist to evaluate against. |
required |
target
|
str
|
The target text to score. |
required |
input
|
Optional[str]
|
Optional input/context (falls back to checklist.input). |
None
|
**kwargs
|
Any
|
Additional arguments (ignored). |
{}
|
Returns:
| Type | Description |
|---|---|
Score
|
Score object with item-level and all aggregate scores. |
Source code in autochecklist/scorers/base.py
score_batch(checklist, targets, inputs=None, **kwargs)
¶
Score multiple targets sequentially.
Source code in autochecklist/scorers/base.py
ChecklistRefiner
¶
Bases: ABC
Base class for all checklist refiners.
Refiners take a checklist and improve it through various operations: - Deduplication (merge similar questions) - Filtering (remove low-quality questions) - Selection (choose optimal subset) - Testing (validate discriminativeness)
Source code in autochecklist/refiners/base.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
refiner_name
abstractmethod
property
¶
Return the refiner name (e.g., 'deduplicator', 'tagger').
refine(checklist, **kwargs)
abstractmethod
¶
Deduplicator
¶
Bases: ChecklistRefiner
Refiner that merges semantically similar checklist questions.
Pipeline: 1. Compute embeddings for all questions 2. Build similarity graph (edge if cosine >= threshold) 3. Find connected components (clusters) 4. Keep isolated nodes (unique questions) as-is 5. Use LLM to merge multi-node clusters into single questions
Source code in autochecklist/refiners/deduplicator.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
refine(checklist, **kwargs)
¶
Deduplicate the checklist by merging similar questions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
Input checklist to deduplicate |
required |
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with similar questions merged |
Source code in autochecklist/refiners/deduplicator.py
Tagger
¶
Bases: ChecklistRefiner
Refiner that filters checklist items based on applicability and specificity.
Uses LLM (default: gpt-5-mini) with zero-shot CoT to classify each question: - Generally applicable: Can be answered Yes/No for any input (no N/A scenarios) - Section specific: Evaluates single aspect without cross-references
Source code in autochecklist/refiners/tagger.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
refine(checklist, **kwargs)
¶
Filter checklist items based on tagging criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
Input checklist to filter |
required |
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with only items that pass both criteria |
Source code in autochecklist/refiners/tagger.py
UnitTester
¶
Bases: ChecklistRefiner
Refiner that validates questions via unit test rewrites.
Pipeline: 1. For each question, find samples that pass (answer=Yes) 2. LLM rewrites each sample to fail the criterion 3. Score rewritten samples - should get "No" 4. Enforceability rate = proportion of rewrites correctly failing 5. Filter questions below threshold
Source code in autochecklist/refiners/unit_tester.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
refine(checklist, samples=None, sample_scores=None, raw_samples=None, **kwargs)
¶
Filter checklist based on LLM enforceability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
Input checklist to validate |
required |
samples
|
Optional[List[Dict[str, Any]]]
|
List of sample dicts with 'id' and 'text' keys |
None
|
sample_scores
|
Optional[Dict[str, Dict[str, str]]]
|
Dict mapping sample_id -> {question_id -> "Yes"/"No"} |
None
|
raw_samples
|
Optional[List[Dict[str, Any]]]
|
Samples to auto-score when sample_scores not provided. Each dict must have 'id' and 'text' keys. |
None
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with only enforceable questions |
Source code in autochecklist/refiners/unit_tester.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
Selector
¶
Bases: ChecklistRefiner
Refiner that selects optimal diverse subset via beam search.
Since we lack source feedback mapping, uses embedding diversity only. Beam search explores multiple candidate subsets to find optimal score.
Source code in autochecklist/refiners/selector.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
refine(checklist, **kwargs)
¶
Select optimal diverse subset of questions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
Input checklist to select from |
required |
Returns:
| Type | Description |
|---|---|
Checklist
|
Checklist with selected subset |
Source code in autochecklist/refiners/selector.py
ChecklistPipeline
¶
Chains: Generator → Refiners → Scorer.
A composable pipeline for checklist-based evaluation. Three construction modes:
- Preset:
ChecklistPipeline(from_preset="tick")— resolves generator AND auto-attaches the preset's default scorer. - Explicit components:
ChecklistPipeline(generator="tick", scorer="batch")— resolves each component by name. No auto scorer. - Pre-configured instances:
ChecklistPipeline(generator=my_gen, scorer=my_scorer)
The :func:pipeline factory is equivalent to mode 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
generator
|
Optional[Any]
|
Generator name string (e.g., |
None
|
refiners
|
Optional[List[Union[str, Any]]]
|
Optional list of refiner instances or name strings. |
None
|
scorer
|
Optional[Union[str, Any]]
|
Optional scorer instance or name string (e.g., |
None
|
generator_model
|
Optional[str]
|
Model for the generator (used when generator is a string). |
None
|
scorer_model
|
Optional[str]
|
Model for the scorer (used when scorer is a string). |
None
|
provider
|
Optional[str]
|
LLM provider ("openrouter", "openai", "vllm"). |
None
|
base_url
|
Optional[str]
|
Override base URL for the LLM provider. |
None
|
client
|
Any
|
Injected LLM client instance. |
None
|
api_key
|
Optional[str]
|
API key for the provider. |
None
|
api_format
|
Optional[str]
|
API format ("chat" or "responses"). |
None
|
generator_kwargs
|
Optional[Dict[str, Any]]
|
Extra kwargs passed to generator constructor. |
None
|
scorer_kwargs
|
Optional[Dict[str, Any]]
|
Extra kwargs passed to scorer constructor. |
None
|
from_preset
|
Optional[str]
|
Pipeline preset name (e.g., |
None
|
Example
pipe = ChecklistPipeline(from_preset="tick", ... generator_model="gpt-4o", scorer_model="gpt-4o-mini")
pipe = ChecklistPipeline(generator="tick", scorer="batch")
gen = DirectGenerator(method_name="tick", model="gpt-4o") pipe = ChecklistPipeline(generator=gen, scorer="batch")
Source code in autochecklist/pipeline.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 | |
is_instance_level
property
¶
Check if the generator is instance-level.
is_corpus_level
property
¶
Check if the generator is corpus-level.
__call__(input=None, target=None, **kwargs)
¶
Run the full pipeline: generate → refine → score.
For instance-level generators, pass input and target. For corpus-level generators, pass the appropriate inputs via kwargs (e.g., feedback=..., dimensions=...).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
Optional[str]
|
Input instruction/query (for instance-level) |
None
|
target
|
Optional[str]
|
Target response to evaluate (optional for generation-only) |
None
|
**kwargs
|
Any
|
Additional arguments passed to generator |
{}
|
Returns:
| Type | Description |
|---|---|
PipelineResult
|
PipelineResult with checklist and optional score |
Source code in autochecklist/pipeline.py
generate(input=None, **kwargs)
¶
Generate a checklist (without scoring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
Optional[str]
|
Input instruction/query (for instance-level) |
None
|
**kwargs
|
Any
|
Additional arguments for generator |
{}
|
Returns:
| Type | Description |
|---|---|
Checklist
|
Generated and refined checklist |
Source code in autochecklist/pipeline.py
refine(checklist)
¶
score(checklist, target, input=None)
¶
Score a target response against a checklist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checklist
|
Checklist
|
Checklist to evaluate against |
required |
target
|
str
|
Target response to score |
required |
input
|
Optional[str]
|
Optional input for context |
None
|
Returns:
| Type | Description |
|---|---|
Score
|
Score object |
Source code in autochecklist/pipeline.py
score_group(sub_checklists, target, input=None)
¶
Score a target against sub-checklists (one per category).
Typically used with checklist.by_category() output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_checklists
|
Dict[str, Checklist]
|
Dict mapping category name to sub-Checklist |
required |
target
|
str
|
Target response to score |
required |
input
|
Optional[str]
|
Optional input for context |
None
|
Returns:
| Type | Description |
|---|---|
GroupedScore
|
GroupedScore with per-category Score objects |
Source code in autochecklist/pipeline.py
score_batch(checklist, targets, inputs=None, show_progress=False, on_progress=None)
¶
Score multiple targets against a single checklist.
Source code in autochecklist/pipeline.py
generate_batch(data=None, inputs=None, show_progress=False, on_progress=None, output_path=None, overwrite=False)
¶
Generate checklists for a batch of inputs (no scoring).
Only works for instance-level generators (1:1 input → checklist). For corpus-level generators, call generator.generate() directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Optional[List[Dict[str, Any]]]
|
List of dicts with "input" key |
None
|
inputs
|
Optional[List[str]]
|
List of input strings (convenience alternative to data) |
None
|
show_progress
|
bool
|
Show progress bar |
False
|
on_progress
|
Optional[Callable[[int, int], None]]
|
Callback(completed, total) fired after each item |
None
|
output_path
|
Optional[str]
|
Path to JSONL file for incremental writes + resume |
None
|
overwrite
|
bool
|
If True, delete existing output_path before starting |
False
|
Returns:
| Type | Description |
|---|---|
List[Checklist]
|
List of Checklist objects |
Source code in autochecklist/pipeline.py
run_batch(data=None, checklist=None, inputs=None, targets=None, show_progress=False, on_progress=None, output_path=None, overwrite=False)
¶
Run batch evaluation on a corpus.
Can be called with either: 1. data: List of dicts with "input" and "target" keys 2. inputs + targets: Separate lists
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Optional[List[Dict[str, Any]]]
|
List of dicts with input/target pairs |
None
|
checklist
|
Optional[Checklist]
|
Optional shared checklist to use for all evaluations |
None
|
inputs
|
Optional[List[str]]
|
Optional list of inputs (alternative to data) |
None
|
targets
|
Optional[List[str]]
|
Optional list of targets (alternative to data) |
None
|
show_progress
|
bool
|
Show progress bar |
False
|
on_progress
|
Optional[Callable[[int, int], None]]
|
Optional callback |
None
|
output_path
|
Optional[str]
|
Path to JSONL file for incremental writes + resume |
None
|
overwrite
|
bool
|
If True, delete existing output_path before starting |
False
|
Returns:
| Type | Description |
|---|---|
BatchResult
|
BatchResult with scores and aggregated metrics |
Source code in autochecklist/pipeline.py
run_batch_from_file(path, checklist=None, input_key='input', target_key='target', show_progress=False)
¶
Run batch evaluation from a JSONL file.
Source code in autochecklist/pipeline.py
PipelineResult
dataclass
¶
Result from a single pipeline execution.
Attributes:
| Name | Type | Description |
|---|---|---|
checklist |
Checklist
|
Generated (and optionally refined) checklist |
score |
Optional[Score]
|
Score object if target was provided, None otherwise |
Source code in autochecklist/pipeline.py
BatchResult
dataclass
¶
Result from batch corpus evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
checklist |
Optional[Checklist]
|
The checklist used for evaluation (shared if provided, otherwise each score references its own checklist) |
scores |
List[Score]
|
List of Score objects, one per input |
data |
List[Dict[str, Any]]
|
Original input data |
checklists |
List[Checklist]
|
Individual checklists when not using shared checklist |
Source code in autochecklist/pipeline.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | |
macro_pass_rate
property
¶
Macro-averaged pass rate across all scored examples.
Computes pass_rate for each example independently, then averages. Each example contributes equally regardless of checklist size.
Example: If example A scores 2/4 (0.5) and example B scores 3/3 (1.0), macro_pass_rate = (0.5 + 1.0) / 2 = 0.75
micro_pass_rate
property
¶
Micro-averaged pass rate (DFPR: Decomposed Requirements Following Ratio).
Pools all checklist items across all examples into a single count. Examples with more checklist items have proportionally more influence.
Example: If example A scores 2/4 and example B scores 3/3, micro_pass_rate = (2 + 3) / (4 + 3) = 5/7 ≈ 0.714
mean_score
property
¶
Mean of Score.primary_score across all examples.
Respects each Score's primary_metric — averages weighted_score for weighted pipelines, normalized_score for normalized, pass_rate for pass.
per_category_pass_rates()
¶
Compute per-category pass rates for each example.
Uses the checklist(s) to map item IDs to categories, then computes pass rates per category for each scored example.
Returns:
| Type | Description |
|---|---|
List[Dict[str, float]]
|
List of dicts, one per example, mapping category -> pass_rate |
Source code in autochecklist/pipeline.py
to_dataframe()
¶
Export results to pandas DataFrame.
Source code in autochecklist/pipeline.py
to_jsonl(path)
¶
Export results to JSONL file.
Source code in autochecklist/pipeline.py
LLMClient
¶
Bases: Protocol
Protocol that all LLM providers must satisfy.
Returns OpenAI-format dicts everywhere so existing parsing code works unchanged regardless of provider.
Source code in autochecklist/providers/base.py
LLMHTTPClient
¶
HTTP client for OpenAI-compatible LLM APIs.
Works with OpenRouter, OpenAI, and vLLM server mode. Supports both Chat Completions and Responses API formats.
Source code in autochecklist/providers/http_client.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
close()
¶
chat_completion(model, messages, temperature=0.7, max_tokens=2048, **kwargs)
¶
Make a chat completion request.
For api_format="responses", translates to/from the Responses API format. Always returns normalized OpenAI Chat Completions format.
Source code in autochecklist/providers/http_client.py
chat_completion_stream(model, messages, **kwargs)
¶
Stream chat completion. Yields content chunks.
Source code in autochecklist/providers/http_client.py
get_logprobs(model, messages, **kwargs)
¶
Get Yes/No log probabilities for normalized scoring.
Returns dict with "yes" and "no" probability values.
Source code in autochecklist/providers/http_client.py
supports_logprobs(model)
¶
Check if a model supports logprobs.
vLLM and OpenAI always support logprobs. OpenRouter queries the /models endpoint.
Source code in autochecklist/providers/http_client.py
chat_completion_async(model, messages, temperature=0.7, max_tokens=2048, **kwargs)
async
¶
Async chat completion request.
Source code in autochecklist/providers/http_client.py
batch_completions(requests, concurrency=5, progress_callback=None)
¶
Process multiple requests concurrently (sync wrapper).
Source code in autochecklist/providers/http_client.py
VLLMOfflineClient
¶
Offline inference client using vLLM's Python API.
Loads a model once at init and reuses it for all calls. The model parameter in method signatures is ignored — the model is fixed at construction time.
Context manager is a no-op: the model stays loaded. This is critical
because existing code does with Client() as client: in tight loops.
Source code in autochecklist/providers/vllm_offline.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
chat_completion(model, messages, temperature=0.7, max_tokens=2048, **kwargs)
¶
Generate completion, returning OpenAI-format dict.
The model parameter is ignored — uses the model loaded at init.
Source code in autochecklist/providers/vllm_offline.py
get_logprobs(model, messages, **kwargs)
¶
Get Yes/No log probabilities.
Source code in autochecklist/providers/vllm_offline.py
supports_logprobs(model)
¶
batch_completions(requests, progress_callback=None)
¶
Process batch using vLLM's native batching.
Source code in autochecklist/providers/vllm_offline.py
configure(**kwargs)
¶
Update configuration.
Example
configure( openrouter_api_key="sk-...", generator_model=ModelConfig(model_id="anthropic/claude-3-sonnet") )
Source code in autochecklist/config.py
get_config()
¶
Get current configuration.
Source code in autochecklist/config.py
BatchScorer(**kwargs)
¶
Deprecated: use ChecklistScorer(mode='batch').
Source code in autochecklist/scorers/__init__.py
WeightedScorer(**kwargs)
¶
Deprecated: use ChecklistScorer(mode='item', primary_metric='weighted').
Source code in autochecklist/scorers/__init__.py
NormalizedScorer(**kwargs)
¶
Deprecated: use ChecklistScorer(mode='item', use_logprobs=True, primary_metric='normalized').
Source code in autochecklist/scorers/__init__.py
ItemScorer(**kwargs)
¶
Deprecated: use ChecklistScorer(mode='item', capture_reasoning=True).
Source code in autochecklist/scorers/__init__.py
get_client(provider='openrouter', base_url=None, api_key=None, model=None, api_format=None, **kwargs)
¶
Create an LLM client for the given provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
Provider name ("openrouter", "openai", "vllm") |
'openrouter'
|
base_url
|
Optional[str]
|
Override the default base URL. For vLLM, None means offline mode. |
None
|
api_key
|
Optional[str]
|
API key (resolved from env if not provided) |
None
|
model
|
Optional[str]
|
Model name (required for vLLM offline mode) |
None
|
api_format
|
Optional[str]
|
API format ("chat" or "responses"). Defaults to "responses" for OpenAI, "chat" for other providers. |
None
|
**kwargs
|
Any
|
Additional kwargs passed to the client constructor |
{}
|
Returns:
| Type | Description |
|---|---|
LLMClient
|
An LLMClient instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If provider is unknown or vLLM offline mode missing model |
Source code in autochecklist/providers/factory.py
list_generators()
¶
list_scorers()
¶
list_refiners()
¶
get_generator(name)
¶
get_scorer(name)
¶
get_refiner(name)
¶
register_generator(name)
¶
register_scorer(name)
¶
register_refiner(name)
¶
register_custom_generator(name, prompt_path)
¶
Register a custom generator from a .md prompt file.
Once registered, the generator can be used by name in pipeline() or get_generator().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the generator under |
required |
prompt_path
|
str
|
Path to .md file containing the prompt template |
required |
Example
register_custom_generator("my_eval", "prompts/my_eval.md") pipe = pipeline("my_eval")
Source code in autochecklist/registry.py
register_custom_scorer(name, prompt_path, mode='batch', primary_metric='pass', capture_reasoning=False)
¶
Register a custom scorer from a .md prompt file.
Creates a ChecklistScorer with the custom prompt. Once registered, the scorer can be used by name in pipeline() or get_scorer().
When primary_metric="normalized", logprobs are automatically enabled
(logprobs are required for confidence-calibrated scoring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the scorer under |
required |
prompt_path
|
str
|
Path to .md file containing the scoring prompt template |
required |
mode
|
str
|
Scoring mode — "batch" (all items in one call) or "item" (one item per call). Default: "batch". |
'batch'
|
primary_metric
|
str
|
Which metric |
'pass'
|
capture_reasoning
|
bool
|
Include per-item reasoning in output. |
False
|
Example
register_custom_scorer("strict", "prompts/strict_scorer.md") pipe = pipeline("tick", scorer="strict")
register_custom_scorer( ... "weighted_strict", "prompts/strict_scorer.md", ... mode="item", primary_metric="weighted", ... )
Source code in autochecklist/registry.py
register_custom_pipeline(name, pipeline=None, generator_prompt=None, generator_class='direct', scorer=None, scorer_mode=None, scorer_prompt=None, primary_metric=None, capture_reasoning=None, force=False)
¶
Register a custom pipeline as a reusable preset.
Can register from either an instantiated pipeline or from config values.
Once registered, the pipeline can be used by name:
pipeline("my_eval", generator_model="openai/gpt-4o")
When primary_metric="normalized", logprobs are automatically enabled
(logprobs are required for confidence-calibrated scoring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the pipeline under. |
required |
pipeline
|
Optional[Any]
|
An instantiated ChecklistPipeline to extract config from. Mutually exclusive with generator_prompt. |
None
|
generator_prompt
|
Optional[Union[str, Path]]
|
Custom generator prompt text, or Path to a prompt file. Mutually exclusive with pipeline. |
None
|
generator_class
|
str
|
Generator class to use ("direct" or "contrastive"). Only used with generator_prompt. Default: "direct". |
'direct'
|
scorer
|
Optional[str]
|
Deprecated scorer name (e.g., "batch", "weighted"). Use
|
None
|
scorer_mode
|
Optional[str]
|
Scoring mode — "batch" or "item". None means no default scorer is attached. |
None
|
scorer_prompt
|
Optional[Union[str, Path]]
|
Custom scorer prompt text, built-in name ("rlcf", "rocketeval"), or Path to a prompt file. None means use the default prompt for the mode. |
None
|
primary_metric
|
Optional[str]
|
Which metric |
None
|
capture_reasoning
|
Optional[bool]
|
Include per-item reasoning in output. |
None
|
force
|
bool
|
If True, allow overriding built-in pipelines (with a warning). |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If overriding a built-in name without force=True, if
neither pipeline nor generator_prompt is provided, or if both
|
Example
From config with scorer settings¶
register_custom_pipeline( ... "my_eval", ... generator_prompt="Generate yes/no questions for:\n\n{input}", ... scorer_mode="item", ... primary_metric="weighted", ... ) pipe = pipeline("my_eval", generator_model="openai/gpt-4o-mini")
From instantiated pipeline¶
pipe = ChecklistPipeline( ... generator=DirectGenerator(custom_prompt="...", model="gpt-4o-mini"), ... scorer=ChecklistScorer(mode="item", primary_metric="weighted", ... model="gpt-4o-mini"), ... ) register_custom_pipeline("my_eval", pipe)
Source code in autochecklist/registry.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | |
save_pipeline_config(name, path)
¶
Export a registered pipeline's config to JSON.
The saved JSON uses flat scorer config keys (scorer_mode,
primary_metric, capture_reasoning, scorer_prompt)
extracted from the DEFAULT_SCORERS entry.
Logprobs are auto-derived from primary_metric="normalized"
and not stored separately in the config.
In the output JSON:
scorer_mode:nullif no default scorer is configured.scorer_prompt:nullmeans use the default prompt for the mode.primary_metric:nulldefaults to"pass"when loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of a registered pipeline. |
required |
path
|
Union[str, Path]
|
Path to write the JSON config file. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the pipeline name is not registered. |
Source code in autochecklist/registry.py
load_pipeline_config(path, force=False)
¶
Load and register a pipeline from a JSON config file.
Supports both the new format (flat scorer config keys: scorer_mode,
primary_metric, etc.) and the old format (scorer name string +
scorer_prompt text).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, Path]
|
Path to the JSON config file. |
required |
force
|
bool
|
If True, allow overriding built-in pipelines. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
The pipeline name (for use with |