litellm - ✅(Solved) Fix [Bug]: Groq rejects `provider_specific_fields` in assistant messages during multi-turn tool calling [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#25595Fetched 2026-04-12 13:24:47
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Error Message

Error fetching response: Error: litellm.BadRequestError: GroqException - {"error":{"message":"'messages.7' : for 'role:assistant' the following must be satisfied[{'messages.7' : property 'provider_specific_fields' is unsupported}]", "type":"invalid_request_error"}}

Root Cause

When using LiteLLM proxy with Groq models (groq/qwen/qwen3-32b) and MCP tool servers, the first tool-listing response works, but subsequent multi-turn messages fail because LiteLLM includes provider_specific_fields in the assistant message payload.

Fix Action

Fix / Workaround

Workaround attempted

PR fix notes

PR #25597: Fix/groq provider specific fields 25595

Description (problem / solution / changelog)

Relevant issues

Fixes #25595

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:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🐛 Bug Fix ✅ Test

Changes

  • Fix Groq assistant message sanitization by removing provider_specific_fields during _transform_messages
  • Add regression test for provider_specific_fields stripping in Groq message transformation
  • Resolve issue Fixes #25595

Changed files

  • litellm/llms/groq/chat/transformation.py (modified, +2/-0)
  • tests/llm_translation/test_groq.py (modified, +28/-0)
  • tests/test_litellm/llms/groq/chat/test_groq_chat_transformation.py (added, +31/-0)

Code Example

litellm_settings:
  drop_params: true
  num_retries: 3
  request_timeout: 120

---

additional_drop_params: ["messages[*].provider_specific_fields"]

---

### Error message


Error fetching response: Error: litellm.BadRequestError: GroqException -
{"error":{"message":"'messages.7' : for 'role:assistant' the following must be
satisfied[{'messages.7' : property 'provider_specific_fields' is unsupported}]",
"type":"invalid_request_error"}}
RAW_BUFFERClick to expand / collapse

Check for existing issues

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

What happened?

When using LiteLLM proxy with Groq models (groq/qwen/qwen3-32b) and MCP tool servers, the first tool-listing response works, but subsequent multi-turn messages fail because LiteLLM includes provider_specific_fields in the assistant message payload.

Groq's API is strict and rejects any unrecognized properties on messages, causing a BadRequestError.

The same MCP server and tools work perfectly when called directly through providers that tolerate extra fields (e.g., Anthropic Claude, Hermes).

LiteLLM config

litellm_settings:
  drop_params: true
  num_retries: 3
  request_timeout: 120

Note: drop_params: true is enabled but does not strip fields nested inside messages — it only drops top-level API parameters. This is confirmed by the docs: https://docs.litellm.ai/docs/completion/drop_params

Affected providers

  • Groq — confirmed (provider_specific_fields is unsupported)
  • Cohere — likely affected (see #24031 — similar pattern with index and name fields)
  • Mistral — likely affected (see #5521 in agno-agi/agno — strict tool schema validation)

Workaround attempted

Tried additional_drop_params but it only supports top-level params and tools[*] paths, not messages[*].provider_specific_fields.

Suggested fix

Option A: Strip provider_specific_fields from all messages before sending to non-OpenAI providers (similar to the approach in PR #24510 for Cohere).

Option B: Extend drop_params / additional_drop_params to support message-level field stripping, e.g.:

additional_drop_params: ["messages[*].provider_specific_fields"]

Related issues

  • #24031 — Cohere rejects index in tool_calls and name in tool results (same class of bug)
  • #15761 — Groq tool call failures with OSS models
  • #19849 — Groq qwen3-32b streaming + tools (fixed in v1.81.3+, but provider_specific_fields issue persists)
  • #11001 — Groq not working with LiteLLM tool definitions

Steps to Reproduce

  1. Configure LiteLLM proxy with a Groq model (e.g., groq/qwen/qwen3-32b)
  2. Connect an MCP server that exposes multiple tools
  3. Send a user message that triggers tool use (e.g., a query the model answers via MCP tools)
  4. The model lists available tools and begins reasoning (first response succeeds)
  5. On the follow-up turn (message index 7+), LiteLLM includes provider_specific_fields in the assistant message
  6. Groq rejects the request with invalid_request_error

Relevant log output

### Error message


Error fetching response: Error: litellm.BadRequestError: GroqException -
{"error":{"message":"'messages.7' : for 'role:assistant' the following must be
satisfied[{'messages.7' : property 'provider_specific_fields' is unsupported}]",
"type":"invalid_request_error"}}

What part of LiteLLM is this about?

Other

What LiteLLM version are you on ?

v1.83.3.rc.1

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Strip provider_specific_fields from messages before sending to non-OpenAI providers, such as Groq, to resolve the BadRequestError.

Guidance

  • Identify the providers that are strict about unrecognized properties in messages, such as Groq, Cohere, and Mistral, and ensure that provider_specific_fields is removed for these providers.
  • Consider implementing a solution similar to the approach in PR #24510 for Cohere, which strips specific fields from messages.
  • Extend the drop_params or additional_drop_params configuration to support message-level field stripping, using a syntax like additional_drop_params: ["messages[*].provider_specific_fields"].
  • Verify the fix by testing the LiteLLM proxy with the updated configuration and checking that subsequent multi-turn messages are successful.

Example

additional_drop_params: ["messages[*].provider_specific_fields"]

This configuration snippet demonstrates how to extend the additional_drop_params to support message-level field stripping.

Notes

The drop_params: true setting only drops top-level API parameters and does not strip fields nested inside messages. The proposed solutions aim to address this limitation.

Recommendation

Apply a workaround by stripping provider_specific_fields from messages before sending to non-OpenAI providers, as this is a more immediate solution that can be implemented without waiting for a potential update to the drop_params or additional_drop_params configuration.

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 [Bug]: Groq rejects `provider_specific_fields` in assistant messages during multi-turn tool calling [1 pull requests, 1 participants]