Bug: reasoning_effort sent to Groq API for models with reasoning: true, causing 400 error #2911

Closed
opened 2026-04-25 17:08:25 -05:00 by FbayDTU · 1 comment
FbayDTU commented 2026-04-25 17:08:25 -05:00 (Migrated from github.com)

When a Groq-hosted model has reasoning: true in its model config, Pi incorrectly sends a reasoning_effort parameter to Groq's API. Groq's API
rejects this with a 400 error:

  Error: 400 'reasoning_effort' : value is not one of the allowed values ['none','default','low','medium','high']                              

Root Cause:
In detectCompat(), the supportsReasoningEffort flag is set as:

  supportsReasoningEffort: !isGrok && !isZai,                                                                                                  

isGroq is correctly detected but not excluded from supportsReasoningEffort. This causes Pi to send its internal reasoning effort values (e.g.
minimal, xhigh) to Groq, which doesn't accept them.

Fix:

  // Before:                                                                                                                                   
  supportsReasoningEffort: !isGrok && !isZai,                                                                                                  
                                                                                                                                               
  // After:                                                                                                                                    
  supportsReasoningEffort: !isGrok && !isZai && !isGroq,                                                                                       

Workaround (for users):
Press Shift+Tab to cycle thinking level to off before using Groq models.

File: node_modules/@mariozechner/pi-ai/dist/providers/openai-completions.js

When a Groq-hosted model has reasoning: true in its model config, Pi incorrectly sends a reasoning_effort parameter to Groq's API. Groq's API rejects this with a 400 error: ``` Error: 400 'reasoning_effort' : value is not one of the allowed values ['none','default','low','medium','high'] ``` Root Cause: In detectCompat(), the supportsReasoningEffort flag is set as: ```js supportsReasoningEffort: !isGrok && !isZai, ``` isGroq is correctly detected but not excluded from supportsReasoningEffort. This causes Pi to send its internal reasoning effort values (e.g. minimal, xhigh) to Groq, which doesn't accept them. Fix: ```js // Before: supportsReasoningEffort: !isGrok && !isZai, // After: supportsReasoningEffort: !isGrok && !isZai && !isGroq, ``` Workaround (for users): Press Shift+Tab to cycle thinking level to off before using Groq models. File: node_modules/@mariozechner/pi-ai/dist/providers/openai-completions.js
lurch commented 2026-04-25 18:19:10 -05:00 (Migrated from github.com)

The issue you've described is nothing to do with Pico SDK; this repo is for software development with https://www.raspberrypi.com/products/raspberry-pi-pico/ and has nothing to do "Groq API".

The issue you've described is nothing to do with Pico SDK; this repo is for software development with https://www.raspberrypi.com/products/raspberry-pi-pico/ and has nothing to do "Groq API".
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#2911
No description provided.