Models
Model files your training produces are kept as models attached to the run. After reading this page you can save a model from code, publish it in Deploy › Models, and load it in another run so that the run records which model it started from.
Where models come from
Section titled “Where models come from”Models come from four places.
- Training code saves them with
run.save_model. This is the most reliable way. - Framework save functions such as
torch.saveare recorded automatically while automatic logging inqgon.init()is on (the default). - LLM fine-tuning leaves adapters and merged models, and Imports registers outside models as published models.
- Checkpoints saved by
qgon.checkpointare stored as models too. They are hidden from the model list by default.
Save from code
Section titled “Save from code”import torchimport qgon
run = qgon.init(project="image-cls", name="resnet18-lr1e-3")... # trainingtorch.save(model.state_dict(), "best.pt")model_id = run.save_model("best.pt", name="resnet18-best", tags=["resnet18", "baseline"])print(model_id)run.save_model(path, name=None, tags=None, publish=False) uploads the file to the server, registers it as an output model of this run and returns the model id. If name is empty, the file name without its extension is used. Tags added with tags are searchable in the model list and can be used to find the model from code. Tags are set when you save.
With publish=True the model is published as soon as it is saved. Publishing cannot be undone, so usually you check the results in the UI first and then publish.
Automatic logging relies on the framework's save function, so it cannot be promised to catch every case. Save models you plan to serve or load in other runs with run.save_model. Checkpoints are covered separately in Checkpoints and resume.
Models page
Section titled “Models page”Deploy › Models lists models by name, status (published or draft), key metric, source experiment, framework and update time. Filter by status, project and creator. The search box looks in names and tags. Turn on Show checkpoints to include checkpoints. When you select a model, the list narrows and the source experiment and framework appear in the details on the right.

Click a model to open its details. They show the key metric, labels, the before-publishing checks, lineage and an example for loading it in code, with Download, Publish and Start in Playground buttons. Adapters made by fine-tuning carry an 'Adapter' chip. From their details, Open fine-tuning run → takes you to the run where you create a merged model. Models in test serving carry a 'Test serving' chip.
Publish
Section titled “Publish”Publishing marks the model as verified and locks it against changes and deletion. It cannot be undone, so you are asked once more. Publishing does not deploy anything. Serving on the server is done by test serving and endpoints.
Before publishing, look at Before publishing in the details. It shows whether a metric was recorded, whether the source experiment completed, whether the model file was stored and whether labels are defined (optional). Only the model owner and administrators can publish. You can also publish an output model from the Files · models tab of the experiment details.
Publishing changes the following.
- Any user on the server can start the model in Playground under their own name. A draft model can be started only by its creator (or the creator of the run that made it) and administrators.
- In code,
qgon.model(..., published="only")picks only published models.
Load from code
Section titled “Load from code”Find a model with qgon.model and get the file with get_local_copy().
import torchimport qgon
run = qgon.init(project="image-cls", name="eval-resnet18")m = qgon.model(id="<model id>") # id from the model detailspath = m.get_local_copy() # downloads the file and returns a local pathmodel.load_state_dict(torch.load(path, weights_only=True)) # reads tensors onlyLoad model files made by someone else with weights_only=True, as above. A pickle file can run code the moment it is opened.
When called after qgon.init(), the model is recorded as an input model of that run. The experiment details show which model it started from, and lineage links them. Copy the loading example from the model details to get one with the id already filled in.
get_local_copy() reuses a file it already downloaded from the cache. Pass force=True to download again. For a model saved as several files, it returns the path of the unpacked folder.
Find by name
Section titled “Find by name”You can also find a model by its name in the model list instead of the id.
m = qgon.model("resnet18-best") # the most recent if the name repeatsm = qgon.model("resnet18-best", project="image-cls", published="prefer")m = qgon.model(tags=["resnet18", "baseline"], published="only") # published models with both tagsRunning the same training several times often leaves several models with the same name. In that case the most recent one is used and a one-line warning is printed. To pick exactly, narrow it down with these arguments.
| Argument | Meaning |
|---|---|
id |
Model id. When given, the other conditions are ignored. |
project |
Search only this project. Write the full path. Subprojects are not included. |
tags |
Only models that have all of these tags |
published |
"any" (default), "only" (published only) or "prefer" (the most recent published one if there is any) |
When an agent runs this run again, a model loaded by name follows the input model recorded on the run. If you change the input model in the UI and run again, the changed model is used. A model loaded by id is always the one written in the code, whatever the record says.
The returned Model has id, name, project, tags, published, framework, uri (file location) and run_id (the run that made it). See the qgon reference for everything.
Lineage
Section titled “Lineage”Lineage in the model details traces back which data and runs made this model. It goes from the model to the run that made it, to the dataset version that run used, and on to its parent version. Each edge shows which record it was found in. For a fine-tuned model, the base model and the dataset version both lead into the run, and the adapter comes out of the run.
Lineage is drawn from the records left on runs. A run links to a dataset only if it loaded the dataset with qgon.dataset("name") or picked the dataset in New run in the UI. If the code reads a mounted folder or a file path directly, no record is left and the link is missing. Datasets covers dataset records.
Lineage is built from records, so editing a run's records changes the graph. Do not use it as a fixed record for audits or regulatory evidence.