Skip to content

LLMInspect Basic Deployment Guide

This guide will walk you through the process of deploying LLMInspect using Docker. By following the instructions, you'll be able to set up a basic environment to run the LLMInspect system smoothly.

Note: For customer installations, use the llminspect-cli installer described in the Installation Guide. It configures HTTPS, credentials and the required directories automatically. This guide describes a manual deployment with Docker Compose.

Overview

LLMInspect is a comprehensive system for managing large language models and their related services. The eunomatix/llminspect repository contains submodules for various microservices required for this product, alongside a docker-compose.yml file and an override file (docker-compose.override.yml).

Prerequisites

  • Docker installed
  • Docker Compose installed
  • Basic knowledge of using the terminal and Docker commands

1. Clone the LLMInspect Repository

Start by cloning the main repository, which includes all necessary submodules.

git clone --recurse-submodules https://github.com/eunomatix/llminspect.git && cd llminspect

2. Configure the Override File

To customize your deployment, edit the provided docker-compose.override.yml file.

Update Your Configuration

Open docker-compose.override.yml in your favorite editor and set the appropriate API keys, credentials, and other local configurations. For instance, you can add sensitive information like:

services:
  api:
    environment:
      - OPENAI_API_KEY=<your-openai-api-key>
  mongo:
    environment:
      - MONGO_INITDB_ROOT_PASSWORD=<your-password>
      - MONGO_INITDB_ROOT_USERNAME=admin

3. Ensure Directory Permissions

Create the required directories on your host system and set the correct permissions to allow Docker containers to write into them.

Directory Creation and Permission Setting

# Create directories
mkdir -p logs/inspectHexagon logs/InspectChat images
# Set appropriate permissions
chmod -R 775 logs/inspectHexagon logs/InspectChat

Ensure the directories are created with appropriate ownership if required:

sudo chmod -R 777 logs/ images/

4. Start the Docker Containers

Now that the configuration files and directory permissions are set up, start all services with Docker Compose:

docker-compose up -d

This command will start all the micro-services defined in the Docker Compose files in detached mode.

5. Configure TLS/SSL

The llminspect-cli installer configures HTTPS for all services automatically, using either your own certificate or a self-signed certificate it generates for your domain. See the Installation Guide.

Configuring TLS manually is not covered in this guide. To run LLMInspect with HTTPS, install it with the installer.

6. Accessing the Services

Once the services are up and running, you can access them using the configured ports:

  • InspectChat: http://localhost:6116
  • Admin Panel: http://localhost:7116
  • InspectBoard: http://localhost:5119 (log in using your LLMInspect credentials)
  • Keycloak: http://localhost:4116
  • API Gateway: http://localhost:8116

Services started manually without the installer use HTTP. If you installed LLMInspect with the installer, use the HTTPS URLs in Accessing LLMInspect.

7. Managing the Deployment

Stopping the Services

To stop all services, run:

docker-compose down

Restarting the Services

To restart specific services, use the following command:

docker-compose restart <service-name>

Replace <service-name> with the appropriate service you want to restart.

Deleting the volumes

To stop services and delete the volumes, use the following command

docker-compose down -v

Use this command with caution all save data might be lost.

8. Data Management

Volumes and Directories

Several services use Docker volumes to persist data. Here is a summary of the key data locations:

  • Images:
  • ./images: Contains user-uploaded images for the InspectChat service.
  • Logs:
  • logs/inspectHexagon: Stores logs for the Inspect Hexagon service.
  • logs/InspectChat: Stores logs for the InspectChat service.
  • llmgw/LLM.log: Stores logs for LLMGW service.
  • Databases:
  • meili_data: Docker volume that stores MeiliSearch index data.
  • mongo_data: MongoDB data volume.
  • pgvector: Stores context for RAG in InspectChat