← Master Index
Vol. 22 Module 22.5 Lecture

Cerebras

AI Development Platforms

How This Lesson Fits the Module & Volume

Groq told the LPU speed story. Cerebras tells the wafer-scale story: giant chips historically used for training clusters, now also offered as Cerebras Inference (cloud API) for supported LLMs. Same engineering job as Together/Groq—rent fast tokens—different silicon and catalog. OpenRouter may list Cerebras as an upstream; you can also call Cerebras direct with an OpenAI-compatible client (Vol. 18 OpenAI SDK).

Module close: Perplexity (search product + Sonar API), which is not an inference chip. Hardware context: Vol. 18.3 GPU vs specialist ASICs—do not assume CUDA mental models transfer 1:1.

Learning Objectives

By the end of this lesson, students should be able to:

  • Describe Cerebras as wafer-scale silicon + inference (and historically training) cloud, not a chatbot brand.
  • Call Cerebras Inference with an OpenAI-compatible or official client.
  • Compare Cerebras vs Groq vs Together vs GPU self-host qualitatively.
  • Expect a curated model list (ports), not every Hub checkpoint.
  • Measure TTFT/tok-s on your prompts; refuse fake wafer benchmarks.
  • Know when GPU clusters (Vol. 18.4) still win for custom training.
Definition

Cerebras builds wafer-scale engines (WSE)—an entire silicon wafer as one accelerator—and sells systems plus cloud services. Cerebras Inference exposes supported LLMs over an API (often OpenAI-compatible). Older narrative is training supercomputers; newer student-facing product is fast inference SKUs. Cerebras is not Perplexity, not Groq, not Hugging Face, and not xAI.

Wafer-Scale vs GPU vs LPU

You do not need microarchitecture trivia to buy inference. You need: which models are offered, what the latency/quality trade looks like on your eval set, data residency, and price sheet. WSE marketing emphasizes on-chip memory and very high decode; Groq emphasizes LPU scheduling; Together emphasizes GPU fleets and catalog. All three still serve transformer weights. Custom training of a 70B+ model may still be a GPU-cluster or Cerebras training conversation—separate SKU from Inference API.

Pricing / Strengths / Weaknesses (Qualitative)

DimensionCerebras InferenceGroqCloudTogether / GPU cloudSelf-host GPUs
Pricing posturePer-token inference on WSE-hosted models; enterprise systems priced separately—confirm live cloud tablePer-token LPUPer-token or instance-hourCapex/opex GPUs
StrengthsSpeed-specialist inference; OpenAI-shaped API; distinctive silicon for very large memory stories; training heritage for orgs that need itAlso speed; often easy signupBroader model/fine-tune catalogFull control
WeaknessesCurated model list; fewer multimodal/video SKUs; availability/regions vary; not a search engine; speed ≠ closed-model qualityAlso curatedUsually not the tok/s headline (measure)Ops (Vol. 18.4)

Inference API

  • Chat completions
  • Pin model id
  • Same FastAPI wrap

Via OpenRouter

  • Prototype hop
  • Still log upstream
  • Direct for SLA later

Training systems

  • Not this lecture’s default buy
  • Different procurement
  • Vol. 18.4 cluster mindset

Pick Cerebras Inference when

  • Needed model is on their list
  • Interactive latency matters
  • You already like OpenAI clients
  • A/B vs Groq is in the test plan

Look elsewhere when

  • You need arbitrary HF checkpoints tomorrow
  • Diffusion/video (Replicate)
  • Search-with-citations (Perplexity)
  • Air-gapped GPU-only policy

Python: OpenAI-Compatible Cerebras Client

Official SDK and base URLs evolve. Pattern: env key, config model id, OpenAI client. Confirm current base_url in Cerebras cloud docs before a spike.

# cerebras_chat.py — confirm live base_url + model ids import os from openai import OpenAI client = OpenAI( api_key=os.environ["CEREBRAS_API_KEY"], base_url=os.environ.get("CEREBRAS_BASE_URL", "https://api.cerebras.ai/v1"), ) resp = client.chat.completions.create( model=os.environ.get("CEREBRAS_MODEL", "llama3.1-8b"), # teaching stand-in messages=[{"role": "user", "content": "One sentence: what is wafer-scale inference?"}], max_tokens=96, ) print(resp.choices[0].message.content) print(resp.usage)

Related Lectures

LectureRole
Groq / Together / OpenRouterInference peers / gateway
OpenAI SDK / GPU / Tier 5 clustersClient + hardware contrast
LatencyWhy you A/B silicon
Llama familyTypical hosted weights
PerplexityNext: search product, not a chip
Common Misconception

“Cerebras is only a training supercomputer; there is no API.” Inference cloud exists—confirm current product. Second: wafer-scale means every HF model runs. Third: Cerebras is Groq with a different logo. Fourth: tok/s from a keynote is your p95. Fifth: Cerebras Inference is Perplexity Sonar. Sixth: buying Inference includes unlimited on-prem WSE hardware.

Knowledge Check

  1. Short Answer: What silicon approach is Cerebras known for? Answer: Wafer-scale engines (WSE) — an accelerator the size of a wafer.
  2. True/False: Cerebras Inference is the same product as Perplexity.ai search. Answer: False.
  3. Multiple Choice: Client pattern is typically: (a) OpenAI-compatible API, (b) only Suno jobs, (c) only ComfyUI. Answer: (a).
  4. Short Answer: Name one qualitative peer for decode speed. Answer: Groq (or Together/GPU — Groq is the closest specialist).
  5. True/False: Every Hub checkpoint is guaranteed on Cerebras Inference. Answer: False — curated/ported list.
  6. Multiple Choice: Custom 70B training is usually: (a) a separate training/cluster decision, (b) a single chat.completions flag, (c) Udio. Answer: (a).
  7. Short Answer: Which Vol. 18 lecture covers GPUs as the default accelerator? Answer: GPU (18.3).
  8. True/False: Invent wafer tok/s benchmarks for the exam. Answer: False.
  9. Multiple Choice: OpenRouter may: (a) list Cerebras as an upstream, (b) replace silicon, (c) train WSE in the browser. Answer: (a).
  10. Short Answer: Next lecture in 22.5? Answer: Perplexity.

Key Takeaways

  • Cerebras = wafer-scale silicon; Inference API is the student-facing buy.
  • A/B vs Groq/Together on your prompts; curated catalogs on both specialists.
  • OpenAI-shaped clients; pin model ids; Vol. 18 wrap.
  • Training systems ≠ Inference SKU.
  • Next: Perplexity—search-grounded answers, not chips.
Trainer’s Guide

Lab: Architecture memo: voice-agent LLM hop—Groq vs Cerebras vs Together. Students must name eval metrics (TTFT, task success, cost sheet lookup) and one reason they might still pick a frontier model. Optional live call if keys exist. Grade: no fake tok/s tables, WSE vs LPU vs GPU distinguished correctly.

Recap: Cerebras is wafer-scale inference (and historically training), not a search brand. Last 22.5 vendor: Perplexity.