Skip to content
Open
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
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal
- **Web search** — Real-time internet retrieval for up-to-date, accurate answers
- **Model recommendation** — Describe your scenario and get best-fit model suggestions; supports scoped search, model comparison, and alternative discovery
- **Fine-tuning & deployment** — Upload datasets, create SFT/LoRA/DPO/CPT jobs (`finetune create`), probe job status non-blockingly (`finetune watch`), query per-model training capability (`finetune capability`), and deploy trained models as endpoints (`deploy create`)
- **Console capabilities** — Browse Bailian apps (`app list`), check free-tier quota (`usage free`), view model usage statistics (`usage stats`), manage workspaces (`workspace list`), and manage rate limits (`quota list/request/check/history`)
- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity

Expand Down Expand Up @@ -111,22 +112,30 @@ bl advisor recommend --message "qwen-max vs deepseek-v3 for code generation"
# Browser login (required for console capability commands)
bl auth login --console

# Fine-tune & deploy — a one-shot train-to-serve workflow
bl dataset upload --file ./train.jsonl # Upload a .jsonl dataset (validated first)
bl finetune create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # Local paths auto-upload
bl finetune watch --job-id ft-xxx --output json # Non-blocking status probe (exit 0/1/3 = done/failed/running)
bl finetune capability --model qwen3-8b # Which training types a model supports
bl deploy create --model qwen3-8b --name my-svc --plan mu # Deploy the trained model as an endpoint

# Browse apps / free-tier quota / usage statistics / workspaces
bl app list
bl usage free --model qwen3-max
bl usage free --expiring 30 # Quotas expiring within 30 days
bl usage free --sort remaining # Sort by remaining % ascending
bl usage stats --workspace-id <id> # Usage overview for a workspace
bl usage stats --model qwen-turbo --workspace-id <id> # Per-model usage
bl usage free # Free-tier quota across models (add --model/--expiring/--sort)
bl usage stats --workspace-id <id> # Model usage statistics (add --model for per-model)
bl workspace list # List all workspaces

# Rate limit management
bl quota list # View RPM/TPM limits for all models
bl quota list --model qwen3.6-plus # View limits for a specific model
bl quota check # Current usage vs rate limits
bl quota check --model qwen3.6-plus --period 5 # Check usage over last 5 minutes
# Rate limit management (list / check / request / history)
bl quota list # View RPM/TPM limits (add --model to filter)
bl quota check # Current usage vs rate limits (add --model/--period)
bl quota request --model qwen3.6-plus --tpm 6000000 # Request a temporary TPM increase
bl quota history # View quota change history
bl quota history # View quota-change history

# Token Plan team management (requires AK/SK, see auth below)
bl token-plan list-seats # View subscription seat details
bl token-plan add-member --account-name dev --org-id org_xxx
bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx
bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx
```

> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
Expand Down Expand Up @@ -156,9 +165,9 @@ Required for console capability commands (`app list`, `usage free`, `usage stats
bl auth login --console
```

### Alibaba Cloud AK/SK (Knowledge Base only)
### Alibaba Cloud AK/SK (Knowledge Base & Token Plan)

Required for `knowledge retrieve`. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).
Required for `knowledge retrieve` and the `token-plan` command group. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).

> Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK.

Expand Down
38 changes: 25 additions & 13 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具
- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性
- **模型推荐** — 描述你的场景,智能推荐最适合的模型;支持限定范围搜索、模型对比和替代发现
- **微调与部署** — 上传数据集、创建 SFT/LoRA/DPO/CPT 调优任务(`finetune create`)、非阻塞探测任务状态(`finetune watch`)、按模型查训练能力(`finetune capability`),并把训练好的模型部署为推理服务(`deploy create`)
- **控制台能力** — 浏览百炼应用(`app list`),查询模型免费额度(`usage free`),查看模型用量统计(`usage stats`),管理业务空间(`workspace list`),管理限流与提额(`quota list/request/check/history`)
- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时

Expand Down Expand Up @@ -82,7 +83,10 @@ npx skills add modelstudioai/cli --all -g
## 快速开始

```bash
# 认证
# 认证(推荐浏览器登录)
bl auth login --console

# 或使用 API key 认证
bl auth login --api-key sk-xxxxx

