--- title: "Use a repository from an instance or notebook" description: "Download a Model Repository's files to an instance, a notebook, or your own computer, or push a trained model to it, with the Python SDK or the MinIO CLI." content_type: "how-to" product: "model-repository" platform: "TIR" url: "/tir/model-repository/how-to/use-a-repository-from-an-instance-or-notebook/" topic: ["serve-and-train"] --- # Use a repository from an instance or notebook Upload the files of a trained model to a repository from an instance or notebook, and download them there for training or testing. You reach a repository with the Python SDK or the MinIO CLI rather than mounting it as a folder. The keys are on the **Overview** tab, and the commands are on the three setup tabs. ## Before you begin - A repository; see [Create a repository](/tir/model-repository/how-to/create-a-repository/). - Permission to read model repositories in the project. A Member gets it through a policy that allows reading for the Inference service. ## Use the SDK in a TIR notebook The **Using TIR Notebook** tab has the code with the repository number filled in. Inside a notebook, the code leaves out the token step that the **Using SDK** tab has. 1. Install the SDK: ```bash pip install e2enetworks ``` 2. Run the code in the notebook. Replace the placeholders: - `` is the region you are working in. - `` is the folder to upload. - `` is where to save the download. - `` is a folder in the repository such as `v1`. Leave it empty for the top. - `` is the repository's number. ```python from e2enetworks.cloud import tir location = "" models = tir.Models(location=location) models.push_model(model_path="", prefix="", model_id=) models.download_model(model_id=, local_path="", prefix="") ``` The first call uploads a trained model's files, and the second downloads them. ## Use the SDK from an instance or your own computer Use the **Using SDK** tab. It adds an API token step and the sign-in call. [Upload model files](/tir/model-repository/how-to/upload-model-files/) has that setup code and shows how to create the client. Then download with this call. `` is the repository's number, and the tab fills it in: ```python models.download_model(model_id=, local_path='', prefix='') ``` ## Use the MinIO CLI On an instance or your own computer, connect `mc` with the **Using CLI** tab and download the files: ```bash mc cp -r / ``` See [Connect to a repository with the MinIO CLI or s3cmd](/tir/model-repository/how-to/connect-to-a-repository-with-an-s3-tool/) for the setup and the placeholders. ## Check the download The files are in the folder you gave. Anyone who can open the repository can see its keys, so keep them out of notebooks you share. For help with a message, see [Troubleshooting Model Repository](/tir/model-repository/troubleshooting/model-repository/).