
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
@langchain/cerebras
Advanced tools
This package contains the LangChain.js integrations for Cerebras via the @cerebras/cerebras_cloud_sdk
package.
npm install @langchain/cerebras @langchain/core
This package adds support for Cerebras chat model inference.
Set the necessary environment variable (or pass it in via the constructor):
export CEREBRAS_API_KEY=
import { ChatCerebras } from "@langchain/cerebras";
import { HumanMessage } from "@langchain/core/messages";
const model = new ChatCerebras({
apiKey: process.env.CEREBRAS_API_KEY, // Default value.
});
const message = new HumanMessage("What color is the sky?");
const res = await model.invoke([message]);
To develop the @langchain/cerebras
package, you'll need to follow these instructions:
yarn install
yarn build
Or from the repo root:
yarn build --filter=@langchain/cerebras
Test files should live within a tests/
file in the src/
folder. Unit tests should end in .test.ts
and integration tests should
end in .int.test.ts
:
$ yarn test
$ yarn test:int
Run the linter & formatter to ensure your code is up to standard:
yarn lint && yarn format
If you add a new file to be exported, either import & re-export from src/index.ts
, or add it to the entrypoints
field in the config
variable located inside langchain.config.js
and run yarn build
to generate the new entrypoint.
FAQs
Cerebras integration for LangChain.js
The npm package @langchain/cerebras receives a total of 1,486 weekly downloads. As such, @langchain/cerebras popularity was classified as popular.
We found that @langchain/cerebras demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.