Covers the end-to-end process of importing a LoRA model from Alibaba Cloud OSS into Alibaba Cloud Model Studio, including first-time OSS authorization, model file preparation, import form fields, imported model management, and troubleshooting.
Model import overview
This article describes the full process of importing a locally trained LoRA model from Alibaba Cloud Object Storage Service (OSS) to Bailian, covering the initial OSS authorization, model file preparation, import form filling, model viewing, management, and deletion, as well as troubleshooting common issues such as import failure and expired models. After a successful import, you can deploy services. For deployment, scaling, and decommissioning operations, see Deployment and O&M; for deployment and invocation through the API, see Deploy models by using the API; for deployment prerequisites and a comparison of billing plans, see Model deployment overview. Together with these three articles, this one forms the complete chain of concepts, import, deployment, and invocation.
The base model field on the import page is dynamically populated by a Model Studio API that returns the list of currently importable base models, which may change with version updates. Refer to the options available in the console. The currently supported base models are listed below:
Currently supported base models (click to expand)
Currently supported base models (click to expand)
Model family | Model name |
|---|---|
Qwen3 | Qwen3-32B |
Qwen3 | Qwen3-14B |
Qwen3 | Qwen3-8B |
Qwen3 | Qwen3-4B-Instruct-2507 |
Qwen3-VL | Qwen3-VL-8B-Instruct |
Qwen2.5 | Qwen2.5-72B-Instruct |
Qwen2.5 | Qwen2.5-32B-Instruct |
Qwen2.5 | Qwen2.5-14B-Instruct |
Qwen2.5 | Qwen2.5-7B-Instruct |
Qwen2.5-VL | Qwen2.5-VL-72B-Instruct |
Qwen2.5-VL | Qwen2.5-VL-7B-Instruct |
Authorize OSS before first import
Before importing a model from OSS for the first time, you must complete the OSS service-linked role authorization and add an access tag to the target bucket. Authorization is done in one click from the import page. Once authorized, the system automatically creates the service-linked role AliyunServiceRoleForSFMDataHubOSSImport (service name datahub.sfm.aliyuncs.com, permission policy AliyunServiceRolePolicyForSFMDataHubOSSImport), which usually takes effect within seconds. For details on the service-linked role, see OSS service-linked role. For the concepts and differences between the Alibaba Cloud account and RAM users, see Alibaba Cloud account and RAM users.
On the Import Model page, after selecting "Import from OSS" under Import source, if you have not authorized, the OSS field area shows "You have not authorized OSS" with a "Go to authorize" link, and the OK button is disabled until authorization is complete. The authorization path differs for Alibaba Cloud accounts and RAM users; choose by account type.
- Using an Alibaba Cloud account
- Use a sub-account
- On the Import Model page, after selecting "Import from OSS" as the Import Source, the page prompts "You have not authorized OSS yet". Click "Authorize Now" on the right side of the prompt bar.
- In the dialog box that appears, click "Authorize Now". The system automatically creates the service-linked role AliyunServiceRoleForSFMDataHubOSSImport, which usually takes effect within seconds; it may be slightly delayed during peak service hours.
- Add a tag to the target OSS Bucket: go to the Bucket list in the OSS management console, find the target Bucket, hover over the icon in the Tags column, and click "Go to Edit" → "Create Tag". Add the tag name bailian-datahub-access and the tag value read, then save.
- Return to the Import Model page, re-select the target Bucket, and try importing again. Bailian does not support accessing files in the Bucket root directory; you must select an existing subdirectory under the Bucket or create a new subdirectory.
Upgrade from the legacy authorization method
If you previously used the legacy authorization method, a message appears under the Bucket field on the import page: "We recommend switching to the new Bucket authorization method for better security", along with a "Switch Now" link. Click the link and confirm in the dialog box that appears. The authorization method is then upgraded to the service-linked role method, and the upgrade does not affect existing data.
OSS product not activated
If the primary account has not activated Object Storage Service (OSS), the import page displays "You have not activated OSS yet" together with a link to the purchase page. The primary account must first activate OSS in the OSS console, then return to the import page to authorize again.
Prepare LoRA model files
Before importing, you must place the LoRA model files in a subdirectory of an OSS Bucket according to the following requirements (the Bucket root directory is not supported) and pass the system's automatic validation before submitting. The model files must be placed directly in the selected subdirectory; the system identifies them automatically.
Required files and directory structure
The subdirectory must contain the following files: adapter_model.safetensors (LoRA adapter weights in SafeTensors format), adapter_config.json (configuration file containing parameters such as rank and alpha), and config.json (foundation model configuration). After you select the directory, the system automatically validates the format and integrity of these files.
Training parameter constraints
- rank value: rank must be one of 8, 16, 32, or 64, and all LoRA layers of the same model must use the same rank value; otherwise the model cannot be imported.
- Vocabulary must not be modified: models that added new tokens or modified the original vocabulary during training cannot be imported; the vocabulary must be fully consistent with that of the foundation model.
- Chat template must not be modified: models whose chat_template was modified during training cannot be imported; it must be consistent with the foundation model's default configuration. chat_template is located in the chat_template field of config.json or tokenizer_config.json.
- Vision models must freeze the VIT: vision language models must freeze the Vision Transformer part. If the LoRA adapter contains visual-related weight parameters (that is, the VIT is not frozen), the model cannot be imported.
Pre-submission automatic validation
After you select the model directory on the import page, the system automatically calls the file validation interface to check the format and integrity of the model files in the directory. If validation fails, a red prompt appears under the directory field and submission is blocked; you must fix the files as prompted before submitting. A common failure cause is missing required files, corresponding to the error code AvailableModelFileNotFound.
Import a LoRA model
After completing the OSS authorization and preparing the model files, go to the Bailian console · My Models page, click the "Import Model" button in the upper-right corner to enter the creation page, and complete the import following these steps.
- On the "My Models" page, click the "Import Model" button in the upper-right corner to enter the import model creation page.
- Fill in the model information according to the table below. The foundation model must be the same as the base model used for LoRA training, the Bucket must have the bailian-datahub-access=read tag, and after the model directory is selected the system validates the files automatically.
- After confirming that the information is correct, click OK to submit. The system automatically validates the file format and integrity, and the import starts once validation passes; to abandon the import, click Cancel to return to the list page. After the import, you can view the status in Manage imported models.
Field | Description | Constraints |
|---|---|---|
Model | Enter the display name of the model. | Required, up to 50 characters |
Foundation model | Select the base model used for LoRA training; it must match the training base. | Required, dropdown selection |
Training Method | The available options depend on the selected foundation model; after you select a foundation model, the options are automatically rendered with the first one selected by default. | Required, dropdown selection |
Import Source | Set to "Import from OSS", with no other options. | Read-only, selected by default |
Bucket | Select the OSS Bucket where the model files are stored. Only Buckets that have the bailian-datahub-access=read tag and are supported in the current region are listed (China (Beijing): all regions in the Chinese mainland; Singapore: all regions in the Chinese mainland and the Singapore region). | Required, dropdown selection |
Model Directory | Browse the selected Bucket and choose the subdirectory that contains the model checkpoint; selecting the Bucket root directory is not supported. | Required, tree selection |
Model Encryption | Bailian automatically enables OSS server-side encryption (SSE-OSS) for exported model files, using fully OSS-managed keys with AES256 as the encryption algorithm. | Read-only, enforced by Bailian |
Manage imported models
After the import is submitted, you are returned to the My Models list page, where you can view and manage all imported models. The list displays model name, model ID (with a copy button), foundation model, source, supported deployment method, status, creation time, and the Actions column; the top-right corner provides an Import Model entry and a refresh button.
Status and transitions
Model statuses include Creating, Created, Creation failed, and Expired. Creating means the import is in progress; Created means the import is complete and the model is ready for deployment; Creation failed means the import did not succeed; Expired means the OSS source model files changed after the model was created. The list automatically and silently refreshes every 3 seconds for models in the Creating status; this is normal behavior, not an API error.
Next to the Creation failed status is a "Details" link; hover over it to view the failure error code (such as AvailableModelFileNotFound) and the corresponding oss://bucket/path, which helps locate the failed file.
Hover over the Expired status to view a popup showing "Updates detected for the following files" and the list of changed source file names, indicating that you must re-import the model.
Actions column availability
- Deploy: Clickable only in the Created status; clicking it navigates to the deployment creation page. For deployment operations, see Deployment and O&M; in other statuses, or when no deployment method is available, the button is unavailable.
- Incremental Training: Models imported from OSS do not support incremental training, and the button is unavailable.
- Delete: Models in the Creating status cannot be deleted; quantized models must be deleted on the model compression page.
FAQ
This section summarizes common issues and solutions during the import process.
What should I do if the import fails with the AvailableModelFileNotFound error?
What should I do if the import fails with the AvailableModelFileNotFound error?
Why does the model status show Expired?
Why does the model status show Expired?
What should I do about the 10041495 error?
What should I do about the 10041495 error?
What should I do if OSS authorization fails for a RAM user?
What should I do if OSS authorization fails for a RAM user?
What should I do if the target bucket is not selectable in the bucket drop-down list?
What should I do if the target bucket is not selectable in the bucket drop-down list?
Is the My Models list auto-refreshing every few seconds a fault?
Is the My Models list auto-refreshing every few seconds a fault?
Why does the imported model produce different inference results compared to local vLLM or SGLang?
Why does the imported model produce different inference results compared to local vLLM or SGLang?
Does deleting an imported model affect the source files in OSS?
Does deleting an imported model affect the source files in OSS?