litellm - ✅(Solved) Fix [Feature]: Add support for proxy-converting `reasoning_effort` for `Vercel AI Gateway` [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25510Fetched 2026-04-11 06:13:40
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

PR fix notes

PR #25603: feat(vercel_ai_gateway): convert reasoning_effort to Vercel AI Gateway extra_body format

Description (problem / solution / changelog)

Automatically maps reasoning_effort to extra_body.reasoning = {effort, enabled: true} as required by Vercel AI Gateway. Adds reasoning_effort to supported params, 2 unit tests, and provider documentation.

Relevant issues

Fixes #25510

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

<!-- Include screenshots, screen recordings, or log output demonstrating that your changes work as expected. For bug fixes: show reproduction before the fix and passing behavior after. For new features: show the feature working end-to-end. For UI changes: include before/after screenshots. -->

Type

🆕 New Feature 📖 Documentation ✅ Test

Changes

  • litellm/llms/vercel_ai_gateway/chat/transformation.py

    • Added "reasoning_effort" to get_supported_openai_params()
    • In map_openai_params(), converts reasoning_effort to the Vercel AI Gateway-required format:
      { "reasoning": { "effort": "<value>", "enabled": true } }
  • tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.py

    • Added test_vercel_ai_gateway_reasoning_effort_mapping
    • Added test_vercel_ai_gateway_reasoning_effort_in_supported_params
  • docs/my-website/docs/providers/vercel_ai_gateway.md

    • Added ## Reasoning Effort section with usage example and expected output format

Note on Black formatting CI failure: The formatting check failure (334 files would be reformatted) is a pre-existing issue in BerriAI/litellm:main caused by a Black version mismatch — CI uses 24.8.0 while the repo uses 24.10.0. This PR's 3 changed files are correctly formatted and are not the cause of this failure.

Changed files

  • docs/my-website/docs/providers/vercel_ai_gateway.md (modified, +30/-0)
  • litellm/llms/vercel_ai_gateway/chat/transformation.py (modified, +11/-5)
  • tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.py (modified, +73/-26)

Code Example

"extra_body": {
  "reasoning": {
    "effort": "",
    "enabled": true
  }
}

---

"reasoning_effort": ""

---

"extra_body": {
  "reasoning": {
    "effort": "",
    "enabled": true
  }
}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

The Feature

The current Vercel AI Gateway provider in LiteLLM's proxy /chat/completions endpoint does not support converting reasoning_effort into the format required by Vercel AI Gateway:

"extra_body": {
  "reasoning": {
    "effort": "",
    "enabled": true
  }
}

It should convert:

"reasoning_effort": ""

into:

"extra_body": {
  "reasoning": {
    "effort": "",
    "enabled": true
  }
}

Motivation, pitch

At the moment, reasoning_effort cannot be handled through a unified proxy conversion flow for the Vercel AI Gateway provider. As a result, users need to manually write a provider-specific extra_body, which breaks consistency across providers and adds unnecessary integration overhead.

What part of LiteLLM is this about?

Proxy

LiteLLM is hiring a founding backend engineer, are you interested in joining us and shipping to all our users?

No

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Modify the LiteLLM proxy /chat/completions endpoint to convert reasoning_effort into the required Vercel AI Gateway format.

Guidance

  • Identify the current implementation of the /chat/completions endpoint in the LiteLLM proxy and locate where the reasoning_effort parameter is handled.
  • Update the endpoint to transform the reasoning_effort parameter into the extra_body format required by Vercel AI Gateway.
  • Verify that the updated endpoint correctly converts reasoning_effort and that it is properly passed to the Vercel AI Gateway.
  • Consider adding a default value for enabled as true in the reasoning object, as implied by the required format.

Example

// Example input
{
  "reasoning_effort": "value"
}

// Example output after conversion
{
  "extra_body": {
    "reasoning": {
      "effort": "value",
      "enabled":

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Feature]: Add support for proxy-converting `reasoning_effort` for `Vercel AI Gateway` [1 pull requests, 1 participants]