Skip to content

feat(cerebras): add text completion support - #1738

Open
crossi-dev wants to merge 1 commit into
Portkey-AI:mainfrom
crossi-dev:feat/cerebras-text-completion
Open

feat(cerebras): add text completion support#1738
crossi-dev wants to merge 1 commit into
Portkey-AI:mainfrom
crossi-dev:feat/cerebras-text-completion

Conversation

@crossi-dev

Copy link
Copy Markdown

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 the complete function to /completions.
  • src/providers/cerebras/index.ts: register complete: completeParams(...) and add complete: true to the response transformers.

The excluded params (frequency_penalty, presence_penalty, logit_bias, best_of, n) are the ones the Cerebras /completions API 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 build compiles successfully and the two changed files type-check clean.

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>
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.

[Feature] TextCompletion for Cerebras Provider

1 participant