> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Serverless Inference で Weave を学ぶ

> Serverless Inference を使用してモデルの Call をトレースし、出力を比較し、評価を実行することで、Weave の基礎を学びます。

export const GitHubLink = ({url, compact = false}) => <a href={url} target="_blank" rel="noopener noreferrer" className={compact ? "source-link" : "github-source-link"}>
    {compact ? "View source" : <>
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub source
      </>}
  </a>;

export const ColabLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="colab-link">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01.21.03zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z" />
    </svg>
    Try in Colab
  </a>;

<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
  <ColabLink url="https://colab.research.google.com/github/wandb/examples/blob/main/colabs/weave/quickstart-inference.ipynb" />

  <GitHubLink url="https://github.com/wandb/examples/blob/main/colabs/weave/quickstart-inference.ipynb" />
</div>

このガイドでは、[Serverless Inference](/ja/products/inference/serverless) と Weave を使用して、Weave の基礎を学ぶ方法を説明します。Serverless Inference を使用すると、独自のインフラストラクチャーの構築や複数のプロバイダーの APIキーの管理を行わずに、稼働中のオープンソースモデルを使用して LLM アプリケーションを構築し、トレースできます。CoreWeave Forge の APIキーで、[Serverless Inference がホストするすべてのモデル](/ja/products/inference/serverless/models)を利用できます。このガイドを終えると、LLM Call のトレース、モデルの比較、評価の実行ができ、その結果を Weights & Biases UI で確認できます。

<h2 id="what-youll-learn">
  学習内容
</h2>

このガイドでは、以下の方法を説明します。

* Weave と Serverless Inference を設定します。
* 自動トレース機能を備えた基本的な LLM アプリケーションを構築します。
* 複数のモデルを比較します。
* データセットでモデル性能を評価します。
* Weights & Biases の UI で結果を確認します。

<h2 id="prerequisites">
  前提条件
</h2>

