jpskill.com
💼 ビジネス コミュニティ

weave

Weights & Biasesの軽量ツールWeaveのエキスパートとして、AIアプリケーションの追跡・評価を支援し、LLMの呼び出し追跡、出力評価、モデル比較、実験管理、AIパイプラインのデバッグなどを、自動ロギングと可視化ダッシュボードで実現するSkill。

📜 元の英語説明(参考)

You are an expert in Weave, the lightweight toolkit by Weights & Biases for tracking and evaluating AI applications. You help developers trace LLM calls, evaluate outputs, compare model versions, track experiments, and debug AI pipelines — with automatic logging via decorators and a visual dashboard for exploring traces, costs, and quality metrics.

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

一言でいうと

Weights & Biasesの軽量ツールWeaveのエキスパートとして、AIアプリケーションの追跡・評価を支援し、LLMの呼び出し追跡、出力評価、モデル比較、実験管理、AIパイプラインのデバッグなどを、自動ロギングと可視化ダッシュボードで実現するSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して weave.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → weave フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Weave — Weights & Biases による AI アプリケーションのトラッキング

Weave は、Weights & Biases が提供する、AI アプリケーションのトラッキングと評価のための軽量なツールキットです。あなたは Weave のエキスパートとして、開発者が LLM の呼び出しをトレースし、出力を評価し、モデルのバージョンを比較し、実験を追跡し、AI パイプラインをデバッグするのを支援します。デコレータによる自動ロギングと、トレース、コスト、品質メトリクスを探索するためのビジュアルダッシュボードが利用可能です。

主要な機能

自動トレース

import weave
import openai

weave.init("my-ai-project")               # プロジェクト名で初期化

client = openai.OpenAI()

# OpenAI の呼び出しは自動的にトレースされます
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Explain transformers"}],
)
# Weave は、モデル、トークン、レイテンシ、コスト、入力/出力をキャプチャし、ダッシュボードで表示できます

# カスタム関数のトレース
@weave.op()
def extract_entities(text: str) -> list[str]:
    """テキストから固有表現を抽出します。"""
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"Extract entities from: {text}\nReturn JSON list."}],
    )
    return json.loads(response.choices[0].message.content)

@weave.op()
def rag_pipeline(query: str) -> str:
    """完全な RAG パイプライン — 各ステップは子スパンとしてトレースされます。"""
    docs = retrieve_documents(query)       # デコレートされていればトレースされます
    context = "\n".join(docs)
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": f"Answer using:\n{context}"},
            {"role": "user", "content": query},
        ],
    )
    return response.choices[0].message.content

評価

# 評価データセットを定義します
eval_dataset = [
    {"query": "What is Python?", "expected": "programming language"},
    {"query": "Who created Linux?", "expected": "Linus Torvalds"},
    {"query": "What is Docker?", "expected": "containerization platform"},
]

# スコアリング関数を定義します
@weave.op()
def relevance_scorer(output: str, expected: str) -> dict:
    """出力に期待される情報が含まれているかどうかをスコアリングします。"""
    contains = expected.lower() in output.lower()
    return {"relevance": 1.0 if contains else 0.0}

@weave.op()
def length_scorer(output: str) -> dict:
    """応答の長さをスコアリングします(簡潔な方が望ましい)。"""
    words = len(output.split())
    return {"conciseness": min(1.0, 50 / max(words, 1))}

# 評価を実行します
evaluation = weave.Evaluation(
    dataset=eval_dataset,
    scorers=[relevance_scorer, length_scorer],
)

results = await evaluation.evaluate(rag_pipeline)
# 結果は Weave ダッシュボードで、例ごとのスコアとともに表示されます
# モデルのバージョン、プロンプト、パラメータを比較します

モデルのバージョン管理

# モデル/プロンプトのバージョンを追跡します
class SupportAgent(weave.Model):
    model_name: str = "gpt-4o"
    system_prompt: str = "You are a helpful support agent."
    temperature: float = 0.7

    @weave.op()
    def predict(self, query: str) -> str:
        response = client.chat.completions.create(
            model=self.model_name,
            temperature=self.temperature,
            messages=[
                {"role": "system", "content": self.system_prompt},
                {"role": "user", "content": query},
            ],
        )
        return response.choices[0].message.content

# バージョン 1
agent_v1 = SupportAgent(system_prompt="Be concise and helpful.")

# バージョン 2 — ダッシュボードで比較します
agent_v2 = SupportAgent(model_name="gpt-4o-mini", system_prompt="Be detailed and empathetic.")

# 両方のバージョンを評価します
for agent in [agent_v1, agent_v2]:
    await evaluation.evaluate(agent)
# ダッシュボードには、品質、コスト、レイテンシの並列比較が表示されます

インストール

pip install weave
# W&B アカウントを使用します — WANDB_API_KEY を設定してください

