跳到主要内容

跟踪 txtai

txtai Tracing via autolog

txtai 是一个一体化的嵌入式数据库,用于语义搜索、LLM 编排和语言模型工作流。

MLflow 跟踪为 txtai 提供了自动跟踪功能。通过调用 mlflow.txtai.autolog 函数可以启用 txtai 的自动跟踪,MLflow 将捕获对 LLM 调用、嵌入、向量搜索的跟踪,并将它们记录到活动的 MLflow 实验中。

要开始使用,请安装 MLflow txtai 扩展

bash
pip install mlflow-txtai

然后在 Python 代码中启用自动日志记录

python
import mlflow

mlflow.txtai.autolog()

示例

展示跟踪集成的最简单示例是检测一个 Textractor 管道

python
import mlflow
from txtai.pipeline import Textractor

# Enable MLflow auto-tracing for txtai
mlflow.txtai.autolog()

# Optional: Set a tracking URI and an experiment
mlflow.set_tracking_uri("https://:5000")
mlflow.set_experiment("txtai")

# Define and run a simple Textractor pipeline.
textractor = Textractor()
textractor("https://github.com/neuml/txtai")

txtai Textractor Tracing via autolog

更多信息

有关将 txtai 与 MLflow 结合使用的更多示例和指南,请参阅 MLflow txtai 扩展文档