Bailian CLI command reference for dataset upload, validation, and management.
Manage datasets for model fine-tuning from the terminal: upload, validate locally, view, and delete.
Upload a dataset file (.jsonl or .zip) to Bailian. Requires API Key authentication.
Usage
Example: Upload dataset file to Bailian
Locally validate a dataset file (.jsonl or .zip) without uploading. No authentication required.
Usage
Example: Locally validate dataset file
List uploaded dataset files. Requires API Key authentication.
Usage
Example: List datasets filtered by purpose
Get details of a single dataset file. Requires API Key authentication.
Usage
Example: Retrieve dataset file details by ID
List Console dataset groups. Requires Console authentication.
Usage
Example: List Console dataset groups
List versions by group or get a single version by ID. Requires Console authentication.
Usage
Example: List dataset versions by group
Example: Get a single version with status details
Delete a dataset file by ID. Requires API Key authentication.
Usage
Example: Delete a dataset file by ID
Command reference
bl dataset upload
Upload a dataset file (.jsonl or .zip) to Bailian. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file <path> | string | yes | Local dataset file (.jsonl or .zip; ≤200MB SFT/DPO, ≤300MB CPT, ≤2GB media zip) |
--purpose <name> | string | no | Dataset purpose tag (default: "fine-tune") |
--schema <s> | string | no | Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "tts" (audio), "image" (image generation), or "video" (video generation). Default auto-detects per record. |
--no-validate | switch | no | Skip the local JSONL pre-flight check (not recommended) |
--full-validate | switch | no | JSON.parse every line instead of sampling (slower) |
- Supports .jsonl (text) and .zip (audio/image/video archives with a data.jsonl manifest). Six record schemas are recognized: chatml = {messages:[...]} (SFT); dpo = {messages:[...], chosen, rejected}; cpt = {text:"..."} (continual pre-training, raw text); tts = {wav_fn:"train/xxx.wav", text:"..."} (audio fine-tuning); image = {img_path:"..."} (image generation); video = {first_frame_path:...} (video generation).
- With no --schema, a record carrying wav_fn is validated as TTS, img_path as image, chosen/rejected as DPO, text (no messages) as CPT, otherwise ChatML.
- Upload cap: 200MB SFT/DPO text, 300MB CPT, 2GB media zip. Upload uses the OpenAI-compatible /compatible-mode/v1/files endpoint so the purpose tag is persisted (the DashScope-native /api/v1/files drops it).
bl dataset validate
Locally validate a dataset file (.jsonl or .zip) without uploading. No authentication required.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file <path> | string | yes | Local dataset file (.jsonl or .zip) |
--full-validate | switch | no | JSON.parse every line instead of sampling (slower) |
--schema <s> | string | no | Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "tts" (audio), "image" (image generation), or "video" (video generation). Default auto-detects per record. |
- Default scan: every line gets a structural check, then ~160 lines (front 50, evenly spaced 100, last 10) are JSON.parsed against the active schema.
- Schemas: chatml = {messages:[...]} (SFT); dpo = {messages:[...], chosen, rejected}; cpt = {text:"..."} (continual pre-training, raw text); tts = {wav_fn:"train/xxx.wav", text:"..."} (audio fine-tuning); image = {img_path:"..."} (image generation); video = {first_frame_path:"...", video_path:"..."} (video generation, i2v first-frame or kf2v first+last-frame with last_frame_path).
- With no --schema, a record carrying wav_fn is validated as TTS, img_path as image, first_frame_path/video_path as video, chosen/rejected as DPO, text (no messages) as CPT, otherwise ChatML. Pass --schema to require a specific shape on every record.
- ZIP archives (.zip) are validated structurally (data.jsonl present, media references resolve) in addition to per-record content checks. Use --full-validate to JSON.parse every line.
bl dataset list
List uploaded dataset files. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--page <n> | number | no | Page number (default: 1) |
--page-size <n> | number | no | Results per page (default: 10, max 100) |
--purpose <name> | string | no | Filter by purpose (e.g. "fine-tune", "evaluation"). Omit to list all. |
bl dataset get
Get details of a single dataset file. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-id <id> | string | yes | Dataset file ID |
bl dataset groups
List Console dataset groups. Requires Console authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--page <n> | number | no | Page number (default: 1) |
--page-size <n> | number | no | Groups per page (default: 10) |
--name <name> | string | no | Filter by name (server-side filtering; trimmed before sending) |
--workspace-id <id> | string | no | Workspace ID (env: BAILIAN_WORKSPACE_ID) |
- Fetches only the requested page. records contains dataset groups; items is the server's total count for the query. Each group's datasets is only a one-version preview, not its complete version list; use
dataset version --dataset-group-idto get the full version list for that group.
bl dataset version
List versions by group or get a single version by ID. Requires Console authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--dataset-group-id <id> | string | no | List Console dataset versions by group; mutually exclusive with --dataset-id |
--dataset-id <id> | string | no | Console dataset version ID (not an API file ID) |
--include-status | switch | no | Also query import/release state; only valid with --dataset-id |
--workspace-id <id> | string | no | Workspace ID (env: BAILIAN_WORKSPACE_ID) |
- Exactly one of
--dataset-group-idor--dataset-idis required.--include-statusis only valid with--dataset-id. - Use
dataset groupsto find a datasetGroupId, then list versions with--dataset-group-id; pick a datasetId from the result and query details with--dataset-id. fileId belongs to the file/training workflow and cannot substitute for a Console ID.
bl dataset delete
Delete a dataset file by ID. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-id <id> | string | yes | Dataset file ID |
--yes | switch | no | Confirm this high-risk operation |