Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- **Parameter validation and messages** — Help and version queries validate supplied flags. Only explicitly declared flag names are accepted, and parsing errors support English and Chinese messages based on the configured language.
- **File upload timeout** — Use `--timeout` to set the transfer timeout when uploading local files to temporary OSS storage.

## [2.2.2] - 2026-10-14

### Added

- **Model compression lifecycle** — Added `bl finetune compress templates/create/list/get/watch/logs/cancel/delete` for quantizing supported full-parameter fine-tuned models, including dry-run previews, status polling, log retrieval, and safe deletion confirmation.
- **Pi agent support** — `bl config agent` and `bl mcp connect` / `bl mcp disconnect` now support Pi, writing its native configuration while preserving existing settings and redacting credentials in output.
- **Global flags before the command path** — Global flags such as `--config` can now precede the command (`bl --config token-plan auth status`) as well as follow it; both select the Profile for that invocation only, without changing `active_config`. Command-specific and credential flags must still follow the command path.
- **Decision model inference** — Added `bl decision` for TypeSafe System One requests against workspace-scoped endpoints, including `choice` / `noul` / `score` validation, JSON and text output, training-sample reuse, Beijing/Singapore routing, and dry-run previews.

### Changed

- **Decision dataset validation** — Aligned the `decision` schema with the current API: `state` may be a string, object, or array; `instructions` is optional; and question criteria now enforce API limits.
- **Stricter flag validation** — Only flags defined for a command are accepted. Unknown flags, missing values, and invalid values now return usage exit code 2 even when the invocation would otherwise show help, and parser errors follow the Profile language. A bare root or command-group invocation still shows help and returns 0. `--timeout` uses the same positive-finite rule on the command line and in resolved settings.

### Fixed

- **Temporary file upload timeout** — Uploads of local files to temporary OSS storage now honor `--timeout` instead of a fixed 120-second limit.

## [2.2.1] - 2026-10-12

### Fixed
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
- **参数校验与提示** —— 帮助和版本查询会校验已传入的参数;仅接受命令支持的参数名,参数解析错误支持按配置语言显示中英文提示。
- **文件上传超时** —— `--timeout` 可设置本地文件上传至临时 OSS 的传输超时时间。

## [2.2.2] - 2026-10-14

### 新增

- **模型压缩完整生命周期** —— 新增 `bl finetune compress templates/create/list/get/watch/logs/cancel/delete`,支持对符合条件的全参调优模型执行量化压缩,并覆盖 dry-run 预览、状态轮询、日志查询和安全删除确认。
- **支持 Pi Agent** —— `bl config agent` 与 `bl mcp connect` / `bl mcp disconnect` 新增支持 Pi,写入其原生配置并保留已有设置,输出中的凭据会脱敏。
- **全局参数可前置** —— `--config` 等全局参数现在既可放在命令之后,也可放在命令之前(`bl --config token-plan auth status`);两种写法都只对本次调用选择 Profile,不修改 `active_config`。命令专属参数和凭证域参数仍须放在命令路径之后。
- **决策模型推理** —— 新增 `bl decision`,通过工作空间专属 Endpoint 调用 TypeSafe System One,支持 `choice` / `noul` / `score` 校验、JSON 与文本输出、复用训练样本、北京/新加坡地域路由及 dry-run 预览。

### 变更

- **决策数据集校验** —— 与最新 API 对齐:`state` 可为字符串、对象或数组,`instructions` 改为可选,并按接口限制校验各类问题的 criteria。
- **更严格的参数校验** —— 只接受命令已定义的参数。未知参数、缺少参数值或参数值非法时,即使本次调用原本会显示帮助,也返回用法错误退出码 2,解析错误提示跟随 Profile 语言;不带参数的根命令或命令组仍显示帮助并返回 0。`--timeout` 在命令行和最终生效配置中使用同一套“正有限数”校验规则。

### 修复

- **临时文件上传超时** —— 本地文件上传到临时 OSS 存储时会遵循 `--timeout`,不再固定为 120 秒。

## [2.2.1] - 2026-10-12

### 修复
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Once installed, just describe your task to your AI Agent — no need to assemble
| Monitoring & alerts | "Show my model call stats, failures and logs, and create an alert rule." |
| Throughput reservations | "List my throughput reservations and capacity instances, then scale, renew or release capacity and wait for the operation to finish." |
| Model selection | "Recommend a model for image understanding and customer support." |
| Decision model | "Use the Bailian decision model to route this ticket and assess whether it needs escalation." |
| About Bailian CLI | "Tell me what Bailian CLI can do for me, and suggest how to use it for my needs." |

> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
Expand Down
1 change: 1 addition & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex
| 监控与告警 | “查看我的模型调用统计、失败明细和调用日志,并创建一条告警规则。” |
| 吞吐预留 | “查看我的吞吐预留及容量实例,并对容量进行扩缩、续订或释放,再等待操作完成。” |
| 模型选型 | “推荐一个适合图片理解和智能客服的模型。” |
| 决策模型 | “用百炼决策模型给这张工单分流,并判断是否需要升级处理。” |
| 了解 Bailian CLI | “介绍一下 Bailian CLI 能帮我完成哪些任务,并根据我的需求推荐使用方式。” |

> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
Expand Down
1 change: 1 addition & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Once installed, just describe your task to your AI Agent — no need to assemble
| Monitoring & alerts | "Show my model call stats, failures and logs, and create an alert rule." |
| Throughput reservations | "List my throughput reservations and capacity instances, then scale, renew or release capacity and wait for the operation to finish." |
| Model selection | "Recommend a model for image understanding and customer support." |
| Decision model | "Use the Bailian decision model to route this ticket and assess whether it needs escalation." |
| About Bailian CLI | "Tell me what Bailian CLI can do for me, and suggest how to use it for my needs." |

> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
Expand Down
1 change: 1 addition & 0 deletions packages/cli/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ irm https://bailian.aliyun.com/cli/install.ps1 | iex
| 监控与告警 | “查看我的模型调用统计、失败明细和调用日志,并创建一条告警规则。” |
| 吞吐预留 | “查看我的吞吐预留及容量实例,并对容量进行扩缩、续订或释放,再等待操作完成。” |
| 模型选型 | “推荐一个适合图片理解和智能客服的模型。” |
| 决策模型 | “用百炼决策模型给这张工单分流,并判断是否需要升级处理。” |
| 了解 Bailian CLI | “介绍一下 Bailian CLI 能帮我完成哪些任务,并根据我的需求推荐使用方式。” |

> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
Expand Down
18 changes: 18 additions & 0 deletions packages/cli/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
videoTaskGet,
videoDownload,
visionDescribe,
decisionPredict,
configShow,
configSet,
configList,
Expand Down Expand Up @@ -154,6 +155,14 @@ import {
finetuneWatch,
finetuneCapability,
finetunePrice,
finetuneCompressTemplates,
finetuneCompressCreate,
finetuneCompressList,
finetuneCompressGet,
finetuneCompressWatch,
finetuneCompressLogs,
finetuneCompressCancel,
finetuneCompressDelete,
deployTextCreate,
deployAudioCreate,
deployImageCreate,
Expand Down Expand Up @@ -298,6 +307,7 @@ export const commands: Record<string, AnyCommand> = {
"video task get": videoTaskGet,
"video download": videoDownload,
"vision describe": visionDescribe,
decision: decisionPredict,
"config show": configShow,
"config set": configSet,
"config list": configList,
Expand Down Expand Up @@ -440,6 +450,14 @@ export const commands: Record<string, AnyCommand> = {
"finetune watch": finetuneWatch,
"finetune capability": finetuneCapability,
"finetune price": finetunePrice,
"finetune compress templates": finetuneCompressTemplates,
"finetune compress create": finetuneCompressCreate,
"finetune compress list": finetuneCompressList,
"finetune compress get": finetuneCompressGet,
"finetune compress watch": finetuneCompressWatch,
"finetune compress logs": finetuneCompressLogs,
"finetune compress cancel": finetuneCompressCancel,
"finetune compress delete": finetuneCompressDelete,
"deploy text create": deployTextCreate,
"deploy audio create": deployAudioCreate,
"deploy image create": deployImageCreate,
Expand Down
35 changes: 20 additions & 15 deletions packages/commands/src/commands/dataset/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
formatIssue,
MAX_DATASET_BYTES,
MAX_CPT_BYTES,
MAX_DECISION_DATASET_BYTES,
MAX_MEDIA_ZIP_BYTES,
BailianError,
ExitCode,
Expand All @@ -18,9 +19,10 @@ const UPLOAD_FLAGS = {
type: "string",
valueHint: "<path>",
description: {
"en-US": "Local dataset file (.jsonl or .zip; ≤200MB SFT/DPO, ≤300MB CPT, ≤2GB media zip)",
"en-US":
"Local dataset file (.jsonl or .zip; ≤200MB SFT/DPO, ≤300MB CPT/decision, ≤2GB media zip)",
"zh-CN":
"本地数据集文件(.jsonl 或 .zip;SFT/DPO 不超过 200MB,CPT 不超过 300MB,媒体 ZIP 不超过 2GB)",
"本地数据集文件(.jsonl 或 .zip;SFT/DPO 不超过 200MB,CPT/决策模型不超过 300MB,媒体 ZIP 不超过 2GB)",
},
required: true,
},
Expand All @@ -37,9 +39,9 @@ const UPLOAD_FLAGS = {
valueHint: "<s>",
description: {
"en-US":
'Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "tts" (audio), "image" (image generation), or "video" (video generation). Default auto-detects per record.',
'Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "decision" (state/questions), "tts" (audio), "image" (image generation), or "video" (video generation). Default auto-detects per record.',
"zh-CN":
'记录 Schema:"chatml"(SFT)、"dpo"(chosen/rejected)、"cpt"(原始文本)、"tts"(音频)、"image"(图片生成)或 "video"(视频生成)。默认逐条自动识别。',
'记录 Schema:"chatml"(SFT)、"dpo"(chosen/rejected)、"cpt"(原始文本)、"decision"(state/questions 决策数据)、"tts"(音频)、"image"(图片生成)或 "video"(视频生成)。默认逐条自动识别。',
},
},
noValidate: {
Expand All @@ -65,12 +67,13 @@ export default defineCommand({
},
auth: "apiKey",
usageArgs:
"--file <path> [--purpose <name>] [--schema <chatml|dpo|cpt|tts|image|video>] [--no-validate] [--full-validate]",
"--file <path> [--purpose <name>] [--schema <chatml|dpo|cpt|decision|tts|image|video>] [--no-validate] [--full-validate]",
flags: UPLOAD_FLAGS,
exampleArgs: [
"--file train.jsonl",
"--file dpo.jsonl --schema dpo",
"--file cpt.jsonl --schema cpt",
"--file decision.jsonl --schema decision",
"--file audio.zip --schema tts",
"--file eval.jsonl --purpose evaluation",
"--file train.jsonl --full-validate",
Expand All @@ -79,35 +82,37 @@ export default defineCommand({
notes: [
{
"en-US":
'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).',
'Supports .jsonl (text/decision) and .zip (audio/image/video archives with a data.jsonl manifest). Seven record schemas are recognized: chatml = {messages:[...]} (SFT); dpo = {messages:[...], chosen, rejected}; cpt = {text:"..."}; decision = {state:{content}, questions:{...}}; tts = {wav_fn:"train/xxx.wav", text:"..."}; image = {img_path:"..."}; video = {first_frame_path:...}.',
"zh-CN":
'支持 .jsonl(文本)和 .zip(包含 data.jsonl 清单的音频、图片或视频归档)。可识别六种记录 Schema:chatml = {messages:[...]}(SFT);dpo = {messages:[...], chosen, rejected};cpt = {text:"..."}(持续预训练,原始文本);tts = {wav_fn:"train/xxx.wav", text:"..."}(音频微调);image = {img_path:"..."}(图片生成);video = {first_frame_path:...}(视频生成)。',
'支持 .jsonl(文本/决策)和 .zip(包含 data.jsonl 清单的音频、图片或视频归档)。可识别七种记录 Schema:chatml = {messages:[...]}(SFT);dpo = {messages:[...], chosen, rejected};cpt = {text:"..."};decision = {state:{content}, questions:{...}};tts = {wav_fn:"train/xxx.wav", text:"..."};image = {img_path:"..."};video = {first_frame_path:...}。',
},
{
"en-US":
"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.",
"With no --schema, state/questions is validated as decision data, wav_fn as TTS, img_path as image, chosen/rejected as DPO, text (no messages) as CPT, otherwise ChatML.",
"zh-CN":
"未指定 --schema 时,包含 wav_fn 的记录按 TTS 验证,包含 img_path 的按 image 验证,包含 chosen/rejected 的按 DPO 验证,仅含 text(无 messages)的按 CPT 验证,其他记录按 ChatML 验证。",
"未指定 --schema 时,state/questions 记录按 decision 验证,包含 wav_fn 的按 TTS 验证,包含 img_path 的按 image 验证,包含 chosen/rejected 的按 DPO 验证,仅含 text(无 messages)的按 CPT 验证,其他记录按 ChatML 验证。",
},
{
"en-US":
"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).",
"Upload cap: 200MB SFT/DPO text, 300MB CPT/decision data, 2GB media zip. For decision files over 200MB, pass --schema decision so the correct cap is applied. Upload uses the OpenAI-compatible /compatible-mode/v1/files endpoint so the purpose tag is persisted.",
"zh-CN":
"上传上限:SFT/DPO 文本 200MB、CPT 300MB、媒体 ZIP 2GB。上传使用 OpenAI 兼容的 /compatible-mode/v1/files Endpoint,以便保留 purpose 标签;DashScope 原生 /api/v1/files 会丢弃该标签。",
"上传上限:SFT/DPO 文本 200MB、CPT/决策模型数据 300MB、媒体 ZIP 2GB。决策数据超过 200MB 时请显式传入 --schema decision,以应用正确上限。上传使用 OpenAI 兼容的 /compatible-mode/v1/files 接口,以确保持久化 purpose 标签。",
},
],
async run(ctx) {
const { identity, settings, flags } = ctx;
const filePath = flags.file;
const purpose = flags.purpose || "fine-tune";
const schema = parseDatasetSchemaFlag(flags.schema);
// Size caps differ per training type: SFT/DPO 200MB, CPT 300MB, media ZIP 2GB.
// 大小上限按平台数据类型区分;自动识别仍采用保守的文本上限,避免放宽已有格式。
const isMediaSchema = schema === "image" || schema === "video";
const maxBytes = isMediaSchema
? MAX_MEDIA_ZIP_BYTES
: schema === "cpt"
? MAX_CPT_BYTES
: MAX_DATASET_BYTES;
: schema === "decision"
? MAX_DECISION_DATASET_BYTES
: schema === "cpt"
? MAX_CPT_BYTES
: MAX_DATASET_BYTES;

if (!flags.noValidate) {
const result = await validateDataset(filePath, {
Expand Down
Loading
Loading