Skip to content

Conda Installation

Note

If you have already retrieved your Personal Access Token and set your License Key as an environment variable, skip ahead to Step Three.

1. Access Latent AI's Container Repository

In order to pull containers or install packages from Latent AI, you'll need to create a personal access token. To do so, follow these steps:

i. Login to the Latent AI Repository

  • Click the Sign in link in the upper right.
  • Select Sign In with SSO.
  • Enter your access credentials.

ii. Create your Personal Access Token

  • Click on your profile in the upper right.
  • Select User Token on the left navigation.
  • Select the Access user token button.
  • View your user token name and user token pass code.

You can export the token name and token pass code as environment variables:

export REPOSITORY_TOKEN_NAME=<user_token_name>
export REPOSITORY_TOKEN_PASSCODE=<user_token_pass_code>

2. Export License Key

After you receive your license key via email, place it in the following location: ~/.leip/license.key.

If you'd like, you can replace <your-license-key> and run the following command:

mkdir -p ~/.leip && echo "<your-license-key>" > ~/.leip/license.key

Alternative license key configurations

If you prefer, you can set LEIP_LICENSE_KEY as an environment variable. You can also place the key in a .leip/license.key file in your project directory: $(pwd)/.leip/license.key.

3. Create a conda environment

For Advanced Users

The conda setup is intended for advanced users. Please consult the conda documentation for details on installing conda and creating a conda environment from an environment.yml file.

You can use the provided YAML as a template to create variants for different version of Python; just edit the YAML directly. Please note, however, that Python versions are constrained and must be within 3.10-3.13 majors.

You can copy or download the following environment.yml to create a conda environment:

name: latentai-forge
channels:
  - nvidia/label/cuda-12.6.0
  - conda-forge
  - defaults
dependencies:
  - jupyter
  - libstdcxx-ng
  - nvidia::cuda-tools
  - python=3.10
  - pip
  - pip:
      - --extra-index-url https://${REPOSITORY_TOKEN_NAME}:${REPOSITORY_TOKEN_PASSCODE}@repository.latentai.com/repository/pypi/simple
      - leip-forge

Then create the environment with the following command:

conda env create -f environment.yml

And then activate the environment:

conda activate latentai-forge

4. Install Android Cross Compiler (Optional - Advanced Users)

If you plan to compile models for Android devices, you'll need to install the Android NDK (Native Development Kit) and related tools. This setup includes:

  • Android SDK Tools
  • Android NDK (version 21.3.6528147 by default)
  • CMake (version 3.6.4111459)
  • Required build tools and platform tools

To install the Android cross compiler and set up the environment:

For Advanced Users

Android NDK will be installed in /opt/android-ask-linux. If you don't want to install it on your host, use our LEIP Optimize docker image.

  1. Download the installation script and run it:

    chmod +x android-setup.sh
    sudo ./android-setup.sh
    

  2. The script will:

    • Install Android SDK tools
    • Install Android NDK
    • Set up necessary environment variables
    • Configure the cross-compiler toolchain
  3. After installation, the following environment variables will be set:

    ANDROID_HOME=/opt/android-sdk-linux
    ANDROID_NDK_HOME=/opt/android-sdk-linux/ndk/21.3.6528147/
    LEIP_NDK_CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++
    

Note

You can customize the installation by passing different versions as arguments to the script:

sudo ./android-setup.sh <ndk_version> <cmake_version> <build_tools_version> <android_platform>

Troubleshooting

The above scripts will try to handle most of the environment setup but won't be able to account for all dependencies. Below are a list of software requirements.

  • GLIBCXX_3.4.30: When Jupyter notebook is installed, you'll have GLIBCXX_3.4.29.

    Solution: conda upgrade -c conda-forge libstdcxx-ng

  • g++-aarch64-linux-gnu: The cross-compiler for ARM chips cannot be installed via conda.

    Solution: sudo apt-get update && sudo apt-get install -y g++-aarch64-linux-gnu