# Tensorleap Integration

This page outlines the different elements of the tensorleap integration and reviews the integration flow and development cycle within the platform.

### Prerequisites

* [Access to Tensorleap](/getting-started/tensorleap-setup/installation.md#accessing-the-tensorleap-platform)&#x20;
* Leap CLI is [installed](/getting-started/tensorleap-setup/installation.md#tensorleap-cli-installation) and [authenticated](/getting-started/tensorleap-setup/cli-authentication.md)
* .onnx or .h5 model
* [A valid code integration](/tensorleap-integration/writing-integration-code.md) that instructs Tensorleap on how to load the dataset and parse and visualize different elements.&#x20;
* Tensoleap [configuration yamls](/tensorleap-integration/configurations-files.md):
  * A [leap.yaml](/tensorleap-integration/leap.yaml.md) file that contains the setup of your integration.
  * (optionally) requirements.txt file if non-default requirements are needed
* An [integration test](/tensorleap-integration/integration-test.md) script that instructs Tensorleap on what code needs to be run during model analysis (loss, metrics, visualizers & metadata)

### Expected Folder Structure

The expected file structure for a Tensorleap code integration is the following:

```
my_leap_project/
├── ...
├── leap_binder.py
├── leap.yaml
├── integration_test.py
```

Here, leap\_binder.py contains the [integration script](/tensorleap-integration/writing-integration-code.md).

### The Tensorleap integration flow&#x20;

1. Start from an existing repo from our [Leap Hub](/getting-started/quickstart/quickstart-using-leap-hub.md) or use the CLI to add template Tensorleap integration files into your existing repository.
2. Make sure your data is accessible by the [Tensorleap Server](/getting-started/tensorleap-setup/installation.md#tensorleap-server).
3. Create a basic [Integration script](/tensorleap-integration/writing-integration-code.md). This can include an [input\_encoder](/tensorleap-integration/writing-integration-code/input-encoder.md), [GT encoder](/tensorleap-integration/writing-integration-code/ground-truth-encoder.md), [loss](/tensorleap-integration/writing-integration-code/custom-loss-function.md), and a basic [visualizer](/tensorleap-integration/writing-integration-code/visualizer-function.md) for the input, prediction and GT.
4. Verify your integration validity locally using an [Integration test](/tensorleap-integration/integration-test.md).
5. Use the [CLI](/tensorleap-integration/uploading-with-cli/cli-assets-upload.md) to push the code and models to the platform&#x20;
6. Use the Platform to [Evaluate](/user-interface/project/menu-bar/evaluate-a-model.md) and process the data using your model.

{% hint style="info" %}
After the integration step the model and dataset can be analyzed using the platform. Usually, during the analysis phase the insights and analysis being done points to a missing metadata, better visualization method, or a new metric. These elements should then be added to the integration script and then steps 4-7 are repeated.
{% endhint %}


---

# 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/tensorleap-integration.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.
