# Quickstart using Leap Hub

{% hint style="success" %}
Please Ensure to fill all [prerequisites](/getting-started/quickstart.md) before going through the Leap Hub integration.&#x20;
{% endhint %}

{% hint style="info" %}
Most of the off-the-shelf integration we have assume internet access or pre-existing dataset. We recommend going over the README of each repo to understand its requirements
{% endhint %}

In this section we will go over the steps needed to push an existing hub project into your local tensorleap installation. At the end of this section you would have a model and data integrated in the Tensorleap platform.

### Choosing a hub project

In order to chose a hub model, we recommend visiting our [github space](https://github.com/Tensorleap-hub) and reviewing the different repositories. Each repository is a Tensorleap integration for a given model and dataset.&#x20;

* If it's your first time using Tensorleap, we recommend using the [MNIST](https://github.com/Tensorleap-hub/mnist) use-case. It does not require to download any datasets, and thus enables a straightforward integration.
* Otherwise, we recommend browsing the hub for a repo that captures a similar data and model to your organization's use-case.

{% hint style="info" %}
Nest sections will assume MNIST was chosen for the integration. If you chose any other project, some other steps like downloading a dataset or a model might be needed. Please Follow the relevant README to fill in the missing details
{% endhint %}

### Setting up the repo&#x20;

1. Clone the repo into the computer on which the CLI was installed.
2. Create a virtual environment for the repo and install the Repo's requirements.

{% hint style="info" %}
&#x20;Our repo usually have a pyproject.toml [Poetry](https://python-poetry.org/) requirements file. This file details the expected python version and the expected dependencies. We recommend a combination of [pyenv](https://www.google.com/search?q=pyenv\&oq=pyenv\&gs_lcrp=EgZjaHJvbWUyCQgAEEUYORiABDIHCAEQABiABDIHCAIQABiABDIHCAMQABiABDIHCAQQABiABDIHCAUQABiABDIHCAYQABiABDIHCAcQABiABDIHCAgQABiABDIHCAkQABiABNIBCDEyNDlqMGo3qAIAsAIA\&sourceid=chrome\&ie=UTF-8) to set the local python interpreter, and Poetry to manage the dependencies.
{% endhint %}

### Integration Test

From within the repo, run `leap_integration.py` and ensure a successful termination of the script.&#x20;

{% hint style="warning" %}
This file serves as a local integration test the checks the validity of the Tensorleap integration, dataset structure, and dataloader. Any issues in running this script should be resolved before moving on to the next steps to ensure a smooth integration with the dataset and model.
{% endhint %}

### Integrating the codebase and model to the platform

> To upload your model and code, run the push command from the repository root:

```
leap push
```

You would then be prompted to provide:

* Project name  (choose create new)
* Choose model path
* Choose model name

{% hint style="info" %}
The CLI would now upload the model and the codebase into the server.  The first time running this after installing or upgrading Tensorleap might take up to 10 minutes to complete due to initial setup. Next uploads would finalize much quicker
{% endhint %}

A valid upload show the following logs in the terminal:

```
...
INFO Code parsed successfully
...    
INFO Successfully imported model
```

Once these appear within the terminal, the model and dataset are integrated into the platform.

### Data validation and Evaluation in the platform

To review your project and run the data through the uploaded model:

1. Login into your [Tensorleap app](http://localhost:4589/)
2. Click on the project you've just uploaded

<figure><img src="/files/uToL6rrqgCiSn5SbmDcO" alt=""><figcaption><p>Selecting a Project</p></figcaption></figure>

3. Click on the Evaluate button to open the Evaluation panel. Click Evaluate again to start the evaluation process and infer your data using the uploaded model.

<figure><img src="/files/7MMJRufUSBgubUdlUNuW" alt=""><figcaption><p>Evaluating the data</p></figcaption></figure>

3. Wait for the evaluation process to be completed. To follow on the progress of the evaluation you can open the "Runs and Processes" panel.<br>

<figure><img src="/files/Sh9xkDXZMLcYUgbOzaiS" alt=""><figcaption><p>The Runs and Processes Tab</p></figcaption></figure>

Once evaluation is completed the integration is finished. We can now go over the Dashboard tab and start an analysis of the model and the dataset:

<figure><img src="/files/FHXMi9P6kHSTunPNkPjN" alt=""><figcaption><p>Switching to the Dasboard Tab</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tensorleap.ai/getting-started/quickstart/quickstart-using-leap-hub.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
