Repository navigation
feat(deepinfra): any reasoning_effort via DEEPINFRA_REASONING_EFFORT - #8
Merged
Merged
Conversation
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUAMdXo5VtMP489BvQgT8f
nhat-di
marked this pull request as ready for review
November 1, 2026 03:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The DeepInfra provider reads
DEEPINFRA_REASONING_EFFORTand sends it asextra_body.reasoning_effort, next toDEEPINFRA_SERVICE_TIER. An explicitextra_bodyvalue wins over the env var.Why
inspect_ai 0.3.142
GenerateConfig.reasoning_effortisLiteral[minimal, low, medium, high], and the--reasoning-effort/BENCH_REASONING_EFFORTCLI enum is low/medium/high. That makesxhigh,maxandnoneunsendable, and AA-parity Max HLE runs needxhigh/max.Behavior
extra_body, which the openai SDK merges over top-level params. So ifBENCH_REASONING_EFFORTis also set, the env value overrides it, and a warning is logged once per process. LeaveBENCH_REASONING_EFFORTunset.deepinfra/model in the process, including a DeepInfra-served grader. hle_250's default OpenRouter judge is unaffected.DEEPINFRA_STREAM=auto) also triggers on anextra_bodyeffort.extra_bodydict, becausemodel_copyis 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 reachingchat.completions.createcarriesextra_body.reasoning_effortand no top-level field.🤖 Generated with Claude Code
https://claude.ai/code/session_01RUAMdXo5VtMP489BvQgT8f