Class CerebrasClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class CerebrasClient extends AbstractOpenAICompatibleClient
Cerebras LLM client.

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 to https://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 Details

    • CerebrasClient

      public CerebrasClient(String model)
    • CerebrasClient

      public CerebrasClient(String model, float temperature)
    • CerebrasClient

      public CerebrasClient(String model, float temperature, Integer maxTokens)
    • CerebrasClient

      public CerebrasClient(String model, float temperature, Float topP, Integer maxTokens)
    • CerebrasClient

      public CerebrasClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • CerebrasClient

      public CerebrasClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)