modelstudioai/cli

bailian-finetune

阿里云百炼模型精调训练入口:用户要精调、微调、训练自己的模型(fine-tune,支持 SFT / SFT-LoRA / DPO / DPO-LoRA / CPT, 覆盖文本、语音、图像)、校验或上传训练数据集、看训练进度和日志、挑 checkpoint、导出精调产物、 把专属模型部署成服务时使用 bl dataset / bl finetune / bl deploy。链路是 validate 校验数据 → upload 拿 file-id → finetune create 建任务 → watch 看进度…

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/modelstudioai/cli --skill bailian-finetune

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

Bailian fine-tuning pipeline (bl dataset / bl finetune / bl deploy)

CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Version & updates (pre-flight checklist), Call attribution (every Agent `bl` command), Setup & auth, and CLI errors: report an issue. Command details are authoritative in [`reference/`](reference/index.md) (dataset / finetune / deploy) and `bl <command> --help` — do not guess flags. Examples in `reference/` stay bare; wrap with Call attribution when running. The training pipeline uses an API key; Console dataset-version and independent-deployment queries use Console authentication. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.

Call attribution: Examples below and in reference/ stay bare bl …. When running a command, wrap it with `bailian-protocol` → Call attribution (bash or PowerShell). One sample for this skill (BAILIAN_SKILL_NAME=bailian-finetune; replace codex with this host). After deploy, bl text chat is owned by bailian-cli. When copying commands into a reusable script / template / task definition, switch to the protocol `script` template (never keep `agent`); the sample below is for this-turn inline execution only. Strip attribution when handing a command to the user to paste.

bash
BAILIAN_CALLER_TYPE=agent BAILIAN_CALLER_NAME=codex BAILIAN_SKILL_NAME=bailian-finetune BAILIAN_SKILL_VERSION=<metadata.version> bl dataset validate --file train.jsonl

End-to-end workflow (follow in order)

1. Validate data   bl dataset validate --file train.jsonl [--schema chatml|dpo|cpt|tts|image]
2. Upload data     bl dataset upload --file train.jsonl          # returns a file-id
3. Create job      bl finetune text|audio|image create --base-model <base> --datasets <file-id|path>
4. Watch progress  bl finetune watch --job-id ft-xxx             # or get / logs
5. Pick artifact   bl finetune checkpoints --job-id ft-xxx
6. Export model    bl finetune export --job-id ft-xxx --checkpoint ckpt-N --model-name my-model
7. Compress model  bl finetune compress templates --model my-model       # optional; full-parameter models only
                   bl finetune compress create --model my-model --template-id <template-id>
                   bl finetune compress watch --job-id quant-xxx --follow
8. Deploy service  bl deploy text|audio|image create --model-name <my-model|quantized-output> --display-name my-svc
  • Unsure which training methods a base model supports → bl finetune capability --base-model <base> or --training-type sft|sft-lora|dpo|cpt.
  • Text --training-type values: sft / sft-lora / dpo / dpo-lora / cpt. Audio bases include cosyvoice-v3-flash; image bases include wan2.7-image-pro.
  • Deployment plans: audio defaults to --plan mu; text/image default to lora.
  • For risk: high or requires_confirmation, follow bailian-protocol; never add --yes automatically.

When to use which command

