jpskill.com
🛠️ 開発・MCP コミュニティ

cerebras

世界最大のチップを活用した超高速LLM推論サービスCerebras InferenceのAPIを使い、リアルタイムチャットやコード補完など、最速の応答が求められるAI体験を開発者が実現できるよう支援するSkill。

📜 元の英語説明(参考)

Expert guidance for Cerebras Inference, the ultra-fast LLM inference service powered by the world's largest chip (Wafer-Scale Engine). Helps developers integrate Cerebras' API for applications requiring the fastest possible token generation — real-time chat, code completion, and interactive AI experiences.

🇯🇵 日本人クリエイター向け解説

一言でいうと

世界最大のチップを活用した超高速LLM推論サービスCerebras InferenceのAPIを使い、リアルタイムチャットやコード補完など、最速の応答が求められるAI体験を開発者が実現できるよう支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o cerebras.zip https://jpskill.com/download/14728.zip && unzip -o cerebras.zip && rm cerebras.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14728.zip -OutFile "$d\cerebras.zip"; Expand-Archive "$d\cerebras.zip" -DestinationPath $d -Force; ri "$d\cerebras.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して cerebras.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → cerebras フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Cerebras — ウェハスケール LLM 推論

概要

Cerebras Inferenceは、世界最大のチップ(ウェハスケールエンジン)を搭載した超高速LLM推論サービスです。開発者が、可能な限り最速のトークン生成を必要とするアプリケーション(リアルタイムチャット、コード補完、インタラクティブなAI体験など)のために、CerebrasのAPIを統合するのに役立ちます。

手順

チャット補完

// src/llm/cerebras.ts — Cerebras API (OpenAI互換)
import OpenAI from "openai";

const cerebras = new OpenAI({
  apiKey: process.env.CEREBRAS_API_KEY!,
  baseURL: "https://api.cerebras.ai/v1",
});

// 基本的な補完 — 最大2000+トークン/秒
async function chat(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",                // Cerebrasハードウェア上のLlama 3.3 70B
    messages: [
      { role: "system", content: "You are a helpful coding assistant." },
      { role: "user", content: prompt },
    ],
    temperature: 0.7,
    max_tokens: 1024,
    top_p: 1,
  });

  // レスポンスには、Cerebras固有の速度メトリクスを含む使用状況が含まれます
  console.log(`Tokens/sec: ${response.usage?.completion_tokens! / (response.usage as any).completion_time}`);

  return response.choices[0].message.content;
}

// ストリーミング — 最初のトークンが200ms未満
async function streamChat(prompt: string, onChunk: (text: string) => void) {
  const stream = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    stream: true,
  });

  let full = "";
  for await (const chunk of stream) {
    const text = chunk.choices[0]?.delta?.content ?? "";
    full += text;
    onChunk(text);
  }
  return full;
}

// JSONモード
async function structuredOutput(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    response_format: { type: "json_object" },
    temperature: 0,
  });
  return JSON.parse(response.choices[0].message.content!);
}

ツール使用 / 関数呼び出し

async function chatWithTools(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    tools: [
      {
        type: "function",
        function: {
          name: "get_stock_price",
          description: "Get the current stock price for a ticker symbol",
          parameters: {
            type: "object",
            properties: {
              ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" },
            },
            required: ["ticker"],
          },
        },
      },
    ],
    tool_choice: "auto",
  });

  const msg = response.choices[0].message;
  if (msg.tool_calls) {
    // ツールを実行し、結果を返送します
    const toolResults = await Promise.all(
      msg.tool_calls.map(async (call) => {
        const args = JSON.parse(call.function.arguments);
        const result = await executeFunction(call.function.name, args);
        return {
          role: "tool" as const,
          tool_call_id: call.id,
          content: JSON.stringify(result),
        };
      })
    );

    // ツール結果を含む最終的なレスポンスを取得します
    const final = await cerebras.chat.completions.create({
      model: "llama3.3-70b",
      messages: [
        { role: "user", content: prompt },
        msg,
        ...toolResults,
      ],
    });
    return final.choices[0].message.content;
  }

  return msg.content;
}

Python統合

