Edit on GitHub


Create a link (read alias) for an existing MLEM Object, including from remote [MLEM project](/doc/user-guide/project-structure).


usage: mlem link [--sp <path>] [--rev <commitish>]
                 [--tp <path>] [--f] [--abs] [-h]
                 source target

  source           URI of the MLEM object you are creating a link to
  target           Path to save link object


This command is used to create links to existing MLEM objects, which in turn allows you to refer to the object using the TARGET path in all future operations.

A common use-case is to create links for objects present in remote MLEM projects to incorporate them in the local workspace.


  • --sp <path>, --source-project <path> - Project for source object
  • --rev <commitish> - Repo revision to use [default: (none)]
  • --tp <path>, --target-project <path> - Project to save target to [default: (none)]
  • --follow-links, --f / --no-follow-links, --nf - If True, first follow links while reading {source} before creating this link. [default: follow- links]
  • --absolute, --abs / --relative, --rel - Which path to linked object to specify: absolute or relative. [default: relative]
  • -h, --help - Show this message and exit.


Add a remote object to your local workspace (aka project) without copying it

$ mlem link rf --source-project https://github.com/iterative/example-mlem-get-started remote_model

The remote model can now be served with the link created above, using the command mlem serve remote_model fastapi.

Alias a local object with a different name

$ mlem link my_model latest

🐛 Found an issue? Let us know! Or fix it:

Edit on GitHub

Have a question? Join our chat, we will help you:

Discord Chat