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
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"; e.g. "evaluation") |
--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 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 |