Upload Offline Experiment Data
Synchronize local experiment data to SwanLab cloud/private deployment
Use Cases:
- Network interruption during training: The server lost connection for 1 hour during model training, causing SwanLab cloud records to break.
- Training environment without internet: You unfortunately discover that your company/school's training server has no internet access and doesn't allow Docker installation.
- Multi-device synchronization: You're using private deployment but also want to sync experiment records to the cloud.
- Experiment replication: The experiment is universally applicable to multiple projects you've created (e.g., baseline, benchmark experiments) and you want to replicate it across projects.
- Missing cloud records: Training finished normally, but only part of it was recorded in the cloud (e.g., due to a temporary network outage or failed uploads), and you need to backfill the middle segment by time window or
steprange.
When encountering the above scenarios, the swanlab sync command can help. API Documentation.
Version Compatibility
The swanlab sync command is not backward-compatible with log files produced by older SwanLab SDK versions.
Starting from SwanLab SDK v0.8.0, the local log format underwent significant changes. Log files generated by v0.8.0 and above cannot be synced by older swanlab sync versions, and conversely, old swanlog files cannot be synced by newer SDK versions.
Before syncing, please verify that:
- The
swanlab syncCLI version matches (or is older than) the SDK version that produced the log files. - If your log files were generated by an SDK older than
v0.8.0, use that same version to runswanlab sync; do not upgrade. - If you encounter parse errors or missing data during sync, the log format is likely incompatible — install the original SDK version that generated the logs and retry.
Local Experiment Data Directory
SwanLab saves experiment log files by default in the swanlog directory of your project. You can also customize the save path using the logdir parameter. Documentation.
Each time you create an experiment, SwanLab automatically creates a run-[experiment ID] directory under swanlog and continuously records data to this directory.

Tips
This run- prefixed directory is crucial—it's the foundation for swanlab sync.
Upload Experiment Data
Locate the data directory you want to upload to the cloud, then execute the command:
swanlab sync ./swanlog/run-xxxINFO
By default, data will be synced to the project recorded in the log files (i.e., the project specified when running the experiment).
To sync to a different project, use the -p option.
If you see the following output, the upload was successful:

Sync to Original Experiment
If you don't want to create a new experiment but instead sync to the original one, use the --id parameter:
swanlab sync ./swanlog/run-xxx --id <experiment ID>- By default, syncing to an existing experiment incrementally resumes from the latest progress recorded in the cloud. If a middle segment of data is missing, use the range options to backfill that specific range.
For how to obtain the experiment ID, see: Resume Experiment/Checkpoint Training
Batch Upload
You can use wildcards for batch uploads:
swanlab sync ./swanlog/run-*Upload to a Specific Project/Team Workspace
swanlab sync ./swanlog/run-xxx -p <project_name> -w <workspace_name>Experiment Replication Scenario
If you want an experiment to appear in multiple projects, use the above command to upload it to multiple projects.
Upload to Private Deployment
swanlab sync ./swanlog/run-xxx --host <private_deployment_address>Range Sync
A default full sync only appends data after the latest progress recorded in the cloud. If only a middle segment of training data is missing (for example, due to a temporary database outage while subsequent uploads recovered), you can use the range options to backfill records within that specific interval:
# By time: backfill scalars, media and terminal logs between 10:00 and 12:00
swanlab sync ./swanlog/run-xxx --id <experiment ID> \
--start-time "2026-10-20 10:00:00" --end-time "2026-10-20 12:00:00"
# By step: backfill scalars and media for step 100-200
swanlab sync ./swanlog/run-xxx --id <experiment ID> --start-step 100 --end-step 200| Option | Applies to |
|---|---|
--start-step / --end-step | Scalars, media (inclusive) |
--start-time / --end-time | Scalars, media, terminal logs (inclusive) |
When both step and time ranges are specified, their intersection is used. Specifying only a step range does not sync terminal logs; use a time range if you need to backfill terminal logs.
Avoid re-syncing existing ranges
Range sync directly uploads all records within the specified window without automatically skipping data that already exists in the cloud. If the sync window overlaps with existing cloud records:
- Scalars: Charts align by
stepand are not duplicated, but experiment summary statistics may be affected; - Media (images, audio, etc.): Duplicate media uploads at the same
stepare displayed as multiple entries.
Keep the range as narrow as the actual gap. If you only need to append data at the end of an experiment, run a default full sync (without range options), which never produces duplicates.
While training is still in progress, you can also run a range sync with
--idagainst the same experiment from another terminal without interrupting or affecting the ongoing training.