Provider
steerability.evaluation.provider
Inspect AI model provider over a steered SteeringPipeline.
as_inspect_model wraps a steered pipeline as a generation-only Inspect model. Every request flows
through pipeline.generate(): on the messages path prompts enter as structured chat messages, so
the pipeline owns chat templating and message-phase input controls fire exactly as in deployment;
tokenizers without a chat template evaluate through the text path instead. Concurrent Inspect
requests collate into batched pipeline calls through the lock-leader collator in batching.
The provider is generation-only by design. Logprob-based scoring (including prompt-logprob perplexity) is structurally unsupported, since a pipeline's decoding-time controls are not representable in teacher-forced likelihoods; tool calling and multimodal content are unsupported. Unsupported requests raise at admission with an actionable message.
MAPPED_FIELDS = frozenset({'max_tokens', 'stop_seqs', 'temperature', 'top_p', 'top_k', 'seed', 'num_choices', 'extra_body'})
module-attribute
POLICY_FIELDS = frozenset({'best_of', 'frequency_penalty', 'presence_penalty', 'logit_bias', 'response_schema', 'reasoning_effort', 'reasoning_tokens', 'reasoning_summary', 'reasoning_history', 'reasoning_mode', 'verbosity', 'effort', 'extra_headers', 'modalities'})
module-attribute
REFUSED_FIELDS = frozenset({'logprobs', 'top_logprobs', 'prompt_logprobs'})
module-attribute
RUNTIME_KWARGS_EXTRA_BODY_KEY = 'runtime_kwargs'
module-attribute
UPSTREAM_FIELDS = frozenset({'system_message', 'max_retries', 'timeout', 'attempt_timeout', 'stream_idle_timeout', 'max_connections', 'adaptive_connections', 'fallback_models', 'cache', 'cache_prompt', 'batch', 'parallel_tool_calls', 'internal_tools', 'max_tool_output'})
module-attribute
logger = logging.getLogger(__name__)
module-attribute
ProviderOptions
dataclass
Description of one steering-pipeline provider.
Both `InspectSuite.run` and `SteeringEval` accept it, so the two surfaces cannot drift.
Attributes:
runtime_kwargs: Static runtime kwargs applied to every dispatch. A `"call"`-scoped key
passes through unchanged; a `"row"`-scoped key's value is one row's value in the
consuming control's per-row form and is broadcast to every row; a key that no enabled
control declares is inert. Correct for catalog tasks whose datasets carry no steering
columns, and for any kwarg that is a property of the arm rather than the sample.
chat_template_kwargs: Forwarded to `apply_chat_template` on the messages path; must be
None when the tokenizer has no chat template.
max_batch_size: Collator dispatch ceiling; clamped to 1 when the pipeline does not
support batching.
default_max_tokens: Served through `ModelAPI.max_tokens()` when a request sets no
`max_tokens`.
reasoning_tags: `(open_tag, close_tag)` pair splitting each generation into a reasoning
part and an answer part, so scorers grade the answer only; None disables the split.
reasoning_opened_at_start: Whether the chat template's generation prompt already opened the
reasoning channel (some thinking-mode templates emit the open tag in the generation
prompt, as a `<think>
prompt tail). A close-only continuation splits into reasoning
and answer in either mode without the flag; the flag matters only for a continuation
carrying neither tag (reasoning truncated before the close), which is classified as
unclosed reasoning when set and as a plain answer otherwise.
reasoning_split: How the split locates the delimiters, resolved once against the pipeline
tokenizer."text"splits substrings on the decoded continuation;"tokens"splits the
continuation ids and decodes each segment;"auto"(default) picks"text"when both
tags surviveskip_special_tokens=Trueunder the tokenizer and"tokens"otherwise,
which is the mode that keeps delimiters encoded as special tokens from being stripped
before the split can see them.
on_unsupported_param:"raise"(default) rejects a request carrying aGenerateConfigparameter the pipeline surface cannot honor;"warn"warns once per parameter per
provider and ignores it. Silent dropping is not allowed.
seed_scope: How a seeded sampling dispatch maps a seed onto its items, forwarded topipeline.generate(). The default"dispatch"decodes a seeded batch in one pass on
the Hugging Face backend (the batch is reproducible as a whole);"item"derives a
seed per row and decodes rows one at a time. Under the collator per-item
reproducibility is already unattainable, so"item"` only serializes the batch without
protecting anything. Inert on the vLLM backends.
Source code in steerability/evaluation/provider.py
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 | |
chat_template_kwargs = None
class-attribute
instance-attribute
default_max_tokens = 1024
class-attribute
instance-attribute
max_batch_size = 8
class-attribute
instance-attribute
on_unsupported_param = 'raise'
class-attribute
instance-attribute
reasoning_opened_at_start = False
class-attribute
instance-attribute
reasoning_split = 'auto'
class-attribute
instance-attribute
reasoning_tags = DEFAULT_THINK_TAGS
class-attribute
instance-attribute
runtime_kwargs = field(default_factory=dict)
class-attribute
instance-attribute
seed_scope = 'dispatch'
class-attribute
instance-attribute
SteeringPipelineModelAPI
Bases: ModelAPI
Generation-only Inspect ModelAPI over an in-process steered SteeringPipeline.
Constructed through as_inspect_model; the registry call convention is accepted so
ModelName resolution works, but the provider cannot be built from a model name string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_name
|
str
|
Bare model name; Inspect renders the model as |
required |
base_url
|
str | None
|
Accepted for the registry call convention; unused. |
None
|
api_key
|
str | None
|
Accepted for the registry call convention; unused. |
None
|
api_key_vars
|
list[str]
|
Accepted for the registry call convention; unused. |
[]
|
config
|
GenerateConfig
|
Accepted for the registry call convention; per-request configs arrive at
|
GenerateConfig()
|
pipeline
|
SteeringPipeline | None
|
The steered |
None
|
options
|
ProviderOptions | None
|
Provider options; defaults to |
None
|
base_seed
|
int | None
|
Attached to sampling dispatches whose |
None
|
**model_args
|
Any
|
Accepted for the registry call convention; unused. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
TypeError
|
If |
Source code in steerability/evaluation/provider.py
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 | |
effective_max_batch
property
The collator's dispatch ceiling after the batching clamp.
inert_runtime_kwargs
property
Runtime kwargs delivered on either tier that no enabled control of the pipeline declares.
prompt_path
property
"messages" when the tokenizer has a chat template, "text" otherwise.
aclose()
async
Close the collator; further requests raise at admission.
Source code in steerability/evaluation/provider.py
545 546 547 | |
close()
Close the collator; further requests raise at admission.
Source code in steerability/evaluation/provider.py
541 542 543 | |
connection_key()
Each provider instance owns its connection pool.
Source code in steerability/evaluation/provider.py
525 526 527 | |
generate(input, tools, tool_choice, config)
async
Serve one Inspect request through the collated pipeline.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If the request supplies tools, tool messages, multimodal content, or logprob parameters. |
ValueError
|
If a |
RuntimeError
|
If the provider is closed. |
Source code in steerability/evaluation/provider.py
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 | |
is_auth_failure(ex)
The provider performs no authentication.
Source code in steerability/evaluation/provider.py
533 534 535 | |
max_connections()
Advertised concurrency; equals the effective batch ceiling so batches self-fill.
Source code in steerability/evaluation/provider.py
521 522 523 | |
max_tokens()
Default max_tokens filled by Inspect when a request sets none.
Source code in steerability/evaluation/provider.py
517 518 519 | |
should_retry(ex)
Provider failures are deterministic, never rate limits.
Source code in steerability/evaluation/provider.py
529 530 531 | |
tools_required()
The provider never requires tool definitions.
Source code in steerability/evaluation/provider.py
537 538 539 | |
as_inspect_model(pipeline, *, options=None, base_seed=None, model_name='steering-pipeline')
Wrap a steered SteeringPipeline as an Inspect Model.
The pipeline is an in-process object; the model is constructed directly rather than through
the string registry, and renders as steerability/<model_name>.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
SteeringPipeline
|
The steered pipeline to serve. |
required |
options
|
ProviderOptions | None
|
Provider options; defaults to |
None
|
base_seed
|
int | None
|
Attached to sampling dispatches whose |
None
|
model_name
|
str
|
Bare model name for logs and rendering. |
'steering-pipeline'
|
Returns:
| Type | Description |
|---|---|
Model
|
An |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the pipeline is not steered. |
TypeError
|
If |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If the tokenizer has no chat template, so prompts render to plain text and
|
Source code in steerability/evaluation/provider.py
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 | |