View as Markdown
Cerebras icon

Cerebras ACTION

Create Completion

Create a completion with Cerebras AI. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Cerebras account once, then configure and run Create Completion from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "cerebras-create-completion",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    cerebras: { authProvisionId: "apn_xxxxxxx" },
    model: "Model",
    prompt: "Prompt",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Completion inputs
Property Type Description
model Model string
The model to use for the request
Required Dynamic
prompt Prompt string
The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays
Required
stream Stream boolean
If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available
Optional
returnRawTokens Return Raw Tokens boolean
Return raw tokens instead of text
Optional
maxTokens Max Tokens integer
The maximum number of tokens that can be generated in the completion. The total length of input tokens and generated tokens is limited by the model's context length
Optional
minTokens Min Tokens integer
The minimum number of tokens to generate for a completion. If not specified or set to 0, the model will generate as many tokens as it deems necessary. Setting to -1 sets to max sequence length
Optional
seed Seed integer
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result
Optional
stop Stop string
Up to 4 sequences, separated by commas, where the API will stop generating further tokens. The returned text will not contain the stop sequence
Optional
temperature Temperature string
What sampling temperature to use, between 0 and 1.5. Higher values (e.g., 0.8) will make the output more random, while lower values (e.g., 0.2) will make it more focused and deterministic
Optional
topP Top P string
An alternative to sampling with temperature, called nucleus sampling, where the model considers the tokens with top_p probability mass
Optional
echo Echo boolean
Echo back the prompt in addition to the completion. Incompatible with return_raw_tokens=True
Optional
user User string
A unique identifier representing your end-user, which can help Cerebras to monitor and detect abuse
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
cerebras-create-completion
Version
0.0.2
App
Cerebras
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes