Skip to content

improvement: map max_completion_tokens to max_tokens for Groq and Cerebras#1633

Open
Jwrede wants to merge 1 commit into
Portkey-AI:mainfrom
Jwrede:fix/max-completion-tokens-groq-cerebras
Open

improvement: map max_completion_tokens to max_tokens for Groq and Cerebras#1633
Jwrede wants to merge 1 commit into
Portkey-AI:mainfrom
Jwrede:fix/max-completion-tokens-groq-cerebras

Conversation

@Jwrede
Copy link
Copy Markdown

@Jwrede Jwrede commented May 6, 2026

Description

  • Map max_completion_tokens to max_tokens for Groq and Cerebras providers
  • Groq and Cerebras APIs only understand max_tokens, not max_completion_tokens
  • This mapping is already done for Deepinfra, Fireworks, and many other providers

Closes #1341

Supersedes #1516 (stale since March, maintainer feedback unaddressed)

Changes

  • src/providers/groq/index.ts: Added max_completion_tokens entry to the existing extra params object
  • src/providers/cerebras/index.ts: Added third argument to chatCompleteParams() with max_completion_tokens mapping, using {} for defaultValues (per review feedback on feat: Add mapping for max_tokens for groq and cerebras #1516)

Tests Run

  • Build passes (npm run build)
  • Formatting passes (npm run format:check)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

…ebras

Groq and Cerebras APIs use max_tokens, not max_completion_tokens.
Other providers like Deepinfra and Fireworks already have this mapping.
Add it to Groq (via existing extra params) and Cerebras (using {} for
defaultValues per review feedback on Portkey-AI#1516).

Closes Portkey-AI#1341
@Jwrede
Copy link
Copy Markdown
Author

Jwrede commented May 13, 2026

Friendly ping @VisargD -- this has been open ~7 days. Commits are signed per repo requirements. Let me know if anything needs changing.

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.

max_tokens mapping question for GROQ and Cerebras

1 participant