Skip to main content

Modelbit clone

Your Modelbit workspace is backed by a git repository that supports large binary files like .pkl and .joblib. These files are not supported by git clone, so you must use modelbit clone instead.

tip

Don't use git clone with Modelbit workspaces. Using modelbit clone ensures your local repo is configured to work with Modelbit.

If you haven't already, install Modelbit:

pip install modelbit

Then clone your Modelbit workspace's repository:

modelbit clone

# or clone into the my_workspace directory
modelbit clone my_workspace

The clone command will display a link for you to click, just like when using modelbit.login() in a notebook. Click the link to authenticate with Modelbit. Once authenticated, a local repository will be created with all of your deployments and their assets.

From here on you can use all the standard git commands like git push and git pull.

Git automation using API keys

To clone Modelbit's repo as part of a CI/CD process you can authenticate using API keys. First, create an API key in Modelbit. Then set the envvars MB_API_KEY to that key, and MB_WORKSPACE_NAME to the name of your Modelbit workspace. With those envvars set you can call modelbit clone:

export MB_API_KEY=<key> MB_WORKSPACE_NAME=<name>

modelbit clone

Empty binary files or frequent rebasing

If you use git clone instead of modelbit clone to create a local repository you'll experience some issues:

  • You'll see "stubs" in place of the .pkl and other binary files stored in git
  • Your branch will be rebased by Modelbit, leading to some errors when you git pull or git push

Delete your local repository and re-clone it with modelbit clone to correct this situation.