Skip to content

Dataset providers

A dataset's type picks one of these; its config is the provider's arguments, plus the templates and schemas every provider takes.

Dataset

Dataset(input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=None, limit: int = None, repeat: int = 1, **kwargs)

The engine's streaming Dataset, with every hand-written schema closed at the door.

Everything is the base class': _iter_rows() to implement, the three Jinja2 templates over a row (input_template, output_template and tools_template, the row's own tool declarations as a Chat Completions request carries them, with row_schema the row's shape without them), limit, repeat, batch_size, the (x, y) batches. Two differences. _close_objects: an input_schema or output_schema written by hand is marked closed, object by object, before the base class reads it. And the templates are compiled in the engine's JINJA, as RowTemplates: each sees the whole row as row beside its columns, and has fromjson, fromliteral, as_image and as_audio.

HuggingFaceDataset

HuggingFaceDataset(path, *, name=None, split=None, revision=None, streaming=True, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1, **kwargs)

A HuggingFace datasets source: a public benchmark, or a team dataset on the Hub.

The library's own loader, behind the engine's door: the rows are what datasets.load_dataset yields, every split in order when no split is named, and a hand-written schema is closed before it is read. Any other key goes to load_dataset (data_files, token, ...).

Parameters:

Name Type Description Default
path str

The dataset repo or builder name.

required
name str

Optional. The configuration (subset).

None
split str

Optional. The split; every split in order when None.

None
revision str

Optional. A commit, branch or tag to pin the rows to.

None
streaming bool

Download the rows on demand (the default); False downloads the dataset, which is also when its length is known without a limit.

True
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset.

None
repeat int

See Dataset.

1
**kwargs

Forwarded to datasets.load_dataset.

{}

LocalDataset

