Skip to content

feat: Add mapping for max_tokens for groq and cerebras#1516

Open
tibisabau wants to merge 1 commit intoPortkey-AI:mainfrom
tibisabau:feat/map-max-tokens-groq-cerebras
Open

feat: Add mapping for max_tokens for groq and cerebras#1516
tibisabau wants to merge 1 commit intoPortkey-AI:mainfrom
tibisabau:feat/map-max-tokens-groq-cerebras

Conversation

@tibisabau
Copy link

Description:

  • Fixed max_completion_tokens parameter mapping for GROQ provider to map to max_tokens instead of max_completion_tokens
  • Fixed max_completion_tokens parameter mapping for Cerebras provider to map to max_tokens instead of max_completion_tokens
  • Aligned GROQ and Cerebras with other providers (Deepinfra, Fireworks, Ollama, Oracle, etc.) that already map max_completion_tokens to max_tokens
  • This ensures that when users send max_completion_tokens, it correctly maps to the provider's max_tokens parameter

Closes #1341.

The code in this pull request was generated by GitHub Copilot with the Claude Sonnet 4.5 model.

Tests Run/Test cases added:

  • Build verification: npm run build passes successfully
  • Code formatting: npm run format:check passes
  • Pre-push validation: npm run pre-push completes successfully
  • Unit tests: Created comprehensive test suite for max_completion_tokens mapping
    • tests/unit/providers/max-completion-tokens.test.ts - 11 tests passed
    • tests/unit/providers/parameter-transformation.test.ts - 12 tests passed
    • Total: 23 tests passed, 0 failed
  • Configuration verification: Both GROQ and Cerebras correctly map max_completion_tokens to max_tokens

Type of Change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

@tibisabau tibisabau changed the title Add mapping for max_tokens for groq and cerebras feat: Add mapping for max_tokens for groq and cerebras Feb 3, 2026
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