Upload Custom Model Weights
Roboflow offers the ability to upload model weights for your custom-trained models to your Roboflow projects for model deployment.
Uploading weights trained outside Roboflow
Once you've completed training your custom model, upload your model weights back to your Roboflow project to take advantage of Roboflow Inference.
To train a model in Roboflow, see Train a Model.
Model Support
Refer to the Supported Models table for details on weights upload compatibility.
YOLOv8 models must be trained on
ultralytics==8.0.196YOLOv9 models must be trained and uploaded using
ultralyticsfrom https://github.com/WongKinYiu/yolov9YOLOv10 models must be trained and uploaded using
ultralyticsfromYOLOv11 models must be trained on
ultralytics<=8.3.40YOLOv12 models must be trained and uploaded using
ultralyticsfrom https://github.com/sunsmarterjie/yolov12
Larger model sizes provide better training results. However, the larger the model size, the slower the training time, and inference (model prediction) speed. Consider whether you're looking for real-time inference on fast-moving objects or video feeds (better to use a smaller model), or you are processing data after it is collected, and more concerned with higher prediction accuracy (choose a larger model).
Versioned vs. Versionless Models Upload
Roboflow provides two distinct approaches for deploying models to your projects, each serving different use cases and organizational needs. The choice between versioned and versionless deployments depends on whether you need to track model evolution alongside dataset versions or want to share models across multiple projects in your workspace.
Versionless Deployments
Tied to the workspace level
Can be deployed to multiple projects simultaneously
Ideal for sharing models across different projects within the same workspace
Versioned Deployments
Tied to specific project versions
A Version can have multiple uploaded models
Ideal for tracking model evolution alongside dataset versions
Ideal for using model on Label Assist
Ideal for using model as checkpoint for training other models
Python SDK
First, make sure you have latest roboflow Python package installed:
Versionless Models
To upload versionless custom weights, use the workspace.deploy_model() method:
Parameters
model_type
str
Yes
Type of model being deployed, e.g. yolov8, yolov11.
model_path
str
Yes
Path to the directory containing the model weights.
project_ids
list[str]
Yes
Project IDs to deploy the model to.
model_name
str
Yes
Name identifying the model. Must contain at least one letter; numbers and dashes allowed.
filename
str
No
Weights file name. Defaults to weights/best.pt.
Example
Versioned Models
The versioned custom-weights upload attaches each uploaded model to a dataset Version. If you do not have a version generated in your dataset, you can create one in-app or via the API.
See docs on how to load a version through the API or reference the example below.
To upload custom weights, use the version.deploy() method in the Python SDK.
Usage
Parameters
model_type
str
Yes
Type of model being deployed, e.g. yolov8, yolov11.
model_path
str
Yes
Path to the directory containing the model weights.
filename
str
No
Weights file name. Defaults to weights/best.pt.
Example
Important Notes
A version can have multiple uploaded models. See Versions, Trainings, and Models for how models on a version are addressed.
CLI
Authentication
Before using any CLI commands, you need to authenticate with Roboflow:
Run the authentication command:
roboflow loginVisit the URL shown in the terminal: https://app.roboflow.com/auth-cli
Get your authentication token from the website
Paste the token in your terminal
The credentials will be automatically saved to ~/.config/roboflow/config.json
Uploading Model Weights
The Roboflow CLI provides a command to upload trained model weights to your Roboflow projects. This is useful when you want to deploy custom-trained models to Roboflow.
Basic Usage
Parameters
-w, --workspace
No
Workspace ID or URL. Defaults to your default workspace.
-p, --project
Yes
Project ID to upload into. Repeat the flag to upload a versionless model to multiple projects.
-t, --model_type
Yes
Model type, e.g. yolov8, paligemma2, rfdetr-medium.
-m, --model_path
Yes
Path to the directory containing the trained model file.
-v, --version_number
No
Dataset version to attach the model to.
-f, --filename
No
Model file name. Defaults to weights/best.pt.
-n, --model_name
Conditional
Model name. Required for versionless model deploys.
Examples
Next Steps
Check out your model in the "Models" tab of Roboflow
Run your model locally with Roboflow Inference Server.
Review the deployment options.
Last updated
Was this helpful?