ベストプラクティス

  1. @weave.op() デコレータ — トレースする関数に追加します。ネストされた呼び出しに対して階層的なスパンを作成します
  2. 自動インストルメンテーション — OpenAI、Anthropic、LangChain の呼び出しは、weave.init() の後に自動的にトレースされます
  3. 評価 — データセットとスコアラーを定義します。体系的に実行します。ダッシュボードでバージョンを比較します
  4. weave.Model — バージョン管理されたモデルのサブクラスです。パラメータは追跡され、評価間で比較可能です
  5. W&B 統合 — Weave のデータは W&B ワークスペースに表示されます。チームと共有し、レポートに追加します
  6. コスト追跡 — 呼び出しごとのコストを自動的に計算します。関数、モデル、またはユーザーごとに集計します
  7. 本番環境モニタリング — 継続的な品質追跡のために本番環境で使用します。リグレッション時にアラートを発します
  8. 軽量 — 単一の @weave.op() デコレータ。複雑なセットアップや、個別のインフラストラクチャは不要です
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Weave — AI Application Tracking by Weights & Biases

You are an expert in Weave, the lightweight toolkit by Weights & Biases for tracking and evaluating AI applications. You help developers trace LLM calls, evaluate outputs, compare model versions, track experiments, and debug AI pipelines — with automatic logging via decorators and a visual dashboard for exploring traces, costs, and quality metrics.

Core Capabilities

Automatic Tracing

import weave
import openai

weave.init("my-ai-project")               # Initialize with project name

client = openai.OpenAI()

# OpenAI calls are automatically traced
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Explain transformers"}],
)
# Weave captures: model, tokens, latency, cost, input/output — viewable in dashboard

# Custom function tracing
@weave.op()
def extract_entities(text: str) -> list[str]:
    """Extract named entities from text."""
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"Extract entities from: {text}\nReturn JSON list."}],
    )
    return json.loads(response.choices[0].message.content)

@weave.op()
def rag_pipeline(query: str) -> str:
    """Full RAG pipeline — each step traced as child span."""
    docs = retrieve_documents(query)       # Traced if decorated
    context = "\n".join(docs)
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": f"Answer using:\n{context}"},
            {"role": "user", "content": query},
        ],
    )
    return response.choices[0].message.content

Evaluations

# Define evaluation dataset
eval_dataset = [
    {"query": "What is Python?", "expected": "programming language"},
    {"query": "Who created Linux?", "expected": "Linus Torvalds"},
    {"query": "What is Docker?", "expected": "containerization platform"},
]

# Define scoring functions
@weave.op()
def relevance_scorer(output: str, expected: str) -> dict:
    """Score if output contains expected information."""
    contains = expected.lower() in output.lower()
    return {"relevance": 1.0 if contains else 0.0}

@weave.op()
def length_scorer(output: str) -> dict:
    """Score response length (prefer concise)."""
    words = len(output.split())
    return {"conciseness": min(1.0, 50 / max(words, 1))}

# Run evaluation
evaluation = weave.Evaluation(
    dataset=eval_dataset,
    scorers=[relevance_scorer, length_scorer],
)

results = await evaluation.evaluate(rag_pipeline)
# Results visible in Weave dashboard with per-example scores
# Compare across model versions, prompts, parameters

Model Versioning

# Track model/prompt versions
class SupportAgent(weave.Model):
    model_name: str = "gpt-4o"
    system_prompt: str = "You are a helpful support agent."
    temperature: float = 0.7

    @weave.op()
    def predict(self, query: str) -> str:
        response = client.chat.completions.create(
            model=self.model_name,
            temperature=self.temperature,
            messages=[
                {"role": "system", "content": self.system_prompt},
                {"role": "user", "content": query},
            ],
        )
        return response.choices[0].message.content

# Version 1
agent_v1 = SupportAgent(system_prompt="Be concise and helpful.")

# Version 2 — compare in dashboard
agent_v2 = SupportAgent(model_name="gpt-4o-mini", system_prompt="Be detailed and empathetic.")

# Evaluate both versions
for agent in [agent_v1, agent_v2]:
    await evaluation.evaluate(agent)
# Dashboard shows side-by-side comparison: quality, cost, latency

Installation

pip install weave
# Uses your W&B account — set WANDB_API_KEY

Best Practices

  1. @weave.op() decorator — Add to any function to trace it; creates hierarchical spans for nested calls
  2. Auto-instrumentation — OpenAI, Anthropic, LangChain calls traced automatically after weave.init()
  3. Evaluations — Define datasets + scorers; run systematically; compare versions in dashboard
  4. weave.Model — Subclass for versioned models; parameters tracked, comparable across evaluations
  5. W&B integration — Weave data appears in your W&B workspace; share with team, add to reports
  6. Cost tracking — Automatic per-call cost calculation; aggregate by function, model, or user
  7. Production monitoring — Use in production for continuous quality tracking; alert on regressions
  8. Lightweight — Single @weave.op() decorator; no complex setup, no separate infrastructure