LocalDataset(path, *, format=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A local file: a JSON list, JSONL, CSV or Parquet.

The format is read off the file's extension (.json, .jsonl, .ndjson, .csv, .tsv, .parquet) unless format says. Each row is handed to the templates as a mapping of its columns; a CSV's values are all strings.

Parameters:

Name Type Description Default
path str

The file.

required
format str

Optional. json (a list of records, or an object holding one list), jsonl, csv or parquet, for a file whose extension says otherwise.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset.

None
repeat int

See Dataset.

1

check

check() -> int

Read the whole file and say what is wrong with it, before a run does; returns its row count.

FolderDataset

FolderDataset(path, *, pattern='*', recursive=False, format=None, encoding='utf-8', input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A folder where each file is one record.

Files are read in name order. A .json, .yaml or .yml file is parsed: a mapping's keys are the record's own fields, any other value is handed over whole as record. A .txt or .md file, and any file when format is text, is handed over as text. Every record also carries _filename, _stem and _path (relative to the folder, posix-style).

Parameters:

Name Type Description Default
path str

The folder.

required
pattern str

The glob the files must match. Defaults to *, every file at the top level.

'*'
recursive bool

Walk the subfolders too. Defaults to False.

False
format str

Optional. json, yaml or text, for every file whatever its extension.

None
encoding str

The files' text encoding. Defaults to utf-8.

'utf-8'
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset.

None
repeat int

See Dataset.

1

files

files() -> list[Path]

The files that are records, in name order.

record

record(file: Path) -> dict

The record a file holds, with where it came from.

MLflowDataset

MLflowDataset(name=None, *, dataset_id=None, tracking_uri=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit=None, repeat=1)

An MLflow evaluation dataset.

The library's own loader, behind the engine's door, read from the arena's MLflow source server: MLFLOW_SOURCE_TRACKING_URI unless tracking_uri says. Fields, templates and records are the library's.

Parameters:

Name Type Description Default
name str

The dataset's name; or give dataset_id.

None
dataset_id str

Optional. The dataset's id, instead of its name.

None
tracking_uri str

Optional. The MLflow server to read from.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset.

None
repeat int

See Dataset.

1

list_datasets classmethod

list_datasets(query='', limit=100)

The datasets on the source server whose name holds query; see PlatformDataset.list_datasets.

LangfuseDataset

LangfuseDataset(dataset_name, *, version=None, streaming=True, page_size=50, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A Langfuse dataset.

See https://langfuse.com/docs/evaluation/experiments/datasets. Each item is handed to the templates as input, expected_output, metadata and id. Auth comes from the environment (LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST).

Parameters:

Name Type Description Default
dataset_name str

The Langfuse dataset name.

required
version str | datetime

Optional. The UTC point in time to pin the items to: Langfuse versions a dataset by timestamp, so an ISO 8601 string ("2026-04-15T00:00:00Z") or a YAML timestamp. None reads the latest state.

None
streaming bool

Read the items page by page as the rows are iterated (the default), or the whole dataset at once (False), which is also when the length is known without a limit.

True
page_size int

Items per page when streaming. Defaults to 50, the SDK's own default.

50
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset.

None
repeat int

See Dataset.

1

LangSmithDataset

LangSmithDataset(dataset_name, *, as_of=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A LangSmith dataset.

See https://docs.smith.langchain.com/evaluation/concepts#datasets. Each example is handed to the templates as inputs, outputs, metadata (each a mapping, empty when the example has none) and id. Auth comes from the environment (LANGSMITH_API_KEY, LANGSMITH_ENDPOINT).

Parameters:

Name Type Description Default
dataset_name str

The LangSmith dataset name.

required
as_of str | datetime

Optional. A version tag ("prod"), or a UTC datetime to read the dataset as it was then. None reads the latest state.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset. Needed for a length: LangSmith gives no count under as_of without a full scan.

None
repeat int

See Dataset.

1

DatadogDataset

DatadogDataset(dataset_name, *, project_name=None, version: int = None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A Datadog Agent Observability (LLM Observability) dataset.

See https://docs.datadoghq.com/llm_observability/experiments/datasets/. Read over Datadog's REST API, no SDK: the project and the dataset are found by name, never created, and the records are paged. Each record is handed to the templates as input_data, expected_output, metadata (a mapping, empty when the record has none) and id, ddtrace's names. Auth comes from the environment: DD_API_KEY, DD_APP_KEY and DD_SITE (datadoghq.com by default).

Parameters:

Name Type Description Default
dataset_name str

The Datadog dataset name.

required
project_name str

Optional. The project that holds the dataset. Defaults to DD_LLMOBS_PROJECT_NAME, else default-project.

None
version int

Optional. The dataset version to read. None reads the current one.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Records per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset. Needed for a length: the API gives no record count.

None
repeat int

See Dataset.

1

list_datasets classmethod

list_datasets(query='', limit=100)

The datasets of the configured project (DD_LLMOBS_PROJECT_NAME, else default-project); see PlatformDataset.

OpikDataset

OpikDataset(dataset_name, *, version=None, filter_string=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

An Opik (Comet) dataset.

See https://www.comet.com/docs/opik/evaluation/manage_datasets. Each item is handed to the templates as the mapping Opik keeps: input, expected_output, metadata, id, and any custom field added at insertion. Auth comes from the environment (OPIK_API_KEY, OPIK_WORKSPACE, OPIK_URL_OVERRIDE).

Parameters:

Name Type Description Default
dataset_name str

The Opik dataset name.

required
version str

Optional. A version name ("v1") to read the dataset's snapshot of that name. None reads the live state.

None
filter_string str

Optional. An Opik OQL filter, applied on the server ('tags contains "regression"').

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset; asked of Opik too, so only that many items come over the wire.

None
repeat int

See Dataset.

1

PhoenixDataset

PhoenixDataset(dataset_name, *, version_id=None, splits=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

An Arize Phoenix dataset.

See https://docs.arize.com/phoenix/datasets-and-experiments. Each example is handed to the templates as id, input, output and metadata (each a mapping, empty when the example has none). Auth comes from the environment (PHOENIX_API_KEY, and PHOENIX_COLLECTOR_ENDPOINT or PHOENIX_HOST + PHOENIX_PORT).

Parameters:

Name Type Description Default
dataset_name str

The Phoenix dataset name, or its id.

required
version_id str

Optional. The version to read. None reads the latest.

None
splits list

Optional. The split names to keep.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset. Phoenix sends the whole version in one call; the cap applies on this side.

None
repeat int

See Dataset.

1

BraintrustDataset

BraintrustDataset(project=None, dataset_name=None, *, version=None, project_id=None, org_name=None, fetch_batch_size=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A Braintrust dataset.

See https://www.braintrust.dev/docs/guides/datasets. Each record is handed to the templates as id, input, expected and metadata (a mapping, empty when the record has none). Auth comes from the environment (BRAINTRUST_API_KEY, and BRAINTRUST_APP_URL, BRAINTRUST_ORG_NAME when needed).

Parameters:

Name Type Description Default
project str

The Braintrust project name; or give project_id.

None
dataset_name str

The dataset's name within the project.

None
version str | int

Optional. A transaction id to pin the records to. None reads the latest state.

None
project_id str

Optional. The project's UUID, instead of its name; wins over project when both are set.

None
org_name str

Optional. The organization, for a user in several. Falls back to BRAINTRUST_ORG_NAME.

None
fetch_batch_size int

Optional. Records per request to the API; the SDK's own default when unset.

None
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset. Needed for a length: Braintrust gives no count without a full scan.

None
repeat int

See Dataset.

1

UnityCatalogDataset

UnityCatalogDataset(table, *, version=None, as_of=None, storage_path=None, read_batch_size=10000, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)

A Delta or Parquet table governed by Unity Catalog (Databricks or OSS).

Each row of the table is handed to the templates as a mapping of its columns. The table is found through the catalog's REST API (its storage location, its version token), then read from object storage with deltalake and pyarrow, record batch by record batch, so the table never has to fit in memory. The catalog is reached with UNITY_CATALOG_API_URL and UC_TOKEN; the storage with AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION (fr-par unless set) and, for an S3-compatible store, S3_ENDPOINT. What the catalog said of the table is kept in metadata, for the run to record where its rows came from.

Parameters:

Name Type Description Default
table str

The table, fully qualified: catalog.schema.table.

required
version int

Optional. The Delta version to read. Not with as_of.

None
as_of str

Optional. The UTC time (ISO 8601) to read the Delta table as of. Not with version.

None
storage_path str

Optional. Where the table's files are (s3://...), given directly: the catalog is not asked.

None
read_batch_size int

Rows per record batch read from storage. Defaults to 10,000. Not the run's batch_size.

10000
input_data_model DataModel

See Dataset.

None
input_schema dict | str

See Dataset.

None
input_template str

See Dataset.

None
output_data_model DataModel

See Dataset.

None
output_schema dict | str

See Dataset.

None
output_template str

See Dataset.

None
tools_template str

See Dataset.

None
batch_size int

Examples per yielded batch. Defaults to 1.

1
limit int

Optional. See Dataset. Needed for a length: a table's row count takes a full scan.

None
repeat int

See Dataset.

1

is_delta property

is_delta: bool

Whether the files are a Delta table: what the catalog says, and Delta when it says nothing.

connect

connect() -> str

Where the table's files are: the path given, else what the catalog says; metadata keeps the rest.

HarborTasksDataset

HarborTasksDataset(path, *, tasks=None, batch_size=1, limit: int = None, repeat: int = 1, **ignored)

Harbor task folders, one row each.

Parameters:

Name Type Description Default
path str

The folder holding the tasks, one sub-folder each.

required
tasks list

Optional. The tasks to run, by folder name; none runs every task under path.

None
batch_size int

Tasks run at once.

1
limit int

Optional. At most this many tasks.

None
repeat int

Optional. Each task this many times.

1