* [CoreWeave Forge アカウント](https://id.coreweave.com/signup)
* Python 3.10 以降または Node.js 18 以降
* 必須パッケージがインストールされていること:
  * **Python**: `pip install weave openai`
  * **TypeScript**: `npm install weave openai`
* [OpenAI APIキー](https://platform.openai.com/api-keys)が環境変数として設定されていること。

<h2 id="trace-your-first-llm-call">
  最初の LLM Call をトレースする
</h2>

このセクションでは、単一の LLM Call を行い、Weave が自動的にそれをトレースする方法を示します。これにより、より複雑な例に進む前に、セットアップが正しく機能していることを確認できます。

開始するには、以下のコード例をコピー＆ペーストしてください。このコード例では、Serverless Inference の Llama 3.1-8B を使用しています。

このコードを実行すると、Weave は次のことを行います:

* LLM Call を自動的にトレースします。
* 入力、出力、レイテンシー、トークン使用量をログします。
* Weights & Biases UI でトレースを表示するためのリンクを提供します。

<Tabs>
  <Tab title="Python">
    ```python lines theme={"system"}
    import weave
    import openai

    # Weave を初期化します。[YOUR-TEAM] をチーム名に置き換えてください。
    weave.init("[YOUR-TEAM]/inference-quickstart")

    # Serverless Inference を指す OpenAI 互換のクライアントを作成します
    client = openai.OpenAI(
        base_url='https://api.inference.wandb.ai/v1',
        api_key="YOUR_WANDB_API_KEY",  # 実際の APIキー に置き換えてください
        project="[YOUR-TEAM]/my-first-weave-project",  # 使用量のトラッキングに必須
    )

    # トレースを有効にするために関数をデコレートします。標準の OpenAI クライアントを使用します
    @weave.op()
    def ask_llama(question: str) -> str:
        response = client.chat.completions.create(
            model="meta-llama/Llama-3.1-8B-Instruct",
            messages=[
                {"role": "system", "content": "You are a helpful assistant."},
                {"role": "user", "content": question}
            ],
        )
        return response.choices[0].message.content

    # 関数を呼び出します - Weave がすべてを自動的にトレースします
    result = ask_llama("What are the benefits of using W&B Weave for LLM development?")
    print(result)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript lines theme={"system"}
    import * as weave from 'weave';
    import OpenAI from 'openai';

    // Weave を初期化します。「[]」で囲まれた値を各自の値に置き換えてください。
    await weave.init("[YOUR-TEAM]/inference-quickstart")

    // Serverless Inference を指す OpenAI 互換のクライアントを作成します
    const client = new OpenAI({
        baseURL: 'https://api.inference.wandb.ai/v1',  // Serverless Inference endpoint
        apiKey: process.env.WANDB_API_KEY || 'YOUR_WANDB_API_KEY', // APIキー に置き換えるか、WANDB_API_KEY 環境変数を設定してください
    });

    // トレースを有効にするために weave.op で関数をラップします
    const askLlama = weave.op(async function askLlama(question: string): Promise<string> {
    const response = await client.chat.completions.create({
        model: 'meta-llama/Llama-3.1-70B-Instruct',
        messages: [
        { role: 'system', content: 'You are a helpful assistant.' },
        { role: 'user', content: question }
        ],
    });
    return response.choices[0].message.content || '';
    });

    // 関数を呼び出します - Weave がすべてを自動的にトレースします
    const result = await askLlama('What are the benefits of using W&B Weave for LLM development?');
    console.log(result);
    ```
  </Tab>
</Tabs>

<h2 id="build-a-text-summarization-application">
  テキスト要約アプリケーションを構築する
</h2>

単一の LLM Call をトレースできたので、このセクションでは、Weave が複数の関数にまたがるネストされたオペレーションをどのようにトレースするかを説明します。これにより、実際の複数ステップの LLM アプリケーションがどのように取得され、UI に表示されるかを確認できます。

次に、以下のコードを実行します。これは、Weave がネストされたオペレーションをどのようにトレースするかを示す、基本的な要約アプリケーションです。

<Tabs>
  <Tab title="Python">
    ```python lines theme={"system"}
    import weave
    import openai

    # Weave を初期化します。「[]」で囲まれた値を自分の値に置き換えてください。
    weave.init("[YOUR-TEAM]/inference-quickstart")

    client = openai.OpenAI(
        base_url='https://api.inference.wandb.ai/v1',
        api_key="YOUR_WANDB_API_KEY",  # 実際の API キーに置き換えてください
        project="[YOUR-TEAM]/my-first-weave-project",  # 使用量のトラッキングに必須
    )

    @weave.op()
    def extract_key_points(text: str) -> list[str]:
        """Extract key points from a text."""
        response = client.chat.completions.create(
            model="meta-llama/Llama-3.1-8B-Instruct",
            messages=[
                {"role": "system", "content": "Extract 3-5 key points from the text. Return each point on a new line."},
                {"role": "user", "content": text}
            ],
        )
        # 空白行を除いた応答を返します
        return [line for line in response.choices[0].message.content.strip().splitlines() if line.strip()]

    @weave.op()
    def create_summary(key_points: list[str]) -> str:
        """Create a concise summary based on key points."""
        points_text = "\n".join(f"- {point}" for point in key_points)
        response = client.chat.completions.create(
            model="meta-llama/Llama-3.1-8B-Instruct",
            messages=[
                {"role": "system", "content": "Create a one-sentence summary based on these key points."},
                {"role": "user", "content": f"Key points:\n{points_text}"}
            ],
        )
        return response.choices[0].message.content

    @weave.op()
    def summarize_text(text: str) -> dict:
        """Main summarization pipeline."""
        key_points = extract_key_points(text)
        summary = create_summary(key_points)
        return {
            "key_points": key_points,
            "summary": summary
        }

    # サンプルテキストで試します
    sample_text = """
    The Apollo 11 mission was a historic spaceflight that landed the first humans on the Moon 
    on July 20, 1969. Commander Neil Armstrong and lunar module pilot Buzz Aldrin descended 
    to the lunar surface while Michael Collins remained in orbit. Armstrong became the first 
    person to step onto the Moon, followed by Aldrin 19 minutes later. They spent about 
    two and a quarter hours together outside the spacecraft, collecting samples and taking photographs.
    """

    result = summarize_text(sample_text)
    print("Key Points:", result["key_points"])
    print("\nSummary:", result["summary"])
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript lines theme={"system"}
    import * as weave from 'weave';
    import OpenAI from 'openai';

    // Weave を初期化します。your-team/your-project に置き換えてください
    await weave.init('[YOUR-TEAM]/inference-quickstart');

    const client = new OpenAI({
    baseURL: 'https://api.inference.wandb.ai/v1',
    apiKey: process.env.WANDB_API_KEY || 'YOUR_WANDB_API_KEY',  // あなたの API キーに置き換えるか、WANDB_API_KEY 環境変数を設定してください
    });

    const extractKeyPoints = weave.op(async function extractKeyPoints(text: string): Promise<string[]> {
    const response = await client.chat.completions.create({
        model: 'meta-llama/Llama-3.1-8B-Instruct',
        messages: [
        { role: 'system', content: 'Extract 3-5 key points from the text. Return each point on a new line.' },
        { role: 'user', content: text }
        ],
    });
    // 空白行を除いた応答を返します
    const content = response.choices[0].message.content || '';
    return content.split('\n').map(line => line.trim()).filter(line => line.length > 0);
    });

    const createSummary = weave.op(async function createSummary(keyPoints: string[]): Promise<string> {
    const pointsText = keyPoints.map(point => `- ${point}`).join('\n');
    const response = await client.chat.completions.create({
        model: 'meta-llama/Llama-3.1-8B-Instruct',
        messages: [
        { role: 'system', content: 'Create a one-sentence summary based on these key points.' },
        { role: 'user', content: `Key points:\n${pointsText}` }
        ],
    });
    return response.choices[0].message.content || '';
    });

    const summarizeText = weave.op(async function summarizeText(text: string): Promise<{key_points: string[], summary: string}> {
    const keyPoints = await extractKeyPoints(text);
    const summary = await createSummary(keyPoints);
    return {
        key_points: keyPoints,
        summary: summary
    };
    });

    // サンプルテキストで試します
    const sampleText = `
    The Apollo 11 mission was a historic spaceflight that landed the first humans on the Moon 
    on July 20, 1969. Commander Neil Armstrong and lunar module pilot Buzz Aldrin descended 
    to the lunar surface while Michael Collins remained in orbit. Armstrong became the first 
    person to step onto the Moon, followed by Aldrin 19 minutes later. They spent about 
    two and a quarter hours together outside the spacecraft, collecting samples and taking photographs.
    `;

    const result = await summarizeText(sampleText);
    console.log('Key Points:', result.key_points);
    console.log('\nSummary:', result.summary);
    ```
  </Tab>
</Tabs>

<h2 id="compare-multiple-models">
  複数のモデルを比較する
</h2>

Weave の一般的な使用例として、同じプロンプトに対する異なるモデルの応答を比較することが挙げられます。Serverless Inference では、複数のモデルにアクセスできます。次のコードを使用して、Llama と DeepSeek のそれぞれの応答のパフォーマンスを比較します。

<Tabs>
  <Tab title="Python">
    ```python lines theme={"system"}
    import weave
    import openai

    # Weave を初期化します。your-team/your-project に置き換えてください
    weave.init("[YOUR-TEAM]/inference-quickstart")

    client = openai.OpenAI(
        base_url='https://api.inference.wandb.ai/v1',
        api_key="YOUR_WANDB_API_KEY",  # 実際の APIキーに置き換えてください
        project="[YOUR-TEAM]/my-first-weave-project",  # 使用量のトラッキングに必須です
    )

    # 異なる LLM を比較するための Model クラスを定義します
    class InferenceModel(weave.Model):
        model_name: str
        
        @weave.op()
        def predict(self, question: str) -> str:
            response = client.chat.completions.create(
                model=self.model_name,
                messages=[
                    {"role": "user", "content": question}
                ],
            )
            return response.choices[0].message.content

    # 異なるモデルのインスタンスを作成します
    llama_model = InferenceModel(model_name="meta-llama/Llama-3.1-8B-Instruct")
    deepseek_model = InferenceModel(model_name="deepseek-ai/DeepSeek-V3.1")

    # それぞれの応答を比較します
    test_question = "Explain quantum computing in one paragraph for a high school student."

    print("Llama 3.1 8B response:")
    print(llama_model.predict(test_question))
    print("\n" + "="*50 + "\n")
    print("DeepSeek V3 response:")
    print(deepseek_model.predict(test_question))
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript lines theme={"system"}
    import * as weave from 'weave';
    import OpenAI from 'openai';

    // Weave を初期化します。your-team/your-project に置き換えてください
    await weave.init("[YOUR-TEAM]/inference-quickstart")

    const client = new OpenAI({
      baseURL: 'https://api.inference.wandb.ai/v1',
      apiKey: process.env.WANDB_API_KEY || 'YOUR_WANDB_API_KEY', // APIキーに置き換えるか、WANDB_API_KEY 環境変数を設定してください
    });

    // weave.op を使用してモデル関数を作成します（TypeScript では weave.Model はサポートされません）
    function createModel(modelName: string) {
      return weave.op(async function predict(question: string): Promise<string> {
        const response = await client.chat.completions.create({
          model: modelName,
          messages: [
            { role: 'user', content: question }
          ],
        });
        return response.choices[0].message.content || '';
      });
    }

    // 異なるモデルのインスタンスを作成します
    const llamaModel = createModel('meta-llama/Llama-3.1-8B-Instruct');
    const deepseekModel = createModel('deepseek-ai/DeepSeek-V3.1');

    // それぞれの応答を比較します
    const testQuestion = 'Explain quantum computing in one paragraph for a high school student.';

    console.log('Llama 3.1 8B response:');
    console.log(await llamaModel(testQuestion));
    console.log('\n' + '='.repeat(50) + '\n');
    console.log('DeepSeek V3 response:');
    console.log(await deepseekModel(testQuestion));
    ```
  </Tab>
</Tabs>

<h2 id="evaluate-model-performance">
  モデル性能を評価する
</h2>

このセクションでは、その場限りの比較にとどまらず、データセット全体で体系的な評価を実行し、モデルの品質を系統的に測定して比較する方法を説明します。

Weave に組み込まれている `EvaluationLogger` を使用して、Q\&A タスクでのモデル性能を評価します。これにより、自動集約、トークン使用量の取得、UI の豊富な比較機能を備えた、体系的な評価のトラッキングが可能になります。

前のセクションで使用したスクリプトに、次のコードを追加します:

<Tabs>
  <Tab title="Python">
    ```python lines theme={"system"}
    from typing import Optional
    from weave import EvaluationLogger

    # シンプルなデータセットを作成します
    dataset = [
        {"question": "What is 2 + 2?", "expected": "4"},
        {"question": "What is the capital of France?", "expected": "Paris"},
        {"question": "Name a primary color", "expected_one_of": ["red", "blue", "yellow"]},
    ]

    # スコアラーを定義します
    @weave.op()
    def accuracy_scorer(expected: str, output: str, expected_one_of: Optional[list[str]] = None) -> dict:
        """Score the accuracy of the model output."""
        output_clean = output.strip().lower()
        
        if expected_one_of:
            is_correct = any(option.lower() in output_clean for option in expected_one_of)
        else:
            is_correct = expected.lower() in output_clean
        
        return {"correct": is_correct, "score": 1.0 if is_correct else 0.0}

    # Weave の EvaluationLogger を使用してモデルを評価します
    def evaluate_model(model: InferenceModel, dataset: list[dict]):
        """Run evaluation on a dataset using Weave's built-in evaluation framework."""
        # トークン使用量を取得するため、モデルを呼び出す前に EvaluationLogger を初期化します
        # これは Serverless Inference のコストをトラッキングするうえで特に重要です
        # モデル名を有効な形式に変換します（英数字以外の文字をアンダースコアに置き換えます）
        safe_model_name = model.model_name.replace("/", "_").replace("-", "_").replace(".", "_")
        eval_logger = EvaluationLogger(
            model=safe_model_name,
            dataset="qa_dataset"
        )
        
        for example in dataset:
            # モデルの予測を取得します
            output = model.predict(example["question"])
            
            # 予測をログします
            pred_logger = eval_logger.log_prediction(
                inputs={"question": example["question"]},
                output=output
            )
            
            # 出力を採点します
            score = accuracy_scorer(
                expected=example.get("expected", ""),
                output=output,
                expected_one_of=example.get("expected_one_of")
            )
            
            # スコアをログします
            pred_logger.log_score(
                scorer="accuracy",
                score=score["score"]
            )
            
            # この予測のログを終了します
            pred_logger.finish()
        
        # サマリーをログします - Weave が精度のスコアを自動的に集計します
        eval_logger.log_summary()
        print(f"Evaluation complete for {model.model_name} (logged as: {safe_model_name}). View results in the Weights & Biases UI.")

    # 複数のモデルを比較します - Weave の評価フレームワークの主要機能です
    models_to_compare = [
        llama_model,
        deepseek_model,
    ]

    for model in models_to_compare:
        evaluate_model(model, dataset)

    # Weights and Biases の UI で Evals タブにアクセスして、モデル間で結果を比較します
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript twoslash lines theme={"system"}
    // @noErrors
    import { EvaluationLogger } from 'weave';

    // 簡単なデータセットを作成します
    interface DatasetExample {
      question: string;
      expected?: string;
      expected_one_of?: string[];
    }

    const dataset: DatasetExample[] = [
      { question: 'What is 2 + 2?', expected: '4' },
      { question: 'What is the capital of France?', expected: 'Paris' },
      { question: 'Name a primary color', expected_one_of: ['red', 'blue', 'yellow'] },
    ];

    // スコアラーを定義します
    const accuracyScorer = weave.op(function accuracyScorer(args: {
      expected: string;
      output: string;
      expected_one_of?: string[];
    }): { correct: boolean; score: number } {
      const outputClean = args.output.trim().toLowerCase();
      
      let isCorrect: boolean;
      if (args.expected_one_of) {
        isCorrect = args.expected_one_of.some(option => 
          outputClean.includes(option.toLowerCase())
        );
      } else {
        isCorrect = outputClean.includes(args.expected.toLowerCase());
      }
      
      return { correct: isCorrect, score: isCorrect ? 1.0 : 0.0 };
    });

    // Weave の EvaluationLogger を使用してモデルを評価します
    async function evaluateModel(
      model: (question: string) => Promise<string>,
      modelName: string,
      dataset: DatasetExample[]
    ): Promise<void> {
      // トークン使用量を取得するため、モデルを呼び出す前に EvaluationLogger を初期化します
      // これは、Serverless Inference でコストをトラッキングする際に特に重要です
      // モデル名を有効な形式に変換します（英数字以外の文字をアンダースコアに置き換えます）
      const safeModelName = modelName.replace(/\//g, '_').replace(/-/g, '_').replace(/\./g, '_');
      const evalLogger = new EvaluationLogger({
        name: 'inference_evaluation',
        model: { name: safeModelName },
        dataset: 'qa_dataset'
      });
      
      for (const example of dataset) {
        // モデルの予測を取得します
        const output = await model(example.question);
        
        // 予測をログします
        const predLogger = evalLogger.logPrediction(
          { question: example.question },
          output
        );
        
        // 出力を採点します
        const score = await accuracyScorer({
          expected: example.expected || '',
          output: output,
          expected_one_of: example.expected_one_of
        });
        
        // スコアをログします
        predLogger.logScore('accuracy', score.score);
        
        // この予測のログを終了します
        predLogger.finish();
      }
      
      // サマリーをログします - Weave が精度スコアを自動的に集計します
      await evalLogger.logSummary();
      console.log(`Evaluation complete for ${modelName} (logged as: ${safeModelName}). View results in the weights and Biases UI.`);
    }

    // 複数のモデルを比較します - Weave の評価フレームワークの主要な機能です
    const modelsToCompare = [
      { model: llamaModel, name: 'meta-llama/Llama-3.1-8B-Instruct' },
      { model: deepseekModel, name: 'deepseek-ai/DeepSeek-V3.1' },
    ];

    for (const { model, name } of modelsToCompare) {
      await evaluateModel(model, name, dataset);
    }

    // Weights & Biases の UI で Evals タブにアクセスして、モデル間で結果を比較します
    ```
  </Tab>
</Tabs>

これらのサンプルを実行すると、LLM Call、ネストした summarization pipeline、モデル比較、および Weave にログされた full 評価をトレースします。これらのサンプルを実行すると、ターミナルにトレースへのリンクが返されます。任意のリンクをクリックして、Weights & Biases UI でトレースを表示します。

Weights & Biases UI では、次の操作が可能です。

* すべての LLM Call のタイムラインを確認します。
* 各オペレーションの入力と出力を検査します。
* トークン使用量と推定コストを表示します (EvaluationLogger により自動的に取得されます) 。
* レイテンシーとパフォーマンス メトリクスを分析します。
* **Evals** タブにアクセスして、集計された評価結果を確認します。
* **Compare** 機能を使用して、異なるモデル間でのパフォーマンスを分析します。
* 特定のサンプルをページ送りして、同じ入力に対して異なるモデルがどのように動作したかを確認します。

<h2 id="available-models">
  利用可能なモデル
</h2>

利用可能なモデルの全一覧については、Serverless Inference ドキュメントの[利用可能なモデルのセクション](/ja/products/inference/serverless/models)を参照してください。

<h2 id="next-steps">
  次のステップ
</h2>

基本を押さえたら、以下のリソースで Weave と Serverless Inference についてさらに詳しく学べます:

* **プレイグラウンドを使用する**: Weave Playground で[モデルをインタラクティブに試します](/ja/products/wandb/weave/guides/tools/playground#access-the-playground)
* **評価を構築する**: LLM アプリケーションの[体系的な評価](/ja/products/wandb/weave/guides/core-types/evaluations)について学びます
* **他のインテグレーションを試す**: Weave は [OpenAI、Anthropic など、多くのサービス](/ja/products/wandb/weave/guides/integrations)と連携します

<h2 id="troubleshooting">
  トラブルシューティング
</h2>

<details>
  <summary>認証エラー</summary>

  認証エラーが発生した場合:

  1. 有効な CoreWeave Forge アカウントをお持ちであることを確認してください。
  2. [forge.coreweave.com/settings](https://forge.coreweave.com/settings) から正しい API キーを使用していることを確認してください。
  3. プロジェクト名が `your-team/your-project` の形式に従っていることを確認してください。
</details>

<details>
  <summary>レート制限エラー</summary>

  Serverless Inference には project ごとの同時実行制限があります。レート制限に達した場合:

  * 同時リクエスト数を減らしてください。
  * Call の間に遅延を追加してください。
  * より高い制限のためにプランをアップグレードすることを検討してください。

  詳細については、[Serverless Inference の制限に関するドキュメント](/ja/products/inference/serverless/usage-limits) を参照してください。
</details>

<details>
  <summary>クレジットが不足した場合</summary>

  無料ティアには制限付きのクレジットが含まれています。詳細については、[使用量と制限に関するドキュメント](/ja/products/inference/serverless/usage-limits) を参照してください。
</details>
