Installation¶
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¶
You should have received this via email.
Tip
You can persist variables like LICENSE_KEY
across bash
sessions by placing them in your ~/.bashrc
file.
export LICENSE_KEY=key/<license_key>
3. Access the Latent AI Repository¶
docker login repository.latentai.io -u $REPOSITORY_TOKEN_NAME -p $REPOSITORY_TOKEN_PASSCODE
When prompted, enter the personal access token credentials retrieved in the first step. Your username is the user token name, and your password is the user token pass code.
4. Retrieve the Docker Image¶
docker pull repository.latentai.io/leip-optimize:latest-gpu-cuda
5. Start the Docker Container¶
Tip
A full list of options for the docker run
command is available in the Docker docs.
Included here are two ways of starting the Docker container. If you're planning to get started with our tutorials, choose Example B.
To get started, we'll set some variables:
export PORT=<port to map for access>
export DIR=<local directory to mount>
export NAME=<name to assign container>
Example A: Start a shell
docker run -it \
-p $PORT:$PORT \
--gpus=all \
-v $DIR:/latentai \
-e LICENSE_KEY=$LICENSE_KEY \
--name $NAME \
--pull=always \
repository.latentai.io/leip-optimize:latest-gpu-cuda \
bash -c "bash"
Example B: Start a shell and Jupyter notebook
docker run -it \
-p $PORT:$PORT \
--gpus=all \
-v $DIR:/latentai \
-e PORT -e LICENSE_KEY=$LICENSE_KEY \
--name $NAME \
repository.latentai.io/leip-optimize:latest-gpu-cuda \
bash -c 'pip install jupyter && \
echo Starting Jupyter server on port $PORT && \
source /root/.bashrc && \
$(nohup jupyter lab --no-browser --allow-root --ip=0.0.0.0 --port=$PORT >/dev/null 2>&1 &) && \
sleep 1 && \
jupyter server list && \
TOKEN=$(jupyter server list | grep -o "token=[a-z0-9]\+" | cut -d"=" -f2) && \
echo Copy and paste this URL to access your notebook: http://127.0.0.1:$PORT/?token=$TOKEN && \
bash'
If this is your first time using LEIP Optimize, proceed to the tutorials to get started with model optimization.