Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-agent-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
W&B Inference を使うと、W&B Weave と OpenAI 互換 API 経由で主要なオープンソースの基盤モデルにアクセスできます。
- Inference を使うと、ホスティングプロバイダーへの登録やモデルのセルフホスティングをせずに、AI アプリケーションやエージェントを構築できます。
- Weave を使うと、W&B Inference を利用したアプリケーションをトレース、評価、監視、改善できます。
https://wandb.ai/inference にアクセスして、利用可能なモデルを確認し、Weave Playground で試してみてください。
Web インターフェイスの詳細については、UI Guide を参照してください。
この Python の例では、Inference を使用して LLM への chat completion リクエストを送信します。
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>",
# オプション: 使用状況トラッキング用のチームとproject
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からサービスを使用してください。
- W&B Weave Playgroundでサポートされるモデルを試してください。
- 使用例を試してください。
料金、利用制限、クレジットについては、利用情報と制限を参照してください。