# 和通义千问对话
Expand All @@ -106,22 +110,30 @@ bl advisor recommend --message "qwen-max 和 deepseek-v3 哪个更适合做代
# 浏览器登录(控制台能力相关命令需要)
bl auth login --console

# 微调与部署 — 从训练到服务的一站式流程
bl dataset upload --file ./train.jsonl # 上传 .jsonl 数据集(先校验)
bl finetune create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # 本地路径自动上传
bl finetune watch --job-id ft-xxx --output json # 非阻塞状态探测(退出码 0/1/3 = 成功/失败/进行中)
bl finetune capability --model qwen3-8b # 查询模型支持哪些训练方式
bl deploy create --model qwen3-8b --name my-svc --plan mu # 把训练好的模型部署为推理服务

# 浏览应用 / 免费额度 / 用量统计 / 业务空间
bl app list
bl usage free --model qwen3-max
bl usage free --expiring 30 # 30 天内过期的额度
bl usage free --sort remaining # 按剩余百分比升序排列
bl usage stats --workspace-id <id> # 指定空间的用量概览
bl usage stats --model qwen-turbo --workspace-id <id> # 指定模型用量
bl usage free # 各模型免费额度(可加 --model/--expiring/--sort)
bl usage stats --workspace-id <id> # 模型用量统计(加 --model 查单模型)
bl workspace list # 列出所有业务空间

# 限流管理与提额
bl quota list # 查看所有模型的 RPM/TPM 限额
bl quota list --model qwen3.6-plus # 查看指定模型限额
bl quota check # 查看当前用量 vs 限流阈值
bl quota check --model qwen3.6-plus --period 5 # 查看最近 5 分钟用量
# 限流管理与提额(list / check / request / history)
bl quota list # 查看 RPM/TPM 限额(加 --model 过滤)
bl quota check # 当前用量 vs 限流阈值(加 --model/--period)
bl quota request --model qwen3.6-plus --tpm 6000000 # 申请临时 TPM 提额
bl quota history # 查看提额历史记录

# Token Plan 团队版管理(需 AK/SK,见下方认证说明)
bl token-plan list-seats # 查看订阅席位明细
bl token-plan add-member --account-name dev --org-id org_xxx
bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx
bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx
```

> 更多案例与使用场景:[阿里云百炼 CLI 官方主页](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
Expand Down Expand Up @@ -151,9 +163,9 @@ bl text chat --api-key sk-xxxxx --message "你好"
bl auth login --console
```

### 阿里云 AK/SK(仅知识库检索
### 阿里云 AK/SK(知识库检索与 Token Plan

