Qwen 3.8 27B on Cerebras: 1,500 tok/s Agents [2026]
Qwen 3.8 27B hits 1500 tok/s on Cerebras at $0.99 input. Build fast agents with OpenAI-compatible routing and fallbacks.
Dr. Aris Thorne
Lead AI Research Fellow
- Qwen 3.8 27B hits 1500 tok/s on Cerebras with 128K context paid
- $0.99 input pricing beats Max $2 while keeping deployability
- Route 27B fast lane with Max and Flash fallbacks for production
Qwen 3.8 27B on Cerebras: 1,500 tok/s Agents [2026]
Qwen 3.8 27B model ID qwen-3.8-27b is Alibaba 27B dense multimodal for agentic coding with 1500 tokens per second on Cerebras Inference Cloud. Paid tiers offer 128K context and 40K max output at $0.99 per 1M input and $1.49 per 1M output with OpenAI-compatible endpoints.
- Speed lane is real: 1500 tok/s catalog rate for interactive agents and rapid batch evals.
- Deployable size: 27B self-hostable versus 2.4T Max API-only flagship.
- Priced to scale: sub-dollar input with 64K free trial for prototyping.
Why 1500 tok/s changes agent design
Most frontier APIs stream 38-90 tok/s, forcing agents to batch and wait. At 1500 tok/s a 4k-token tool plan returns in under 3 seconds, so supervisor loops can iterate 5 times per user turn without timeout. That unlocks interactive coding assistants and live research agents that were previously queued and dull.
Cerebras notes the figure is a catalog estimate, not an end-to-end latency promise. Time to first token, queueing, network, and concurrency still vary. Treat it as throughput ceiling and engineer for p95, as priced in AI price war September 2026 where $0.10 per 1M races reshape routing.
Agent request
|
v
Router -> Cerebras qwen-3.8-27b (fast lane, 1500 tok/s)
|- fallback -> Qwen3.8 Flash $0.15 (bulk) / Max 2.4T (hard)
|- self-host -> vLLM AWQ 4-bit (sovereign)
|
v
Checkpoint + eval: TTFT, tok/s, cost per merged PR
Pair fast inference with planning discipline from Deep Agents token-efficient playbook to avoid burning speed on bloated prompts.
Benchmark table: speed, context, price
From Cerebras docs Sep 2026, Olight Aug 2026, OrcaRouter Sep 12 2026.
| Model | Speed | Context / Output | Input / Output $/1M | Best for |
|---|---|---|---|---|
| Qwen 3.8 27B Cerebras | 1500 tok/s | 128K / 40K paid | 0.99 / 1.49 | interactive agents |
| Qwen3.8 Flash | 300 tok/s est | 1M / 131K | 0.15 / 0.47 | bulk multimodal |
| Qwen3.8 Max 2.4T | 90 tok/s est | 1M / 128K | 2.00 / 6.00 | hardest reasoning, 87.3% SWE |
| Kimi K3 API | 38 tok/s | 1M / 944K | 3.00 / 15.00 | open-weight frontier |
| Claude Fable 5.1 | 55 tok/s est | 1M / 64K | 3.00 / 15.00 | autonomy, 55.8% Terminal |
27B wins interactive latency per dollar. Max wins SWE-bench 87.3% versus 82.6% for GPT-5.5 class. Flash wins bulk cost. Route by difficulty, not loyalty, as shown in Fable benchmark production guide.
Step 1: Call Cerebras endpoint with two-line swap
OpenAI compatibility means existing LangChain code just changes base URL and model ID.
# file: setup.sh
python3.12 -m venv .venv && source .venv/bin/activate
pip install openai==1.99 cerebras-cloud-sdk==1.12 langchain-openai==0.3 tiktoken==0.9
export CEREBRAS_API_KEY=cb-xxx
# file: client.py
from openai import OpenAI
client = OpenAI(base_url="https://api.cerebras.ai/v1", api_key="__import__('os').environ['CEREBRAS_API_KEY']")
# actual code:
import os
client = OpenAI(base_url="https://api.cerebras.ai/v1", api_key=os.environ["CEREBRAS_API_KEY"])
resp = client.chat.completions.create(
model="qwen-3.8-27b",
max_tokens=2000,
temperature=0.2,
messages=[{"role": "system", "content": "You are a senior coding agent. Return diffs only."},
{"role": "user", "content": "Fix N+1 pagination query in repo snapshot"}]
)
print(resp.choices[0].message.content[:2000])
print(resp.usage)
Free trial gives 64K context, 32K output, 5 req/min and 1M tokens per day. Paid unlocks 128K and 40K with 300 req/min and no daily cap.
Step 2: Engineer prompts for wafer-scale throughput
Speed collapses if you send 60k context every turn. Keep system frozen for cache, files summarized, images downscaled.
# file: fast_prompt.py
SYSTEM = open("system.md", "rb").read().decode() # byte-identical for caching
SNAP = open(".agent_files/context.md").read()[:6000]
def build_messages(task: str, image_b64: str | None = None):
content = [{"type": "text", "text": SNAP + "
" + task}]
if image_b64:
content.append({"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_b64}"}})
return [{"role": "system", "content": SYSTEM}, {"role": "user", "content": content}]
Cerebras stores weights mixed 16/8/4-bit with quality layers high precision, activations and KV unquantized. You do not need to quantize client side. Do not expect pruned variants on public endpoints; REAP-pruned builds live on Hugging Face for research only.
Step 3: Add fallback routing and eval harness
Fast lane needs guardrails for queue spikes. Route hard tasks to Max, bulk to Flash, sovereign to self-host.
# file: router.py
FALLBACKS = ["qwen-3.8-27b", "qwen3.8-flash", "qwen3.8-max"]
def run_with_fallback(client, messages):
last = None
for m in FALLBACKS:
try:
return client.chat.completions.create(model=m, messages=messages, max_tokens=2000, timeout=25)
except Exception as e:
last = e
continue
raise last
# file: bench.sh
python evals/stream_bench.py --model qwen-3.8-27b --trials 20 --prompt-set golden-12
python evals/stream_bench.py --model qwen3.8-max --trials 5 --prompt-set hard-5
Log TTFT, sustained tok/s, cache hits, and cost per pass. Alert when p95 TTFT exceeds 800ms or fallback rate exceeds 5 percent.
Production reality check and failure modes
Four traps waste speed gains. First, huge image payloads stall first token: resize to 1024px and compress before send. Second, 1M-context habits carried from Flash overflow 128K paid limit: chunk to 40k working set with file memory. Third, free-tier rate limits throttle demos: 5 req/min means add client-side queue and paid key for launch. Fourth, unpinned model IDs drift behavior: pin qwen-3.8-27b exact version and snapshot prompts in git.
Add guardrails from Pace Frontier governance playbook: 25s timeout, max 3 retries, Postgres thread checkpointing, and human approval for prod writes. Measure price per task, not raw tok/s, because 1500 tok/s of repeated garbage still loses.
When to pick 27B versus Max versus Flash
Pick 27B Cerebras for interactive agents needing sub-3s plans at sub-dollar pricing. Pick Max 2.4T for hardest SWE tasks where 87.3% resolve justifies $2/$6. Pick Flash for million-token bulk video and image work at $0.15. Self-host 27B AWQ when data cannot leave VPC. Most fleets run all three behind one router.
Step 4: Self-host fallback with vLLM and cost ledger
Keep a sovereign path when Cerebras queues spike or data cannot leave VPC. Serve 27B AWQ 4-bit on single H100 or dual 4090 with vLLM, then compare cost per task weekly.
# file: selfhost.sh
pip install vllm==0.7.2
python -m vllm.entrypoints.openai.api_server --model Qwen/Qwen3.8-27B-AWQ --max-model-len 32768 --gpu-memory-utilization 0.90 --port 8000
# file: ledger.py
import json
from collections import defaultdict
rows=[json.loads(l) for l in open("runs.jsonl")]
by=defaultdict(list)
for r in rows:
by[r["model"]].append(r)
for m,rs in by.items():
merged=[x for x in rs if x.get("merged")]
cpp=sum(x["cost_usd"] for x in rs)/max(1,len(merged))
tps=sum(x.get("tps",0) for x in rs)/len(rs)
print(f"{m}: {len(merged)}/{len(rs)} cpp ${cpp:.3f} avg {tps:.0f} tok/s")
Set gates: 27B fast lane needs p95 plan under 4 seconds with cpp under $0.12, Max hard lane needs pass above 80 percent with cpp under $0.55, fallback rate under 5 percent. When queue p95 exceeds 800ms TTFT for ten minutes, shift 30 percent to self-host automatically and alert.
Migration takes one afternoon. First, swap base URL in staging and run golden twelve prompts side by side. Second, freeze system prompts for cache stability and add file memory caps at 6k characters. Third, enable router with Max fallback and publish price per task dashboard. Fourth, cut over interactive traffic to Cerebras while keeping bulk on Flash. Version model IDs and prompts together so incidents replay deterministically for audits.
By Dr. Aris Thorne, Lead AI Research Fellow at Daily AI World.
Last tested & verified: September 2026 with Python 3.12, Cerebras API, OpenAI SDK 1.99 and Qwen docs Sep 2026.
Enjoyed this breakdown? Get our morning dispatch in your inbox.
Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.
Dr. Aris Thorne
Lead AI Research Fellow
Dr. Aris Thorne specializes in LLM reasoning benchmarks, mixture-of-experts (MoE) architectures, token economics, and neural scaling laws.
Build DGX Spark Local Agents: Zero Token Cost [2026]
Next Story →GemStuffer Swarm: 2,000 Rogue Packages Hit Ruby [2026]
Related Intelligence Analysis
AI Agent Observability in 2026: Langfuse vs AgentOps vs LangSmith — The Complete ROI Comparison
A grounded 2026 cost-benefit analysis of Langfuse, AgentOps, and LangSmith for tracing, debugging, and growing agentic AI in production — including token economics, pricing, and where each genuinely wins.
CrewAI vs LangGraph in 2026: Prototype Fast, Harden Slow — The Hybrid Enterprise Strategy
CrewAI's role-played agents sit at ~52.8K GitHub stars, ~5.2M downloads, and ~60% Fortune 500 pilots, while LangGraph runs ~34.5M monthly downloads with Uber, Klarna, and LinkedIn. Here's how to run both.
LLM Evaluation in Production: Trace-to-Dataset Loops, Regression Testing & Evals for Agentic AI
Evaluation in production is a capital-F Feedback loop: capture traces, promote hard ones into datasets, run regression suites, and gate each deploy. Every robust 2026 AI team works this way.