Class CerebrasClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
Cerebras's WSE-3 chip hosts inference at top-of-industry token
throughput — reportedly 1800+ tok/s on Llama 70B. The API is
OpenAI-compatible, so this client shares its wire format with
GroqClient / OpenRouterClient / NvidiaNIMClient.
Default base URL is https://api.cerebras.ai/v1; supply a
baseUrl parameter or set CEREBRAS_BASE_URL to route
through a mirror or proxy.
Supported models (at time of writing — Cerebras's catalog evolves quickly, check the live list at inference-docs.cerebras.ai):
- llama-3.3-70b — Llama 3.3 70B (flagship; the headline-throughput model)
- llama3.1-8b — Llama 3.1 8B (fastest)
- qwen-3-32b — Qwen 3 32B
Configuration via environment variables:
CEREBRAS_API_KEY— Required.CEREBRAS_BASE_URL— Optional override, defaults tohttps://api.cerebras.ai/v1.
Headline use case: latency-sensitive agent inner loops where the
sub-second roundtrip beats a 5× cheaper but 10× slower competitor —
tool-call loops in tnsai-coordination, REPL-style chat,
realtime UI agents.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCerebrasClient(String model) CerebrasClient(String model, float temperature) CerebrasClient(String model, float temperature, Float topP, Integer maxTokens) CerebrasClient(String model, float temperature, Integer maxTokens) CerebrasClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) CerebrasClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey) -
Method Summary
Methods inherited from class com.tnsai.llm.providers.AbstractOpenAICompatibleClient
chat, streamChatMethods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, getProviderName, listModels, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
CerebrasClient
-
CerebrasClient
-
CerebrasClient
-
CerebrasClient
-
CerebrasClient
-
CerebrasClient
-