Skip to content

Conversation

CH-GAGANRAJ
Copy link
Contributor

Title

Fix OpenAI API call by removing internal parameters before request

Relevant issues

Fixes #14901

Pre-Submission checklist

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

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • 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

Type

🐛 Bug Fix

Changes

Code Change:

  • Added data.pop("extra_body", None) and data.pop("litellm_params", None) in make_openai_chat_completion_request function before making the OpenAI API call
  • This prevents internal LiteLLM parameters from being passed to the OpenAI API, which was causing "unknown parameter" errors

Tests:

  • I attempted to add tests but couldn't find clear patterns or appropriate locations for testing this specific fix in the current test structure
  • Would appreciate guidance from maintainers on where and how to add proper tests for this change

PR Description:
This PR fixes issue #14901 where internal LiteLLM parameters (extra_body and litellm_params) were being passed to the OpenAI API, causing "unknown parameter" errors. The solution removes these internal parameters from the request data before making the actual OpenAI API call, ensuring only valid OpenAI parameters are sent.

The fix is minimal and isolated - it only removes the problematic parameters at the point where the OpenAI API call is made, without affecting any other functionality.

Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Error Error Sep 25, 2025 5:27pm

@CLAassistant
Copy link

CLAassistant commented Sep 25, 2025

CLA assistant check
All committers have signed the CLA.

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.

[Bug]: 'litellm_params' passed to OpenAI API causing 'Unknown parameter' error, works fine with Vertex AI

2 participants