# src/cerebras_client.py — PythonでのCerebras
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CEREBRAS_API_KEY"],
    base_url="https://api.cerebras.ai/v1",
)

# チャット補完
response = client.chat.completions.create(
    model="llama3.3-70b",
    messages=[{"role": "user", "content": "Write a Python quicksort implementation"}],
    temperature=0.3,
    max_tokens=500,
)
print(response.choices[0].message.content)

# ストリーミング
stream = client.chat.completions.create(
    model="llama3.3-70b",
    messages=[{"role": "user", "content": "Explain transformers in 5 sentences"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

利用可能なモデル

## Cerebrasモデル
- **llama3.3-70b** — Llama 3.3 70B、最高の品質、~2000 tok/sの出力
- **llama3.1-8b** — Llama 3.1 8B、最速のオプション、~2500+ tok/sの出力
- **llama3.1-70b** — Llama 3.1 70B、大きなコンテキスト (128Kトークン)

## 速度比較 (概算)
- Cerebras: 2000+ tok/s (70Bモデル)
- Groq: 300-400 tok/s (70Bモデル)
- クラウドGPU (A100): 50-80 tok/s (70Bモデル)
- ローカル (M3 Max): 20-40 tok/s (70B 量子化)

インストール

# OpenAI互換のSDKを使用してください
npm install openai
pip install openai

# base_urlをhttps://api.cerebras.ai/v1に設定します

例1: RAGアプリケーションの評価パイプラインのセットアップ

ユーザーリクエスト:

ドキュメントからの質問に答えるRAGチャットボットがあります。Cerebrasを設定して回答の品質を評価してください。

エージェントは、適切なメトリクス(忠実性、関連性、回答の正確性)を備えた評価スイートを作成し、実際のユーザーの質問からテストデータセットを構成し、ベースライン評価を実行し、プロンプトまたは検索の変更ごとに評価が実行されるようにCI統合を設定します。

例2: プロンプト間のモデルパフォーマンスの比較

ユーザーリクエスト:

顧客サポートのプロンプトでGPT-4oとClaudeをテストしています。Cerebrasで比較を設定してください。

エージェントは、既存のプロンプトセットを使用して構造化された実験を作成し、両方のモデルプロバイダーを構成し、顧客サポートに固有のスコアリング基準(正確性、トーン、完全性)を定義し、比較を実行し、統計的有意性指標を含むサマリーレポートを生成します。

ガイドライン

  1. レイテンシが重要なアプリケーションに使用する — Cerebrasは利用可能な最速の推論です。リアルタイムチャットや自動化に最適です。

(原文はここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Cerebras — Wafer-Scale LLM Inference

Overview

Cerebras Inference, the ultra-fast LLM inference service powered by the world's largest chip (Wafer-Scale Engine). Helps developers integrate Cerebras' API for applications requiring the fastest possible token generation — real-time chat, code completion, and interactive AI experiences.

Instructions

Chat Completions

// src/llm/cerebras.ts — Cerebras API (OpenAI-compatible)
import OpenAI from "openai";

const cerebras = new OpenAI({
  apiKey: process.env.CEREBRAS_API_KEY!,
  baseURL: "https://api.cerebras.ai/v1",
});

// Basic completion — up to 2000+ tokens/second
async function chat(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",                // Llama 3.3 70B on Cerebras hardware
    messages: [
      { role: "system", content: "You are a helpful coding assistant." },
      { role: "user", content: prompt },
    ],
    temperature: 0.7,
    max_tokens: 1024,
    top_p: 1,
  });

  // Response includes usage with Cerebras-specific speed metrics
  console.log(`Tokens/sec: ${response.usage?.completion_tokens! / (response.usage as any).completion_time}`);

  return response.choices[0].message.content;
}

// Streaming — first token in <200ms
async function streamChat(prompt: string, onChunk: (text: string) => void) {
  const stream = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    stream: true,
  });

  let full = "";
  for await (const chunk of stream) {
    const text = chunk.choices[0]?.delta?.content ?? "";
    full += text;
    onChunk(text);
  }
  return full;
}

// JSON mode
async function structuredOutput(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    response_format: { type: "json_object" },
    temperature: 0,
  });
  return JSON.parse(response.choices[0].message.content!);
}

