All Products
Search
Document Center

Alibaba Cloud Model Studio:Model import

Last Updated:Jun 06, 2026

The My Models page lets you manage the models that you create and import. On this page, you can import locally trained LoRA models from Object Storage Service (OSS) to the Alibaba Cloud Model Studio platform.

Prerequisites

Before you import a model, ensure that you meet the following requirements:

  • OSS bucket preparation: You have created an OSS bucket and added a tag to the target bucket.

    Note
    • The Archive, Cold Archive, and Deep Cold Archive storage classes are not supported for OSS buckets. Buckets with content encryption and private buckets are supported.

    • Alibaba Cloud Model Studio cannot access files in an OSS bucket's root directory. You must place your files in a subdirectory.

    • You can import model files of any size. Once imported, the models use the free storage space provided by Alibaba Cloud Model Studio.

  • Model file preparation: The model files must meet the import requirements and limitations. The model folder must be placed in a subdirectory of the OSS bucket, and the system will automatically detect it.

Supported base models

You can import LoRA fine-tuned versions of the following base models:

Model series

Model name

Qwen3

Qwen3-32B

Qwen3-14B

Qwen3-8B

Qwen3-4B-Instruct-2507

Qwen3-VL

Qwen3-VL-8B-Instruct

Qwen2.5

Qwen2.5-72B-Instruct

Qwen2.5-32B-Instruct

Qwen2.5-14B-Instruct

Qwen2.5-7B-Instruct

Qwen2.5-VL

Qwen2.5-VL-72B-Instruct

Qwen2.5-VL-7B-Instruct

Procedure

Follow these steps to import a LoRA model from OSS into Alibaba Cloud Model Studio:

  1. On the My Models page, click Import Model.

  2. On the Model Import page, specify the following information:

    • Model name: Enter a display name for the model, up to 50 characters.

    • Base model: Select the base model that corresponds to your LoRA model.

    • Import source: Currently, only **Import from OSS** is supported and is selected by default.

    • Bucket: Select the OSS bucket that stores your model files.

  3. After confirming the information, click OK. The system automatically validates the model file format and integrity. After validation passes, the import process begins. When the import is complete, you can view the model on the My Models page and perform operations such as deployment and incremental training.

Import requirements and limitations

Important

Important: This version supports only importing LoRA (Low-Rank Adaptation) models. You cannot import full-parameter fine-tuned models.

Before you import a LoRA model, ensure that it meets the following requirements:

  • Required files: The OSS bucket must contain the following files:

    • adapter_model.safetensors: The LoRA adapter weights, stored in SafeTensors format.

    • adapter_config.json: The LoRA adapter configuration file, which contains key parameters such as rank and alpha.

  • Rank parameter constraints: The rank value must be 8, 16, 32, or 64. All LoRA layers in the same model must use the same rank value.

  • Models with a modified vocabulary: If you added new tokens or modified the original vocabulary during training, you cannot import the model. The vocabulary must be identical to that of the base model.

  • Models with a modified chat template: If the chat_template configuration was modified during training, you cannot import the model. The chat_template must be identical to the default configuration of the corresponding open-source base model.

    The chat_template configuration is typically found in one of the following locations:

    • The chat_template field in the model's config.json file.

      image

    • The chat_template field in the tokenizer_config.json file.

      image

  • Vision-Language Models with an unfrozen VIT: For Vision-Language (VL) models, the Vision Transformer (VIT) component must be frozen. If the LoRA adapter contains visual-related weight parameters, indicating that the VIT was not frozen, you cannot import the model.

    You can run the following script to check this.

    from safetensors import safe_open
    import argparse
    
    def print_safetensor_structure(file_path):
        print(f"Loading safetensor file: {file_path}")
        print("="*80)
        
        with safe_open(file_path, framework="pt") as f:
            keys = f.keys()
            print(f"Found {len(keys)} tensors in the file:\n")
            
            for key in sorted(keys):
                tensor = f.get_tensor(key)
                shape = tuple(tensor.shape)
                dtype = str(tensor.dtype)
                device = tensor.device if hasattr(tensor, 'device') else 'cpu'
                
                lora_tag = " [LoRA]" if "lora_A" in key or "lora_B" in key else ""
                
                print(f"[{dtype:>14}] {shape} | {key} {lora_tag}")
    
    if __name__ == "__main__":
        parser = argparse.ArgumentParser(description="Print structure of a .safetensors LoRA adapter.")
        parser.add_argument("filepath", type=str, help="Path to the .safetensors file")
        args = parser.parse_args()
    
        print_safetensor_structure(args.filepath)

    How to check: Examine the adapter_model.safetensors file for any visual-related weight parameters. If the file contains any parameter keys that start with visual (for example, visual.encoder.layer.0...), it means the VIT component was not frozen, and the model cannot be imported.

    冻结VIT的adapter文件示例

    未冻结VIT的adapter文件示例(包含visual参数)

FAQ

Why does the imported model behave differently from local inference with vLLM or SGLang?

The Alibaba Cloud Model Studio inference engine might use different default parameters than your local inference framework. To ensure consistent results, we recommend adjusting the following parameters when you call the API:

Parameter

Recommended value

temperature

