---
title: "Preview Dataset From Hub"
method: POST
path: "/felix/datasets/preview-from-hub"
tags: ["felix", "datasets"]
---

# Preview Dataset From Hub

`POST /felix/datasets/preview-from-hub`

Preview a dataset from HuggingFace Hub without saving it.

Fetches the dataset and returns a preview (first 50 rows, schema, metadata)
for user review before confirming the import.

User-authenticated requests require hf_token. Sandbox run keys omit it and
import public repos anonymously. Gated or private repos must be imported
in the Pioneer UI with a user token.

## Request body

- HuggingFacePullRequest — Request to pull dataset from HuggingFace Hub.
  - `repo_id` string, required — HuggingFace repo ID to pull from
  - `config_name` string, nullable — HuggingFace dataset configuration, distinct from the local Pioneer name
  - `revision` string, nullable — Specific revision/branch to pull
  - `name` string, nullable — Name for the local dataset (defaults to repo name)
  - `hf_token` string, nullable — HuggingFace API token. Required for user-authenticated imports. Sandbox run keys must omit this field and can only import public repos. Gated or private repos must be imported in the Pioneer UI.
  - `session_id` string, nullable — Session ID for SSE log streaming
  - `column_mapping` object, nullable — Column mapping from source to standard names
  - `dataset_type` string, nullable — Dataset type (ner, classification, custom)
  - `type` 'training' | 'evaluation' | 'benchmark', nullable — Dataset purpose: 'training' (trainable), 'evaluation' (not trainable), 'benchmark' (system-managed, evaluation-only; cannot be created via this endpoint). This model is also bound to POST /felix/datasets/preview-from-hub, which ignores this field entirely -- nothing is persisted on a preview.

## Response `200`

Successful Response

- HuggingFacePullPreviewResponse — Response containing preview data from a HuggingFace dataset pull (without saving).
  - `preview_rows` object[], required — Sample rows from the dataset (first 50 rows)
  - `total_rows` integer, required — Total number of rows in the dataset
  - `columns` string[], required — List of column names
  - `dataset_type` string, required — Inferred dataset type (classification, ner, custom)
  - `schema_` object, nullable — Inferred schema mapping column names to data types
  - `metadata` object, nullable — Dataset metadata from HuggingFace

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-24** `1cffaad2a921` — 1 warning, 5 info
  - removed the optional property `detail` from the response with the `422` status
  - added the new optional request property `config_name`
  - added the new optional request property `type`
  - the request property `hf_token` became optional
  - …2 more

[Change history](https://skmtc.dev/pioneer/apis/brain-api/changes/felix/datasets/preview-from-hub/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) · [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/1cffaad2a921?raw)
