メインコンテンツまでスキップ

Groq のトレース

自動ログによる Groq トレース

MLflow Tracing は、 Groqの使用時に自動トレース機能を提供します。mlflow.groq.autolog関数を呼び出すことでGroqの自動トレースが有効になっている場合、 Groq SDKを使用すると、インタラクティブ開発中に生成されたトレースが自動的に記録されます。

同期呼び出しのみがサポートされ、非同期 API とストリーミング メソッドはトレースされないことに注意してください。

使用例

Python
import groq

import mlflow

# Turn on auto tracing for Groq by calling mlflow.groq.autolog()
mlflow.groq.autolog()

# Set up MLflow tracking on Databricks
mlflow.set_tracking_uri("databricks")
mlflow.set_experiment("/Shared/groq-demo")

client = groq.Groq()

# Use the create method to create new message
message = client.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[
{
"role": "user",
"content": "Explain the importance of low latency LLMs.",
}
],
)

print(message.choices[0].message.content)

自動トレースを無効にする

Groq の自動トレースは、 mlflow.groq.autolog(disable=True) または mlflow.autolog(disable=True)を呼び出すことでグローバルに無効にできます。

次のステップ