IntentCommand
Validate / upload training databl dataset validate / upload (.jsonl or .zip)
Dataset list / detail / deletebl dataset list / get / delete
Console dataset groups / discover version and file IDsbl dataset groups → bl dataset version --dataset-group-id <group-id> (Console auth)
Console version detail / import and release statebl dataset version --dataset-id <version-id> (Console auth; optional --include-status)
Console independent deployment servicesbl deploy instances (Console auth; not capacity instances or replicas)
Create a fine-tuning job`bl finetune text\audio\image create`
Job list / detail / followbl finetune list / get / watch / logs
Artifacts and exportbl finetune checkpoints / export
Quantize / compress a full modelbl finetune compress templates / create / watch / get / logs / list
Cancel / delete a compression jobbl finetune compress cancel / delete
Cancel / delete a fine-tuning jobbl finetune cancel / delete
Import an external OSS LoRA modelHand-off: bl cmodel import * — hub-owned commands; see bailian-cli reference or bl cmodel --help
Trainable capability lookupbl finetune capability
Deploy / lifecycle`bl deploy text\audio\image create, list / get / update / scale / delete / models`
Query throughput reservationsbl deploy list --plan ptu / bl deploy get
Query capacity instancesbl deploy capacity list / get
Query / wait for a capacity operationbl deploy operation get / wait
Buy / scale / renew / release capacitybl deploy capacity create / scale / renew / delete
Unsubscribe a prepaid instancebl deploy capacity unsubscribe (builds the billing console refund link)
Configure ModelCode overflow strategybl deploy overflow

The capacity list / get, operation get / wait and deploy list / get queries are read-only. Capacity values are kTPM; effective, configured and target capacities are distinct. deploy list --status filters only the fetched page locally, with the server total left unfiltered. operation get reports status as data; operation wait exits non-zero on failure or timeout and refreshes capacity after success. Use IDs returned by the API; waiting never retries a write.

The capacity create / scale / renew / delete and overflow commands are high-risk writes: preview with --dry-run, then confirm with the runtime-injected --yes. Each write is submitted once and never auto-retried; HTTP 200 is not success, so pass --wait or check operation_status. Scale values are one instance's absolute kTPM, not deltas or ModelCode totals, and zero is not release. capacity delete releases an instance but keeps the ModelCode; active prepaid instances cannot be DELETEd — run capacity unsubscribe --instance-id <id> to get the billing console refund link and finish there (no API exists for refunds). Release is confirmed by deleted=true. overflow applies to the whole ModelCode, not one instance. There is no estimator or standalone auto-renewal endpoint — renewal settings ride along purchase/scale/renew.

Console reads are separate from API-key file/deployment queries; the API Key / file_id semantics of dataset list are unchanged. Discover records[].datasetGroupId with dataset groups, then pass it to dataset version --dataset-group-id <group-id> to get {result:[...]} with result[].datasetId and an optional fileId. Use dataset version --dataset-id <version-id> for details; exactly one of --dataset-group-id and --dataset-id is required, and they cannot be combined. fileId is not datasetId; never pass a file ID from dataset list as a Console version ID. Groups are paginated and contain only one nested version preview; version --dataset-group-id normalizes array responses to result without promising exhaustive results or exposing pagination. Keep the same workspace throughout this chain. --include-status is available only in detail mode (dataset version --dataset-id <version-id> --include-status) and preserves raw version and task state; missing/unknown state never means validation success or training readiness, and the returned task is not guaranteed to be the latest. A failed follow-up query retains metadata and exits nonzero. deploy instances returns one page (records is the list, items the total); reading does not establish inference or pause permission. With --workspace-id, these commands resolve that workspace's Console identity before business requests and stop on resolution failure. For an error-report file key, hand off to bailian-cli (file url); an existing report URL can be used directly.

Flags, usage, and examples: see `reference/` or bl <command> --help — do not guess flags.

Quick examples

bash
bl dataset validate --file train.jsonl
bl dataset upload --file train.jsonl
bl finetune text create --base-model qwen3-8b --training-type sft-lora --datasets file-xxx
bl finetune watch --job-id ft-xxx
bl finetune export --job-id ft-xxx --checkpoint ckpt-3 --model-name my-qwen-sft
# Optional quantization (Beijing region; full-parameter fine-tuned models only)
bl finetune compress templates --model my-qwen-sft
bl finetune compress create --model my-qwen-sft --template-id quant-xxx --suffix int4
bl finetune compress watch --job-id quant-xxx --follow
bl deploy text create --model-name <my-qwen-sft-or-quantized-output> --display-name my-svc

