Skip to content

feat(deepinfra): any reasoning_effort via DEEPINFRA_REASONING_EFFORT - #8

Merged
nhat-di merged 2 commits into
mainfrom
deepinfra-reasoning-effort-env
Nov 1, 2026
Merged

nhat-di merged 2 commits into
mainfrom
deepinfra-reasoning-effort-env

Conversation

@nhat-di

@nhat-di nhat-di commented Nov 1, 2026

Copy link
Copy Markdown

What

The DeepInfra provider reads DEEPINFRA_REASONING_EFFORT and sends it as extra_body.reasoning_effort, next to DEEPINFRA_SERVICE_TIER. An explicit extra_body value wins over the env var.

Why

inspect_ai 0.3.142 GenerateConfig.reasoning_effort is Literal[minimal, low, medium, high], and the --reasoning-effort / BENCH_REASONING_EFFORT CLI enum is low/medium/high. That makes xhigh, max and none unsendable, and AA-parity Max HLE runs need xhigh/max.

Behavior

  • Env unset: the request is unchanged.
  • The env value goes in extra_body, which the openai SDK merges over top-level params. So if BENCH_REASONING_EFFORT is also set, the env value overrides it, and a warning is logged once per process. Leave BENCH_REASONING_EFFORT unset.
  • It applies to every deepinfra/ model in the process, including a DeepInfra-served grader. hle_250's default OpenRouter judge is unaffected.
  • Auto-streaming (DEEPINFRA_STREAM=auto) also triggers on an extra_body effort.
  • Fix: the service_tier path wrote into the caller's extra_body dict, because model_copy is shallow. The new code copies it.

Validation

  • pytest tests/test_deepinfra_provider.py -m 'not integration': 34 passed. New tests cover: unset adds nothing; max/xhigh/none/high forwarded; explicit extra_body wins and the caller's dict is untouched; combines with service_tier; conflict warns once; and the request reaching chat.completions.create carries extra_body.reasoning_effort and no top-level field.
  • ruff check, ruff format and mypy are clean on the touched files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RUAMdXo5VtMP489BvQgT8f

nhat-di and others added 2 commits November 1, 2026 03:11
inspect_ai's GenerateConfig.reasoning_effort only admits
minimal/low/medium/high, so xhigh/max/none could not be sent. The
provider now reads DEEPINFRA_REASONING_EFFORT and sends it in
extra_body, next to DEEPINFRA_SERVICE_TIER; an explicit extra_body
setting wins. Auto-streaming also triggers on it.

Also stop mutating the caller's extra_body dict (model_copy is
shallow), which the service_tier path did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RUAMdXo5VtMP489BvQgT8f
@nhat-di
nhat-di marked this pull request as ready for review November 1, 2026 03:14
@nhat-di
nhat-di merged commit f049568 into main Nov 1, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant