registry
registry
¶
Component registry for dynamic discovery and instantiation.
This module provides a registry system for generators, scorers, and refiners that enables: - UI discovery: List available components for dropdown menus - Config-driven instantiation: Create components from string names - Custom extensions: Register user-defined components
Example
from autochecklist import list_generators, get_generator print(list_generators()) # ['tick', 'rlcf_direct', 'rocketeval', ...] gen_cls = get_generator("tick") generator = gen_cls(model="openai/gpt-4o-mini")
register_generator(name)
¶
register_scorer(name)
¶
register_refiner(name)
¶
list_generators()
¶
list_scorers()
¶
list_refiners()
¶
get_generator(name)
¶
get_scorer(name)
¶
get_refiner(name)
¶
get_generator_info(name)
¶
Get generator metadata for UI display.
Source code in autochecklist/registry.py
get_scorer_info(name)
¶
Get scorer metadata for UI display.
Source code in autochecklist/registry.py
get_refiner_info(name)
¶
Get refiner metadata for UI display.
list_generators_with_info()
¶
list_scorers_with_info()
¶
list_refiners_with_info()
¶
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 |