`knowledge retrieve` 命令需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。
`knowledge retrieve` 与 `token-plan` 命令组需要阿里云 AccessKey。前往 [RAM 控制台](https://ram.console.aliyun.com/manage/ak) 获取。

> 建议:创建 RAM 子账号并授予最小权限,避免使用主账号 AK/SK。

Expand Down
35 changes: 22 additions & 13 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal
- **Web search** — Real-time internet retrieval for up-to-date, accurate answers
- **Model recommendation** — Describe your scenario and get best-fit model suggestions; supports scoped search, model comparison, and alternative discovery
- **Fine-tuning & deployment** — Upload datasets, create SFT/LoRA/DPO/CPT jobs (`finetune create`), probe job status non-blockingly (`finetune watch`), query per-model training capability (`finetune capability`), and deploy trained models as endpoints (`deploy create`)
- **Console capabilities** — Browse Bailian apps (`app list`), check free-tier quota (`usage free`), view model usage statistics (`usage stats`), manage workspaces (`workspace list`), and manage rate limits (`quota list/request/check/history`)
- **Local file auto-upload** — Every URL parameter accepts a local path; uploaded to free temp storage with 48-hour validity

Expand Down Expand Up @@ -111,22 +112,30 @@ bl advisor recommend --message "qwen-max vs deepseek-v3 for code generation"
# Browser login (required for console capability commands)
bl auth login --console

# Fine-tune & deploy — a one-shot train-to-serve workflow
bl dataset upload --file ./train.jsonl # Upload a .jsonl dataset (validated first)
bl finetune create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # Local paths auto-upload
bl finetune watch --job-id ft-xxx --output json # Non-blocking status probe (exit 0/1/3 = done/failed/running)
bl finetune capability --model qwen3-8b # Which training types a model supports
bl deploy create --model qwen3-8b --name my-svc --plan mu # Deploy the trained model as an endpoint

# Browse apps / free-tier quota / usage statistics / workspaces
bl app list
bl usage free --model qwen3-max
bl usage free --expiring 30 # Quotas expiring within 30 days
bl usage free --sort remaining # Sort by remaining % ascending
bl usage stats --workspace-id <id> # Usage overview for a workspace
bl usage stats --model qwen-turbo --workspace-id <id> # Per-model usage
bl usage free # Free-tier quota across models (add --model/--expiring/--sort)
bl usage stats --workspace-id <id> # Model usage statistics (add --model for per-model)
bl workspace list # List all workspaces

# Rate limit management
bl quota list # View RPM/TPM limits for all models
bl quota list --model qwen3.6-plus # View limits for a specific model
bl quota check # Current usage vs rate limits
bl quota check --model qwen3.6-plus --period 5 # Check usage over last 5 minutes
# Rate limit management (list / check / request / history)
bl quota list # View RPM/TPM limits (add --model to filter)
bl quota check # Current usage vs rate limits (add --model/--period)
bl quota request --model qwen3.6-plus --tpm 6000000 # Request a temporary TPM increase
bl quota history # View quota change history
bl quota history # View quota-change history

# Token Plan team management (requires AK/SK, see auth below)
bl token-plan list-seats # View subscription seat details
bl token-plan add-member --account-name dev --org-id org_xxx
bl token-plan assign-seats --workspace-id ws_xxx --seat-type standard --account-id acc_xxx
bl token-plan create-key --account-id acc_xxx --workspace-id ws_xxx
```

> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)
Expand Down Expand Up @@ -156,9 +165,9 @@ Required for console capability commands (`app list`, `usage free`, `usage stats
bl auth login --console
```

### Alibaba Cloud AK/SK (Knowledge Base only)
### Alibaba Cloud AK/SK (Knowledge Base & Token Plan)

Required for `knowledge retrieve`. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).
Required for `knowledge retrieve` and the `token-plan` command group. Get your AccessKey from [RAM Console](https://ram.console.aliyun.com/manage/ak).

> Recommended: create a RAM sub-account with minimum privileges instead of using the root account's AK/SK.

Expand Down
28 changes: 17 additions & 11 deletions packages/cli/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具
- **联网搜索** — 实时互联网信息检索,提升回答准确性及时效性
- **模型推荐** — 描述你的场景,智能推荐最适合的模型;支持限定范围搜索、模型对比和替代发现
- **微调与部署** — 上传数据集、创建 SFT/LoRA/DPO/CPT 调优任务(`finetune create`)、非阻塞探测任务状态(`finetune watch`)、按模型查训练能力(`finetune capability`),并把训练好的模型部署为推理服务(`deploy create`)
- **控制台能力** — 浏览百炼应用(`app list`),查询模型免费额度(`usage free`),查看模型用量统计(`usage stats`),管理业务空间(`workspace list`),管理限流与提额(`quota list/request/check/history`)
- **本地文件自动上传** — 所有 URL 参数同时支持本地路径,免费临时存储 48 小时

Expand Down Expand Up @@ -82,7 +83,10 @@ npx skills add modelstudioai/cli --all -g
## 快速开始

```bash
# 认证
# 认证(推荐浏览器登录)
bl auth login --console

# 或使用 API key 认证
bl auth login --api-key sk-xxxxx

# 和通义千问对话
Expand All @@ -106,20 +110,22 @@ bl advisor recommend --message "qwen-max 和 deepseek-v3 哪个更适合做代
# 浏览器登录(控制台能力相关命令需要)
bl auth login --console

# 微调与部署 — 从训练到服务的一站式流程
bl dataset upload --file ./train.jsonl # 上传 .jsonl 数据集(先校验)
bl finetune create --model qwen3-8b --datasets ./train.jsonl --training-type sft-lora # 本地路径自动上传
bl finetune watch --job-id ft-xxx --output json # 非阻塞状态探测(退出码 0/1/3 = 成功/失败/进行中)
bl finetune capability --model qwen3-8b # 查询模型支持哪些训练方式
bl deploy create --model qwen3-8b --name my-svc --plan mu # 把训练好的模型部署为推理服务

# 浏览应用 / 免费额度 / 用量统计 / 业务空间
bl app list
bl usage free --model qwen3-max
bl usage free --expiring 30 # 30 天内过期的额度
bl usage free --sort remaining # 按剩余百分比升序排列
bl usage stats --workspace-id <id> # 指定空间的用量概览
bl usage stats --model qwen-turbo --workspace-id <id> # 指定模型用量
bl usage free # 各模型免费额度(可加 --model/--expiring/--sort)
bl usage stats --workspace-id <id> # 模型用量统计(加 --model 查单模型)
bl workspace list # 列出所有业务空间

# 限流管理与提额
bl quota list # 查看所有模型的 RPM/TPM 限额
bl quota list --model qwen3.6-plus # 查看指定模型限额
bl quota check # 查看当前用量 vs 限流阈值
bl quota check --model qwen3.6-plus --period 5 # 查看最近 5 分钟用量
# 限流管理与提额(list / check / request / history)
bl quota list # 查看 RPM/TPM 限额(加 --model 过滤)
bl quota check # 当前用量 vs 限流阈值(加 --model/--period)
bl quota request --model qwen3.6-plus --tpm 6000000 # 申请临时 TPM 提额
bl quota history # 查看提额历史记录

Expand Down
44 changes: 44 additions & 0 deletions packages/cli/src/commands/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ import searchWeb from "./search/web.ts";
import speechSynthesize from "./speech/synthesize.ts";
import speechRecognize from "./speech/recognize.ts";
import fileUpload from "./file/upload.ts";
import datasetUpload from "./dataset/upload.ts";
import datasetList from "./dataset/list.ts";
import datasetGet from "./dataset/get.ts";
import datasetDelete from "./dataset/delete.ts";
import datasetValidate from "./dataset/validate.ts";
import finetuneCreate from "./finetune/create.ts";
import finetuneList from "./finetune/list.ts";
import finetuneGet from "./finetune/get.ts";
import finetuneCancel from "./finetune/cancel.ts";
import finetuneDelete from "./finetune/delete.ts";
import finetuneLogs from "./finetune/logs.ts";
import finetuneCheckpoints from "./finetune/checkpoints.ts";
import finetuneExport from "./finetune/export.ts";
import finetuneWatch from "./finetune/watch.ts";
import finetuneCapability from "./finetune/capability.ts";
import deployCreate from "./deploy/create.ts";
import deployList from "./deploy/list.ts";
import deployGet from "./deploy/get.ts";
import deployModels from "./deploy/models.ts";
import deployScale from "./deploy/scale.ts";
import deployUpdate from "./deploy/update.ts";
import deployDelete from "./deploy/delete.ts";
import consoleCall from "./console/call.ts";
import usageFree from "./usage/free.ts";
import usageFreetier from "./usage/freetier.ts";
Expand Down Expand Up @@ -83,6 +105,28 @@ export const commands: Record<string, Command> = {
"speech synthesize": speechSynthesize,
"speech recognize": speechRecognize,
"file upload": fileUpload,
"dataset upload": datasetUpload,
"dataset list": datasetList,
"dataset get": datasetGet,
"dataset delete": datasetDelete,
"dataset validate": datasetValidate,
"finetune create": finetuneCreate,
"finetune list": finetuneList,
"finetune get": finetuneGet,
"finetune cancel": finetuneCancel,
"finetune delete": finetuneDelete,
"finetune logs": finetuneLogs,
"finetune checkpoints": finetuneCheckpoints,
"finetune export": finetuneExport,
"finetune watch": finetuneWatch,
"finetune capability": finetuneCapability,
"deploy create": deployCreate,
"deploy list": deployList,
"deploy get": deployGet,
"deploy models": deployModels,
"deploy scale": deployScale,
"deploy update": deployUpdate,
"deploy delete": deployDelete,
"console call": consoleCall,
"usage free": usageFree,
"usage freetier": usageFreetier,
Expand Down
Loading