Common hand-offs

软 hand-off(按 skill 名;已安装则 Read,否则 --help / 提示 bl skill init):

  • After deployment, try the model or generate content → skill bailian-gen (media) or bl text chat (fallback: bl image\|video\|text --help).
  • Unsure which base model to pick → bailian-model-recommend / bl advisor recommend.
  • Training quota / usage questions → skill bailian-cli (fallback: bl quota / bl usage --help).

references

from this repository

More skills

All skills
modelstudioai
Community

bailian-opd

Guided end-to-end pure Model OPD distillation (pgopd) on Alibaba Cloud Bailian: authorize → dataset validate → parameter probes → dry-run consent gate → confirmed submit → verified terminal state, driven by deterministic scripts. Use when the user wants to distill a student model from a teacher model (teachermodel / OPD / 蒸馏 / 在线蒸馏) and run the whole creation chain safely. Not for RL / agentic rollout training, SFT/DPO/CPT fine-tuning, or deployment (those go to bailian-finetune); not for model

1h installs
1
GitHub stars
371
Updated
Nov 20
modelstudioai
Community

bailian-cli

阿里云百炼 / Aliyun Bailian / DashScope 资源管理与 bl CLI hub: 应用调用与管理(bl flow-agent:调用/创建/更新/发布/删除/复制/版本、工作流画布;旧 bl app call/list 已废弃)、决策模型推理(bl decision)、模型目录/模型列表、用量/额度/配额、免费额度、 工作空间、MCP 市场、pipeline、文件上传、ParseX 文档/音视频解析与字段抽取、Batch 批量推理与 CSV 转换、同步 Batch Chat、console API、登录鉴权与配置、 Agent skill 安装/列表/更新/卸载(bl skill add|list|update|remove,百炼 skill registry)。 用户点名百炼 / DashScope / bl,或继续既有 bl 工作流时直接使用。 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 bl skill init。 家族路由:生图/生视频/配音/语音合成/转写 → bailian-gen;精

1h installs
4
GitHub stars
372
Updated
Nov 13
modelstudioai
Community

bailian-gen

阿里云百炼图片/视频/语音生成与理解入口:用户要生图、画图、生成照片、生成图片、AI 绘画、海报、头像、插画、 文生图(text-to-image)、图生图、改图、修图、多图合成、生成视频、文生视频、图生视频、参考生视频、视频编辑、风格转换、 配音、语音合成(TTS)、朗读、转写、语音识别(ASR),或图片理解、看图问答、视频理解、读视频、多模态理解时使用 bl image / bl video / bl speech / bl vision describe / bl omni。 默认行为:用户未指定服务商时,生成/编辑默认走本技能;视频理解与宿主放不了的音视频理解也走本技能。 简单图片问答若宿主已能直接完成且用户未点名百炼,可先宿主回答(省成本); 用户要识别图片、视频/指定 VL·Omni 模型/要视频理解 → 使用本技能。 图片和语音同步返回并落地本地文件,视频是异步任务、用 --download 或轮询取回;本地文件直接传路径,CLI 自动上传。 反触发:普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli; 精调训练走 bailian

1h installs
4
GitHub stars
372
Updated
Nov 13
modelstudioai
Community

bailian-knowledge

个人资料接入与知识库使用。当任务需要参考用户自己的历史文档、客户资料、旧方案、会议记录或学习材料时使用, 如“参考以前的资料准备会议”“照旧方案写一版”“之前为什么这样决定”;不要求用户说“知识库”或点名百炼。 用户希望一批资料以后反复使用,或要求接入、更新、查看、暂停、恢复、清理资料库时也使用。 也处理明确的 bl knowledge / kscli 资源操作。纯通用问答、仅总结当前附件、无历史资料需要的写作不触发; 个人偏好与聊天记忆属于 bailian-memory,钉钉文档管理、模型选型与微调不属于本 Skill。

1h installs
4
GitHub stars
372
Updated
Nov 13