Tool Use / Function Calling

async function chatWithTools(prompt: string) {
  const response = await cerebras.chat.completions.create({
    model: "llama3.3-70b",
    messages: [{ role: "user", content: prompt }],
    tools: [
      {
        type: "function",
        function: {
          name: "get_stock_price",
          description: "Get the current stock price for a ticker symbol",
          parameters: {
            type: "object",
            properties: {
              ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" },
            },
            required: ["ticker"],
          },
        },
      },
    ],
    tool_choice: "auto",
  });

  const msg = response.choices[0].message;
  if (msg.tool_calls) {
    // Execute the tool and send results back
    const toolResults = await Promise.all(
      msg.tool_calls.map(async (call) => {
        const args = JSON.parse(call.function.arguments);
        const result = await executeFunction(call.function.name, args);
        return {
          role: "tool" as const,
          tool_call_id: call.id,
          content: JSON.stringify(result),
        };
      })
    );

    // Get final response with tool results
    const final = await cerebras.chat.completions.create({
      model: "llama3.3-70b",
      messages: [
        { role: "user", content: prompt },
        msg,
        ...toolResults,
      ],
    });
    return final.choices[0].message.content;
  }

  return msg.content;
}

Python Integration

# src/cerebras_client.py — Cerebras with Python
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CEREBRAS_API_KEY"],
    base_url="https://api.cerebras.ai/v1",
)

# Chat completion
response = client.chat.completions.create(
    model="llama3.3-70b",
    messages=[{"role": "user", "content": "Write a Python quicksort implementation"}],
    temperature=0.3,
    max_tokens=500,
)
print(response.choices[0].message.content)

# Streaming
stream = client.chat.completions.create(
    model="llama3.3-70b",
    messages=[{"role": "user", "content": "Explain transformers in 5 sentences"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Available Models

## Cerebras Models
- **llama3.3-70b** — Llama 3.3 70B, best quality, ~2000 tok/s output
- **llama3.1-8b** — Llama 3.1 8B, fastest option, ~2500+ tok/s output
- **llama3.1-70b** — Llama 3.1 70B, large context (128K tokens)

## Speed Comparison (approximate)
- Cerebras: 2000+ tok/s (70B model)
- Groq: 300-400 tok/s (70B model)
- Cloud GPU (A100): 50-80 tok/s (70B model)
- Local (M3 Max): 20-40 tok/s (70B quantized)

Installation

# Use any OpenAI-compatible SDK
npm install openai
pip install openai

# Set base_url to https://api.cerebras.ai/v1

Examples

Example 1: Setting up an evaluation pipeline for a RAG application

User request:

I have a RAG chatbot that answers questions from our docs. Set up Cerebras to evaluate answer quality.

The agent creates an evaluation suite with appropriate metrics (faithfulness, relevance, answer correctness), configures test datasets from real user questions, runs baseline evaluations, and sets up CI integration so evaluations run on every prompt or retrieval change.

Example 2: Comparing model performance across prompts

User request:

We're testing GPT-4o vs Claude on our customer support prompts. Set up a comparison with Cerebras.

The agent creates a structured experiment with the existing prompt set, configures both model providers, defines scoring criteria specific to customer support (accuracy, tone, completeness), runs the comparison, and generates a summary report with statistical significance indicators.

Guidelines

  1. Use for latency-critical applications — Cerebras is the fastest inference available; ideal for real-time chat and autocomplete
  2. OpenAI SDK drop-in — Change base URL from OpenAI to Cerebras; your code works unchanged
  3. 8B for simple tasks — Use llama3.1-8b for classification, extraction, and simple Q&A; save 70B for complex reasoning
  4. Stream everything — First-token latency is <200ms; streaming gives users instant feedback
  5. JSON mode for structured output — Use response_format: { type: "json_object" } for reliable parsing
  6. Batch simple requests — For bulk processing, send multiple independent prompts in parallel
  7. Monitor rate limits — Free tier has request limits; check headers for remaining quota
  8. Fallback strategy — Have a fallback to Groq or OpenAI; Cerebras can have capacity constraints during high demand