feat(cerebras): add text completion support - #1738
Open
crossi-dev wants to merge 1 commit into
Open
Conversation
camerontaylor
added a commit
to camerontaylor/gateway
that referenced
this pull request
Jul 18, 2026
Backport four additive provider changes from upstream PRs (targeted at the 1.x main line) into our 2.0.0-based fork, hand-porting where our local additions (pricing configs, createModelResponse) caused context drift rather than real conflicts: - fireworks-ai: emit empty choices[] when a stream chunk has none, preventing stream-transform crashes (Portkey-AI#1727) - cerebras: add text-completion (/completions) support (Portkey-AI#1738) - openrouter: add image generation via /v1/images (Portkey-AI#1722) - requesty: new OpenAI-compatible router provider (Portkey-AI#1729) Skipped src/data/providers.json from the Requesty PR — it is control-plane metadata with no runtime references in src/. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1342
Cerebras was wired for chat completions only. This adds support for its text-completion (
/completions) endpoint, mirroring the existing pattern used by the Lambda and Nebius providers.Changes:
src/providers/cerebras/api.ts: route thecompletefunction to/completions.src/providers/cerebras/index.ts: registercomplete: completeParams(...)and addcomplete: trueto the response transformers.The excluded params (
frequency_penalty,presence_penalty,logit_bias,best_of,n) are the ones the Cerebras/completionsAPI does not accept, per their API reference. Supported params (logprobs,echo,stop,seed,top_p,temperature,max_tokens,user) are left in place.Verified locally:
npm run buildcompiles successfully and the two changed files type-check clean.