Describes the full workflow for importing a locally trained LoRA model from Alibaba Cloud OSS into Alibaba Cloud Model Studio, covering first-time OSS authorization, model file preparation, import form completion, imported model management, and common issue troubleshooting.
Overview
This page describes the full workflow for importing a locally trained LoRA model from Alibaba Cloud Object Storage Service (OSS) into Alibaba Cloud Model Studio, covering first-time OSS authorization, model file preparation, import form completion, model viewing, management and deletion, and common issue troubleshooting such as import failures and expired models. After a successful import, you can deploy the model. For deployment, scaling, and teardown operations, see Deployment and O&M. For API-based deployment and invocation, see Use API for model deployment. For deployment concepts and billing plan comparison, see Model deployment overview. This page together with those three forms a complete chain of concept, import, deployment, and invocation.
The base model field on the import page is dynamically returned by the Model Studio interface with the list of base models currently supported for import, which may update with versions. Please refer to the console's selectable list. Currently supported base models are as follows:
Currently supported base models (click to expand)
Currently supported base models (click to expand)
Model family | 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 |
- Model name: Enter a display name for the model (up to 50 characters).
- Base model: Select the base model corresponding to your LoRA model.
- Training method: Select the training method used for the model. Options depend on the selected base model and appear automatically after selection.
- Import source: Only "Import from OSS" is supported. This option is selected by default.
- Bucket: Select the OSS bucket that stores your model files.
- Model directory: Browse and select the directory in the chosen bucket that contains your model checkpoint.
- Model encryption: To protect your data, the platform enables OSS server-side encryption (SSE-OSS) using fully managed keys. The encryption algorithm is AES256.
- After verifying the information, click OK to submit the import request. To cancel, click Cancel to return to the list page. The system validates the model file format and integrity. If validation passes, the import starts. After completion, view the imported model on the My Models page and deploy, fine-tune incrementally, or delete it. Imported model states include the following: Creating (importing), Created (import succeeded, ready to deploy), Creation Failed (import failed), and Expired (model file changed). The list page displays the following 6 columns: model name/ID (with copy button), base model, source, supported deployment methods, status, and operations. The top-right corner provides Import Model and Return to old version entry points. Use the search box at the top to filter models by name.
Prerequisites for completing OSS authorization before the 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 completed with one click on the import page. After authorization, the system automatically creates the service-linked role AliyunServiceLinkedRoleForSFMDataHubOSSImport (service name datahub.sfm.aliyuncs.com, permission policy AliyunServiceRolePolicyForSFMDataHubOSSImport), usually taking effect within seconds. For details on the service-linked role, see OSS service-linked role. For concepts and differences between Alibaba Cloud accounts and RAM users, see Permission Management.
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 unavailable when unauthorized. The authorization path differs for Alibaba Cloud accounts and RAM users; choose by account type.
- Using an Alibaba Cloud account
- Using a RAM user
- After selecting "Import from OSS" under Import source on the Import Model page, the page shows "You have not authorized OSS". Click "Go to authorize" on the right side of the prompt.
- In the dialog box that appears, click "Confirm Authorization". The system automatically creates the service-linked role AliyunServiceLinkedRoleForSFMDataHubOSSImport, usually taking effect within seconds. It may be slightly delayed during peak 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 Tag column and click "Go to edit" then "Create Tag", add tag name bailian-datahub-access with value read, and save.
- Return to the Import Model page, reselect the target Bucket and try importing again. Model Studio does not support accessing files in the Bucket root directory; you must select an existing subdirectory or create a new one.
Old authorization method upgrade
If you previously used the old authorization method, the Bucket field on the import page shows "We recommend converting to the new Bucket authorization method to improve security" with a "Convert directly" link. Click it and a confirmation box appears; confirm to upgrade to the service-linked role authorization method. The upgrade does not affect existing data.
OSS product not activated
If the Alibaba Cloud account has not activated OSS, the import page shows "You have not activated OSS" with a link to purchase. The Alibaba Cloud account must go to the OSS console to activate OSS, then return to the import page to authorize again.
Prepare LoRA model files
Before importing, place the LoRA model files in a subdirectory of the OSS Bucket per the following requirements (the Bucket root directory is not supported), and pass the system's automatic validation before submission. The model files must be placed directly under the selected subdirectory; the system detects them automatically.
Required files and directory structure
The subdirectory must contain the following files: adapter_model.safetensors (LoRA adapter weights, SafeTensors format), adapter_config.json (configuration file containing rank, alpha, and other parameters), and config.json (base model configuration). After selecting a directory, the system automatically validates the format and completeness of these files.
Training parameter constraints
- rank value: rank must be 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 cannot be modified: Models that added new tokens or modified the original vocabulary during training cannot be imported; the vocabulary must exactly match the base model's.
- Chat template cannot be modified: Models that modified the chat_template during training cannot be imported; it must match the base model's default configuration. The chat_template is located in the chat_template field of config.json or tokenizer_config.json.
- Vision models must freeze VIT: Vision-language models must freeze the Vision Transformer part. If the LoRA adapter contains visual-related weight parameters (i.e., VIT not frozen), the model cannot be imported.
Pre-submission automatic validation
On the import page, after selecting a model directory, the system automatically calls the file validation interface to check the format and completeness of the model files in the directory. If validation fails, a red prompt appears below the directory field and blocks submission. Fix the files per the prompt before submitting. A common failure cause is missing required files, with error code AvailableModelFileNotFound.
Import LoRA model
After completing OSS authorization and preparing the model files, go to the Model Studio My Models page and click the "Import Model" button in the upper right corner to enter the creation page, then complete the import per the following 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 per the table below. The base model must match the base used for LoRA training, the Bucket must have the bailian-datahub-access=read tag added, and after selecting the model directory the system automatically validates the files.
- After confirming the information, click OK to submit. The system automatically validates the file format and completeness, and starts importing after validation passes; to cancel, click Cancel to return to the list page. After import, view the status at Managing imported models.
Field | Description | Constraint |
|---|---|---|
Model name | Enter a display name for the model. | Required, up to 50 characters |
Base model | Select the base model used for LoRA training; must match the training base. | Required, dropdown select |
Training method | Options depend on the selected base model; automatically rendered after selection with the first option selected by default. | Required, dropdown select |
Import source | Is "Import from OSS"; no other options. | Read-only, selected by default |
Bucket | Select the OSS Bucket storing the model files; only Buckets with the bailian-datahub-access=read tag are listed. | Required, dropdown select |
Model directory | Browse and select the subdirectory containing the model Checkpoint in the chosen Bucket; the Bucket root directory cannot be selected. | Required, tree select |
Model encryption | Model Studio automatically enables OSS server-side encryption (SSE-OSS) for exported model files, using OSS fully managed keys with AES256 encryption. | Read-only, Model Studio-enforced |
Managing imported models
After submitting the import, you return to the My Models list page, where you can view and manage all imported models. The list shows model name, model ID (with copy button), base model, source, supported deployment methods, status, creation time, and the Actions column. The upper right corner provides the Import Model entry and a refresh button.
Status and flow
Model states include Creating, Created, Creation Failed, and Expired. Creating means importing is in progress; Created means the import is complete and deployable; Creation Failed means the import was unsuccessful; Expired means the OSS source model files changed after Created. The list silently auto-refreshes every 3 seconds for models in the Creating state, which is normal behavior, not an interface exception.
The Creation Failed status has a "Details" link next to it; hover to view the failure error code (such as AvailableModelFileNotFound) and the corresponding oss://bucket/path, used to locate the failed file.
The Expired status can be hovered to view a popup showing "Changes detected in the following files" and the list of changed source file names, indicating that re-import is required.
Actions column availability
- Deploy: Only available for the Created state. Clicking it goes to the deployment creation page; for deployment operations, see Deployment and O&M. The button is unavailable for other states or when no deployment method is available.
- Incremental training: Models imported from OSS do not support incremental training; the button is unavailable.
- Delete: Models in the Creating state cannot be deleted; quantized models must be deleted on the model compression page.
FAQ
Common issues and handling during the import process.
What to do when import fails with AvailableModelFileNotFound?
What to do when import fails with AvailableModelFileNotFound?
What does the Expired model status mean?
What does the Expired model status mean?
What should I do if I encounter error 10041495?
What should I do if I encounter error 10041495?
What to do when a RAM user fails to authorize OSS?
What to do when a RAM user fails to authorize OSS?
What to do when the target Bucket is not selectable in the Bucket dropdown?
What to do when the target Bucket is not selectable in the Bucket dropdown?
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?