跳到主要内容

Tracing txtai

txtai Tracing via autolog

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

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

要开始使用,请安装 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 扩展文档