Contact us here for enterprise support https://forms.gle/uyKyZmmpVET95Wbx8

Get the image

  1. After getting an issued Docker PAT

  2. Authenticate with your token:

docker login --username literalai
# When prompted for a password, use the token
  1. Pull the image
docker pull literalai/platform:latest

Host the image

Google Artifactory Registry

  1. Tag the image:
docker tag literalai/platform:latest <region>-docker.pkg.dev/<project_id>/<artifactory_name>/platform:latest
  1. Push the image
docker push <region>-docker.pkg.dev/<project_id>/<artifactory_name>/platform:latest

Google Container Registry

  1. Tag the image:
docker tag literalai/platform:latest gcr.io/<project_id>/platform:latest
  1. Push the image:
docker push gcr.io/<project_id>/platform:latest

Amazon ECR

  1. Tag the image:
docker tag literalai/platform:latest <aws_account_id>.dkr.ecr.<region>.amazonaws.com/literalai/platform:latest
  1. Push the image
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/literalai/platform:latest

Run the application

  1. Once your image is accessible you can then host the application using the service of your choice.

Here is a non exhaustive list:

  1. To configure the application you will be required to pass your own environment variables. Let’s go over the required values:
# The url used to communicate with your database.
# Note: we currently only support postgresql.
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<db_name><?pgbouncer=true if using pg-bouncer>
# The url used to handle migrations to your database.
# Note: We can not perform migration through pg-bouncer, we need a direct url to your database.
DATABASE_DIRECT_URL=postgresql://<username>:<password>@<host>:<port>/<db_name>
# Optionally, set DATABASE_SSL to 'true' if you need to communicate with the database over a secure network.
# DATABASE_SSL=true

# Used to encrypt the NextAuth.js JWT, and to hash email verification tokens.
NEXTAUTH_SECRET="your secret"
NEXTAUTH_URL="https://yourdomain.com"

# Currently we support AWS S3, Google Cloud Storage and Azure Blob Storage for file storage.
BUCKET_NAME=""
# For AWS S3
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/AuthUsingAcctOrUserCredentials.html
APP_AWS_ACCESS_KEY="access key"
APP_AWS_SECRET_KEY="secret key"
APP_AWS_REGION="region"
# Or for GCS https://developers.google.com/workspace/guides/create-credentials
APP_GCS_PROJECT_ID="project id"
APP_GCS_CLIENT_EMAIL="client email"
# note: the private key needs to be encoded in base64
APP_GCS_PRIVATE_KEY="private key"
# Or for Azure storage https://learn.microsoft.com/en-us/azure/storage/blobs/quickstart-storage-explorer
APP_AZURE_STORAGE_ACCOUNT="azure storage account"
APP_AZURE_STORAGE_ACCESS_KEY="azure storage key"
  1. [OPTIONAL] Setup Redis to reduce latency:
# Either set the full redis URL
REDIS_URL="redis://127.0.0.1:6379/0"

# Or pass the host and port (typically useful with google cloud run)
REDISHOST=
REDISPORT=
  1. [OPTIONAL] Configure authentication methods:
# To support credentials authentication
ENABLE_CREDENTIALS_AUTH=true
# On top of it you will need to provide the mailer credentials
EMAIL_SERVER_HOST="servicehost"
EMAIL_SERVER_PORT="4000"
EMAIL_SERVICE="gmail"
EMAIL_USER="username"
EMAIL_PASS="password"
EMAIL_FROM="noreply@service.com"

# We support the following OAuth providers
## Google
## https://support.google.com/cloud/answer/6158849
GOOGLE_CLIENT_ID="your id"
GOOGLE_CLIENT_SECRET="your secret"
## Github
## https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app
GITHUB_ID="your id"
GITHUB_SECRET="your secret"
## Azure Active Directory
## https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/tutorial-azure.html
AZURE_AD_CLIENT_ID="your id"
AZURE_AD_CLIENT_SECRET="your secret"
AZURE_AD_TENANT_ID="your tenant id"
## Okta
## https://developer.okta.com/docs/guides/implement-oauth-for-okta/main/
OKTA_CLIENT_ID="your id"
OKTA_CLIENT_SECRET="your secret"
OKTA_ISSUER="the issuer"
  1. [OPTIONAL] Add monitoring
# If you want to use Vercel Analytics (only for hosting with Vercel)
ENABLE_VERCEL_ANALYTICS=true

# If you want to monitor your application using Sentry
SENTRY_ORG="org"
SENTRY_PROJECT="project"
# https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/
NEXT_PUBLIC_SENTRY_DSN="sentry-dsn"
# https://docs.sentry.io/product/accounts/auth-tokens/
SENTRY_AUTH_TOKEN="sentry-auth-token"

Configuring storage

In order to be able to use the storage solution of your choice, you will need to configure CORS for it.

Configure OAuth providers

If you enabled OAuth authentication in the environment variables, don’t forget to allow the callback url for each of the providers. The callback url is in the form:

<protocol>://<domain>/api/auth/callback/<provider>
# Example https://my-literal.com/api/auth/callback/google

Configure the port and start the container

The server within the docker image will run on port 3000. Don’t forget to expose it. You should now be ready to start the container.

Configure your Chainlit app

Once you successfully deployed the Literal Platform, don’t forget to set the following environment variables in your Chainlit App.

LITERAL_SERVER=https://my-literal.com
LITERAL_API_KEY=my project api key