Root Package¶
The root package is intentionally small and benchmark-first.
Main imports:
BenchmarkSpecSliceSpecDatasetQuerySpecPromptVariantSpecParseSpecScoreSpecProjectSpecModelSpecPluginRegistryOrchestratorBenchmarkResultgenerate_config_report
Curated public package surface for the current Themis runtime.
BenchmarkResult ¶
Bases: ExperimentResult
Public result facade that speaks benchmark-native semantics.
Source code in themis/runtime/benchmark_result.py
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 | |
aggregate ¶
Aggregate score rows using benchmark-native summary fields.
Source code in themis/runtime/benchmark_result.py
paired_compare ¶
paired_compare(
*,
metric_id: str,
group_by: str = "slice_id",
baseline_model_id: str | None = None,
treatment_model_id: str | None = None,
p_value_correction: PValueCorrection | str = PValueCorrection.NONE,
) -> list[JSONDict]
Return paired comparisons by one benchmark grouping key.
Source code in themis/runtime/benchmark_result.py
persist_artifacts ¶
Persist a small aggregate bundle for operator handoff.
Source code in themis/runtime/benchmark_result.py
BenchmarkSpec ¶
Bases: SpecBase
Top-level benchmark configuration compiled into an execution plan.
Source code in themis/benchmark/specs.py
DatasetQuerySpec ¶
Bases: SpecBase
Declarative slice query and sampling controls for dataset providers.
Source code in themis/benchmark/query.py
ExecutionPolicySpec ¶
Bases: SpecBase
Retry, backoff, circuit-breaker, and concurrency controls for orchestration.
These settings live above provider SDK behavior. Engines are still responsible for classifying provider failures into stable retryable codes.
Source code in themis/specs/experiment.py
InferenceGridSpec ¶
Bases: SpecBase
Typed inference sweep over base params and scalar override grids.
Use this for temperature, top-p, or provider-extra sweeps while keeping unchanged parameter combinations resumable across runs.
Source code in themis/specs/experiment.py
expand ¶
Expand the base inference params over all configured overrides.
Source code in themis/specs/experiment.py
InferenceParamsSpec ¶
Bases: SpecBase
Sampling and response-shape settings forwarded to inference engines.
Source code in themis/specs/experiment.py
ModelSpec ¶
Bases: SpecBase
Configures one inference-engine target and its provider-specific extras.
Source code in themis/specs/foundational.py
Orchestrator ¶
Main facade that plans, executes, projects, and returns experiment results.
Source code in themis/orchestration/orchestrator.py
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 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 | |
db_manager
property
¶
Return the active backend-specific database manager for this orchestrator.
diff_specs ¶
diff_specs(
baseline: ExperimentSpec | BenchmarkSpec,
treatment: ExperimentSpec | BenchmarkSpec,
) -> RunDiff
Return a high-level diff between two experiment specifications.
Source code in themis/orchestration/orchestrator.py
estimate ¶
Return a best-effort work-item and token estimate for an experiment.
Source code in themis/orchestration/orchestrator.py
evaluate ¶
evaluate(
experiment: ExperimentSpec | BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> ExperimentResult | BenchmarkResult
Execute evaluation-stage work, reusing generation when possible.
Source code in themis/orchestration/orchestrator.py
export_evaluation_bundle ¶
Export only pending evaluation items for an experiment.
Source code in themis/orchestration/orchestrator.py
export_generation_bundle ¶
Export only pending generation items for an experiment.
Source code in themis/orchestration/orchestrator.py
from_project_file
classmethod
¶
from_project_file(
path: str,
*,
registry: PluginRegistry | None = None,
dataset_provider: DatasetProvider | None = None,
dataset_loader: DatasetLoader | None = None,
parallel_candidates: int = 5,
telemetry_bus: TelemetryBus | None = None,
storage_bundle: StorageBundle | None = None,
) -> Orchestrator
Load a project file, validate it, and build an orchestrator.
Source code in themis/orchestration/orchestrator.py
from_project_spec
classmethod
¶
from_project_spec(
project: ProjectSpec,
*,
registry: PluginRegistry | None = None,
dataset_provider: DatasetProvider | None = None,
dataset_loader: DatasetLoader | None = None,
parallel_candidates: int = 5,
telemetry_bus: TelemetryBus | None = None,
storage_bundle: StorageBundle | None = None,
) -> Orchestrator
Construct an orchestrator from a validated project specification.
Source code in themis/orchestration/orchestrator.py
generate ¶
generate(
experiment: ExperimentSpec | BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> ExperimentResult | BenchmarkResult
Execute only generation-stage work for one experiment.
Source code in themis/orchestration/orchestrator.py
get_run_progress ¶
Return the persisted progress snapshot for one known run.
import_candidates ¶
Import prebuilt generation artifacts into the current store.
Source code in themis/orchestration/orchestrator.py
import_evaluation_results ¶
import_evaluation_results(
bundle: EvaluationWorkBundle, trial_records: list[TrialRecord]
) -> ExperimentResult | BenchmarkResult
Import externally evaluated results for a previously exported bundle.
Source code in themis/orchestration/orchestrator.py
import_generation_results ¶
import_generation_results(
bundle: GenerationWorkBundle, trial_records: list[TrialRecord]
) -> ExperimentResult | BenchmarkResult
Import externally generated results for a previously exported bundle.
Source code in themis/orchestration/orchestrator.py
plan ¶
Build and persist a deterministic run manifest for one experiment.
Source code in themis/orchestration/orchestrator.py
resume ¶
resume(
run_id: str,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> RunHandle | ExperimentResult | BenchmarkResult
Refresh a persisted run and continue it when possible.
Source code in themis/orchestration/orchestrator.py
run ¶
run(
experiment: ExperimentSpec | BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> ExperimentResult | BenchmarkResult
Execute generation, transforms, and evaluations for one experiment.
Source code in themis/orchestration/orchestrator.py
run_benchmark ¶
run_benchmark(
benchmark: BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> BenchmarkResult
Compile and execute one benchmark specification.
Source code in themis/orchestration/orchestrator.py
submit ¶
submit(
experiment: ExperimentSpec | BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> RunHandle
Persist one run manifest and start execution if the backend is local.
Source code in themis/orchestration/orchestrator.py
transform ¶
transform(
experiment: ExperimentSpec | BenchmarkSpec,
*,
runtime: RuntimeContext | None = None,
progress: ProgressConfig | None = None,
) -> ExperimentResult | BenchmarkResult
Execute output transforms against existing generation candidates.
Source code in themis/orchestration/orchestrator.py
ParseSpec ¶
Bases: SpecBase
Named parse pipeline backed by one extractor chain.
Source code in themis/benchmark/specs.py
PluginRegistry ¶
Instance-scoped registry for protocol implementations and plugin metadata.
Source code in themis/registry/plugin_registry.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 | |
get_extractor ¶
Instantiate or return the registered extractor for name.
Source code in themis/registry/plugin_registry.py
get_extractor_registration ¶
Fetch extractor registration metadata for name.
Source code in themis/registry/plugin_registry.py
get_inference_engine ¶
Instantiate or return the registered inference engine for name.
Source code in themis/registry/plugin_registry.py
get_inference_engine_registration ¶
Fetch inference-engine registration metadata for name.
Source code in themis/registry/plugin_registry.py
get_judge ¶
Instantiate or return the registered judge service for name.
Source code in themis/registry/plugin_registry.py
get_metric ¶
Instantiate or return the registered metric for name.
get_metric_registration ¶
Fetch metric registration metadata for name.
Source code in themis/registry/plugin_registry.py
has_extractor ¶
has_inference_engine ¶
has_judge ¶
has_metric ¶
iter_hook_registrations ¶
Return hook registrations ordered by priority then registration order.
Source code in themis/registry/plugin_registry.py
iter_hooks ¶
Yield hook instances in the same order used by pipeline execution.
register_extractor ¶
register_extractor(
name: str,
factory: Callable[[], Extractor] | type[Extractor] | Extractor,
*,
version: str = "0.0.0",
plugin_api: str = "1.0",
) -> None
Register an extractor implementation.
Source code in themis/registry/plugin_registry.py
register_hook ¶
register_hook(
name: str,
hook: PipelineHook,
*,
priority: int = 100,
idempotent: bool = True,
) -> None
Register a pipeline hook and preserve deterministic ordering metadata.
Source code in themis/registry/plugin_registry.py
register_inference_engine ¶
register_inference_engine(
name: str,
factory: Callable[[], InferenceEngine]
| type[InferenceEngine]
| InferenceEngine,
*,
version: str = "0.0.0",
capabilities: EngineCapabilities | None = None,
plugin_api: str = "1.0",
prompt_token_estimator: PromptTokenEstimator | None = None,
) -> None
Register an inference engine implementation under a provider name.
Source code in themis/registry/plugin_registry.py
register_judge ¶
register_judge(
name: str,
factory: Callable[[], JudgeService] | type[JudgeService] | JudgeService,
*,
version: str = "0.0.0",
plugin_api: str = "1.0",
) -> None
Register a judge service implementation.
Source code in themis/registry/plugin_registry.py
register_metric ¶
register_metric(
name: str,
factory: Callable[[], Metric] | type[Metric] | Metric,
*,
version: str = "0.0.0",
plugin_api: str = "1.0",
) -> None
Register a metric implementation.
Source code in themis/registry/plugin_registry.py
PostgresBlobStorageSpec ¶
Bases: _StorageSpecBase
Postgres event/projection store plus local filesystem blob persistence.
Source code in themis/specs/experiment.py
ProjectSpec ¶
Bases: SpecBase
Shared project-level identity, storage defaults, and execution policy.
Keep this stable across related experiment runs so resume behavior and run manifests refer to the same storage and backend context.
Source code in themis/specs/experiment.py
PromptMessage ¶
Bases: BaseModel
One structured chat message in a prompt template.
Source code in themis/specs/experiment.py
PromptVariantSpec ¶
Bases: SpecBase
Structured prompt variant scoped to one family or benchmark workflow.
Source code in themis/benchmark/specs.py
ScoreSpec ¶
Bases: SpecBase
Named scoring pass over raw or parsed candidate outputs.
Source code in themis/benchmark/specs.py
SliceSpec ¶
Bases: SpecBase
One benchmark slice with dataset identity, queries, prompts, and scoring.
Source code in themis/benchmark/specs.py
SqliteBlobStorageSpec ¶
Bases: _StorageSpecBase
SQLite event/projection store plus local filesystem blob persistence.
Source code in themis/specs/experiment.py
generate_config_report ¶
generate_config_report(
config: object,
format: ConfigReportFormat | str = "markdown",
output: str | PathLike[str] | None = None,
*,
entrypoint: str | None = None,
verbosity: ConfigReportVerbosity = "default",
) -> str
Collect and render one nested configuration report.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
Root config object or config bundle to collect.
TYPE:
|
format
|
Output format name or enum accepted by the renderer registry.
TYPE:
|
output
|
Optional filesystem path where the rendered report should also be written.
TYPE:
|
entrypoint
|
Optional source label to record in the report header.
TYPE:
|
verbosity
|
Visibility level used to filter the collected document before rendering.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The rendered config report as a string, even when |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If no renderer is registered for the requested format. |
OSError
|
If |