Aliyun Model Studio CLI (DashScope)

repository·main·Indexed 42 days ago

https://github.com/modelstudioai/cli

Official command-line interface for the Aliyun Model Studio (DashScope) AI Platform. It provides tools for full-modality generation, asset understanding, app orchestration, and model management. Includes the `bl` command for account and resource management and `kscli` for RAG workflows, including knowledge base creation, document uploading, semantic search, and streaming Q&A.

Tokens
247.7K
Snippets
825
Records
1K
Agent score
56%

What's inside Aliyun Model Studio CLI

  1. Overview of Aliyun Model Studio CLI features

    main

    The Aliyun Model Studio CLI (DashScope) is designed for AI Agents and provides full-modality capabilities. Every command is built to work as a structured tool call.

    Core Capabilities

    • Model Generation: Text, image, video, and speech generation, including editing and reference-based generation.
    • Asset Understanding: Parsing and querying images, documents, audio, and long videos.
    • App Orchestration: Calling Managed Agents, agents, and workflows (including knowledge bases, memory, web search, and MCP tools).
    • Training & Deployment: Dataset validation/upload, model fine-tuning, and deploying models as endpoints.
    • Account Operations: Login, configuration, marketplace access, usage/quota monitoring, and team management.
    • Plan Onboarding: Connecting subscription plans like Token Plan.

    Note: App orchestration, training & deployment, account operations, and plan onboarding are currently only available to China site (aliyun.com) account holders.

  2. Overview of `bailian-gen` commands

    main

    The bailian-gen command set provides access to various generative AI capabilities including image, video, speech, and vision models. Most commands require an API Key for authentication.

    Command Groups

    • image: edit, generate (e.g., Qwen-Image, Wan 2.7)
    • omni: bl omni (Multimodal chat with text + audio output)
    • speech: recognize, synthesize, and vocabulary management (create, delete, get, list, update)
    • video: download, edit, generate, ref (reference-to-video), and task get (status queries)
    • vision: describe (image/video description via Qwen-VL)
  3. Overview of bailian-cli capabilities

    main

    The bailian-cli skill provides an interface for interacting with the Alibaba Cloud Model Studio CLI (bl) resource hub. It allows users to manage the following resources:

    • Apps: Application management.
    • Memory: Managing agent memory/state.
    • RAG: Retrieval-Augmented Generation configurations.
    • Usage/Quota: Monitoring and managing resource consumption.
    • MCP: Model Context Protocol interactions.
    • Hub Reference: Accessing reference/ within the hub.

    It uses the bailian-protocol and can optionally work alongside soft-handoff skills such as bailian-gen, bailian-finetune, bailian-managed-agent, and bailian-web-search.

  4. Overview of the `bl knowledge` CLI

    main

    bl knowledge is the knowledge base command group for the Alibaba Cloud Bailian CLI. It provides full-lifecycle RAG (Retrieval-Augmented Generation) capabilities, including:

    • Knowledge Base Management: Create, view, update, delete, and monitor knowledge bases.
    • Document Management: Upload local files, batch import from OSS, check parsing status, delete, and tag documents.
    • Chunk-level Operations: Directly add, delete, update, or query content slices (chunks) within a knowledge base.
    • Retrieval Service Management: Create, deploy, copy, and delete Q&A or retrieval services (agents); manage draft and published versions.
    • Data Center Management: Manage files, collections (connectors), and categories.
    • Retrieval & Chat: Perform semantic search (search), multi-turn dialogue (chat), or legacy retrieval (retrieve).
  5. Overview of `bailian-finetune` commands

    main

    The bailian-finetune skill provides a suite of CLI commands for managing datasets, model deployments, and fine-tuning jobs. Commands are organized into three main functional groups:

    1. dataset: Manage training data (upload, validate, list, get, delete).
    2. deploy: Manage active model deployments (create text/audio/image deployments, scale, pause, resume, update rate limits).
    3. finetune: Manage the fine-tuning lifecycle (create jobs for text/audio/image/video, watch status, export checkpoints, view logs, estimate price).

    Most commands require an API Key, while deployment management (like pausing/resuming) may require Console authentication.

  6. Overview of Bailian CLI capabilities

    main

    The Aliyun Model Studio (Bailian) CLI provides a unified interface for accessing various AI capabilities via single commands. It is designed to be used by both humans and AI Agents (where each command can serve as a structured tool call).

    Core Features

    • Model Generation: Full-modality generation (text, image, video, audio) including editing and reference-based generation.
    • Material Understanding: Parsing and Q&A for images, documents, audio, and long videos.
    • Application Orchestration: Calling Managed Agents, intelligent agents, and workflows; integrating with knowledge bases, memory, web search, and MCP tools.
    • Model Training & Inference: Dataset validation/upload, model fine-tuning, and deployment of dedicated models.
    • Account Operations: Authentication, UI-based configuration, model market access, usage/quota monitoring, rate limit increases, and team seat management.
    • Subscription Integration: One-click integration for Token Plan and other subscription models.

    Note: Application orchestration, model training, account operations, and subscription features currently only support China-based (aliyun.com) accounts.

  7. What is bailian-kb-dsh?

    main

    bailian-kb-dsh is a plugin for DeepSeek Harness that enables agents to retrieve information from knowledge bases hosted on Aliyun Model Studio (百炼).

    It provides two primary model-facing tools:

    • kb_search: Retrieves raw knowledge slices with scores and source references.
    • kb_chat: Generates complete answers based on the knowledge base.

    The plugin is "service-aware," meaning it automatically injects a list of your deployed retrieval services into the session context. This allows the model to know which agent_id to use for specific queries without guessing.

  8. Use Bailian for media generation and understanding

    main

    The bailian-gen skill provides access to Aliyun Bailian's media capabilities, including image, video, speech, and multimodal (omni/vision) generation and understanding.

    Key Capabilities:

    • Image: Text-to-image generation, editing, and multi-image merging.
    • Video: Text-to-video, image-to-video, video editing, and style transfer.
    • Speech: Text-to-speech (TTS) and speech recognition (ASR).
    • Vision/Omni: Image/video description and multimodal understanding.

    Important Notes:

    • Local Files: You can pass local file paths directly to any command that accepts a URL. The CLI will automatically upload them to DashScope temporary storage (oss://, valid for 48h).
    • Consent: If you haven't explicitly named a provider, the CLI may ask for consent before proceeding due to potential charges.
    • Installation: If commands are missing, run bl skill init to install the necessary skills and the shared bailian-protocol.
    # Example: Generate an image
    bl image generate --prompt "A cat in space" --out-dir ./out/
    
    # Example: Edit an image using a local file
    bl image edit --image ./photo.png --prompt "Add sunset"
    
    # Example: Speech recognition with a local file
    bl speech recognize --url ./meeting.wav
  9. Manage Alibaba Cloud Bailian Knowledge Bases with `bl`

    main

    The bl (bailian-cli) command is used for the full lifecycle management of Alibaba Cloud Bailian Knowledge Bases. This includes creating/updating/deleting knowledge bases, uploading documents (local or OSS), deploying retrieval or Q&A services, managing Chunks, and managing data center categories/files/collections.

    Important Distinction:

    • Use kb_search or kb_chat for daily knowledge retrieval and Q&A (getting evidence or finished answers).
    • Use bl only for management tasks (long-tail operations) and deployment verification.

    bl knowledge search and bl knowledge chat are specifically for debugging draft/beta versions of services after deployment.

  10. Use the `bailian-cli` command reference index

    main
    The bailian-cli command reference provides a quick index of available commands and global flags. Note that this index only covers command groups owned by the bailian-cli skill. For other command groups, look for sibling bailian-* skills. Detailed information for specific command groups can be found in their respective <group>.md files within the same directory.
  11. Use `bl speech` commands for ASR and TTS

    main

    The bl speech command group provides tools for Automatic Speech Recognition (ASR) and Text-to-Speech (TTS) capabilities. These commands require an API Key for authentication.

    Available Commands

    CommandDescription
    bl speech recognizeRecognize speech from audio files (using FunAudio-ASR or Qwen-ASR Flash)
    bl speech synthesizeSynthesize speech from text
    bl speech vocabulary createCreate a precompiled hot-word vocabulary for ASR
    bl speech vocabulary deleteDelete a precompiled hot-word vocabulary
    bl speech vocabulary getGet details of a precompiled hot-word vocabulary
    bl speech vocabulary listList precompiled hot-word vocabularies
    bl speech vocabulary updateReplace the contents of a precompiled hot-word vocabulary