Skip to content

Cerebras

Rasmus Wulff Jensen edited this page May 20, 2026 · 1 revision

NuGet README

Features

  • AgentFactory (CerebrasAgentFactory)
  • AIToolsFactory integration (tools in AgentOptions.Tools)
  • OpenAI-compatible chat completions support

Package

dotnet add package AgentFrameworkToolkit.Cerebras

Quick start

CerebrasAgentFactory agentFactory = new("<apiKey>");
CerebrasAgent agent = agentFactory.CreateAgent(new AgentOptions
{
    Model = CerebrasChatModels.GptOss120B,
    Instructions = "You are a nice AI"
});

AgentResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);

Connection options

  • ApiKey (required)
  • Endpoint (optional, defaults to Cerebras)
  • NetworkTimeout
  • DefaultClientType
  • AdditionalOpenAIClientOptions

Dependency injection

builder.Services.AddCerebrasAgentFactory("<apiKey>");
builder.Services.AddCerebrasAgentFactory(new CerebrasConnection
{
    ApiKey = "<apiKey>",
    NetworkTimeout = TimeSpan.FromMinutes(5)
});

Notes

  • Cerebras currently uses the OpenAI Chat Completions style endpoint in this toolkit integration.
  • ClientType.ResponsesApi is not supported for Cerebras and will fail at runtime.
  • See AgentFactories for shared agent options and middleware.
  • See AIToolsFactory for tool creation and MCP support.

Clone this wiki locally