Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
W&B Inference を使うと、W&B Weave と OpenAI 互換 API 経由で主要なオープンソースの基盤モデルにアクセスできます。次のことができます。
Weave を使えば、W&B Inference を利用したアプリケーションをトレース、評価、監視、改善できます。
以下は、Python を使った簡単な例です。
import openai
client = openai.OpenAI(
# カスタムベースURLはW&B Inferenceを指します
base_url='https://api.inference.wandb.ai/v1',
# https://wandb.ai/settings でAPIキーを作成してください
api_key="<your-api-key>",
# 省略可能: 使用状況トラッキング用のTeamとプロジェクト
project="<your-team>/<your-project>",
)
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": "Tell me a joke."}
],
)
print(response.choices[0].message.content)
- 利用可能なモデルと利用情報と制限を確認します
- 前提条件を参照してアカウントを設定します
- APIまたはUIからサービスを利用します
- 使用例を試します
料金、利用制限、クレジットについては、利用情報と制限を参照してください。