Value range: [0, 2). A value of 1.0 is equivalent to the vLLM engine's default.

top_p

Value range: (0, 1.0]. A value of 1.0 is equivalent to the vLLM engine's default.

top_k

The vLLM default for top_k is 0, which enables full sampling. Because 0 is not a supported value on this platform, set top_k to a high value like 99 to approximate this behavior.

presence_penalty

Value range: [-2.0, 2.0]. A value of 0 is equivalent to the vLLM engine's default.

repetition_penalty (DashScope protocol)

Increasing repetition_penalty reduces the likelihood of the model repeating itself. A value of 1.0 means no penalty. Value range: > 0. A value of 1.0 is equivalent to the vLLM engine's default.

Note: The parameter values above are based on the default configuration of the vLLM engine. If your local environment uses SGLang or another inference framework, refer to the corresponding documentation to adjust the parameters.

First-time import from OSS

If you are importing files from OSS to Alibaba Cloud Model Studio for the first time, first follow the on-screen prompts to complete the authorization, add the bailian-datahub-access tag to the target OSS Bucket, and then proceed with the import.

If you are unfamiliar with the concepts of main accounts and RAM users, read the Permission Management documentation first.

Use a main account

  1. Click Authorize.

    After selecting Import from OSS as the Import source, the message "You have not authorized OSS access" appears. Click the Authorize link to the right of the message.

  2. In the dialog box that appears, click Confirm Authorization. The system automatically creates an OSS service-linked role, which is a prerequisite.

    This process usually takes only a few seconds but might be delayed during peak hours.
  3. Add the bailian-datahub-access tag to the target OSS Bucket.

    This tag marks the buckets that Alibaba Cloud Model Studio is allowed to access. Alibaba Cloud Model Studio cannot access buckets without this tag.
    1. Go to the OSS Management Console. In the left-side navigation pane, click Bucket List to view your buckets.

    2. In the Tag column for the bucket that you want to tag, hover over the image icon, and then click Edit.

    3. Click Create Tag.

    4. Click Tags, add a tag with the key bailian-datahub-access and the value read, and then click Save.

  4. Return to the Model Import page, reselect the target bucket, and try importing again.

    Note that Alibaba Cloud Model Studio does not support accessing files stored in the root directory of a bucket. You must select an existing folder or create a new one within the bucket for Alibaba Cloud Model Studio to access.

Use a RAM user

  1. Click Authorize.

  2. In the dialog box that appears, click Confirm Authorization. An Authorization Failed error appears with the message The current user does not have permission to create a service-linked role. This is because a RAM user cannot create service-linked roles by default. You must first grant the RAM user this permission, and then grant it permission to access OSS.

    The dialog box shows that the Service Name is datahub.sfm.aliyuncs.com, the service-linked role name is AliyunServiceRoleForSFMDataHubOSSImport, and the required permission is ram:CreateServiceLinkedRole.

  3. Grant the RAM user permission to create the service-linked role.

    1. The main account holder must log in to the RAM Console. In the left-side navigation pane, choose Permission Management > Policies, and then click Create Policy.

    2. In the Script Editor, enter the corresponding content from the following script into Effect, Action, Resource, and Condition, and then click OK.

      {
          "Action": [
              "ram:CreateServiceLinkedRole"
          ],
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
              "StringEquals": {
                  "ram:ServiceName": "datahub.sfm.aliyuncs.com"
              }
          }
      }
    3. Enter a name for the permission policy and click OK.

      For this example, the policy name is CreateServiceLinkedRoleForDataHub.

    4. In the left-side navigation pane, choose Identity > Users. Find the RAM user in the list, and then click Add Permissions in the Actions column.

    5. Select the custom policy that you just created and click OK. The RAM user now has permission to create the required service-linked role.

  4. Authorize the RAM user to access OSS through Alibaba Cloud Model Studio.

    1. Return to the Model Import page and click Authorize again.

      The You have not authorized OSS access message appears after you select Import from OSS as the Import source.

    2. In the dialog box that appears, click Confirm Authorization. The system automatically creates an OSS service-linked role.

      This process usually takes only a few seconds but might be delayed during peak hours.
  5. Add the bailian-datahub-access tag to the target OSS Bucket.

    This tag marks the buckets that Alibaba Cloud Model Studio is allowed to access. Alibaba Cloud Model Studio cannot access buckets without this tag.
    1. Go to the OSS Management Console. In the left-side navigation pane, click Bucket List to view your buckets.

    2. In the Tag column for the bucket that you want to tag, hover over the image icon, and then click Edit.

    3. Click Create Tag.

    4. Click Tags, add a tag with the key bailian-datahub-access and value read, and then click Save.

  6. Return to the Model Import page, reselect the target bucket, and try importing again.

    Note that Alibaba Cloud Model Studio does not support accessing files stored in the root directory of a bucket. You must select an existing folder or create a new one within the bucket for Alibaba Cloud Model Studio to access.

Error "10041495"

This error occurs when the main account has not yet activated Object Storage Service (OSS). Follow these steps to resolve the issue:

  1. The main account holder must go to the OSS Management Console and activate OSS as instructed on the page.

  2. Return to the Model Import page in Alibaba Cloud Model Studio and try to authorize again.