跳到主要内容

txtai 追踪

txtai Tracing via autolog

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

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

首先,安装 MLflow txtai 扩展

pip install mlflow-txtai

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

import mlflow

mlflow.txtai.autolog()

示例

展示追踪集成最简单的例子是为一个 Textractor 管道 引入工具。

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 扩展文档