2.1. Installation

2.1.1. GEMINI Suite Setup

GEMINI Digital Twin is compiled as docker container, thus it will be easy to setup and replicate to a server (on premises or cloud). It is needed to have a basic knowledge of Docker to install this tool. Several tutorial can be found in the internet (example)

The pre-requisite software of this installation are:

docker-compose.yml
  1networks:
  2  gemini:
  3
  4services:
  5      gemini_module:
  6          image: ghcr.io/gemini-digital-twin/gemini-suite:MVP_V3
  7          env_file:
  8              - .env
  9          environment:
 10              - DOCKER_MODE=MODULE
 11          volumes:
 12              - project-db:/opt/gemini-suite/gemini-project
 13          depends_on:
 14              - influxdb
 15          restart: unless-stopped
 16          networks:
 17              - gemini
 18
 19
 20      gemini_gui:
 21          image: ghcr.io/gemini-digital-twin/gemini-suite:MVP_V3
 22          ports:
 23              - 5101:5101
 24          env_file:
 25              - .env
 26          environment:
 27              - DOCKER_MODE=GUI
 28          restart: unless-stopped
 29          volumes:
 30              - project-db:/opt/gemini-suite/gemini-project
 31          depends_on:
 32              - mysqldb
 33              - influxdb
 34              - mongodb
 35              - redis
 36              - chromadb
 37              - ollama
 38          networks:
 39              - gemini
 40
 41      gemini_celery:
 42          image: ghcr.io/gemini-digital-twin/gemini-suite:MVP_V3
 43          env_file:
 44              - .env
 45          environment:
 46              - PYTHONUNBUFFERED=1
 47              - DOCKER_MODE=CELERY
 48          restart: unless-stopped
 49          volumes:
 50              - project-db:/opt/gemini-suite/gemini-project
 51          depends_on:
 52              - redis
 53          networks:
 54              - gemini
 55
 56      grafana:
 57        image: grafana/grafana:latest
 58        ports:
 59            - 3000:3000
 60        env_file:
 61            - .env
 62        volumes:
 63            - grafana-storage:/var/lib/grafana
 64        depends_on:
 65            - influxdb
 66        restart: unless-stopped
 67        networks:
 68            - gemini
 69
 70      mysqldb:
 71        image: mysql:8.0
 72        ports:
 73          - 3306:3306
 74        env_file:
 75          - .env
 76        volumes:
 77          - mysqldb_data-storage:/data/db
 78          - mysqldb_var_lib-storage:/var/lib/mysql
 79        restart: unless-stopped
 80        networks:
 81          - gemini
 82
 83      influxdb:
 84        image: influxdb:latest
 85        ports:
 86          - 8086:8086
 87          - 8998:8088
 88        env_file:
 89          - .env
 90        volumes:
 91          - influxdb-storage:/var/lib/influxdb
 92          - influxdb2-storage:/var/lib/influxdb2
 93          - influxdb2etc-storage:/etc/influxdb2
 94        restart: unless-stopped
 95        networks:
 96          - gemini
 97
 98      redis:
 99        image: redis:6-alpine
100        ports:
101          - 6379:6379
102        env_file:
103          - .env
104        restart: unless-stopped
105        networks:
106          - gemini
107
108      mongodb:
109        image: mongo:latest
110        ports:
111          - 27017:27017
112        env_file:
113          - .env
114        volumes:
115          - mongo-storage:/data/db
116        restart: unless-stopped
117        networks:
118          - gemini
119
120      chromadb:
121        image: chromadb/chroma
122        ports:
123          - 8000:8000
124        env_file:
125          - .env
126        networks:
127          - gemini
128        volumes:
129          - chroma-data:/data
130        restart: unless-stopped
131
132      ollama:
133        container_name: ollama
134        image: ollama/ollama:latest
135        ports:
136          - 11434:11434
137        env_file:
138          - .env
139        volumes:
140          - ollama_data:/root/.ollama
141        restart: unless-stopped
142        command: serve
143
144volumes:
145  mysqldb_data-storage:
146  mysqldb_var_lib-storage:
147  grafana-storage:
148  influxdb-storage:
149  influxdb2-storage:
150  influxdb2etc-storage:
151  mongo-storage:
152  chroma-data:
153  project-db:
154  ollama_data:

There are several services in this docker-compose.yml file:

  1. GEMINI Module

    This container runs the real-time modules when is called. The container shares volume of project-db with other container to have a common project data. The project name should be given in GEMINI_PLANT environment variable. This container depends on InfluxDB container to access the real-time data.

  2. GEMINI User interface (GUI)

    This container provides the web user interface of GEMINI. This container depends on MySQLDB container to access user authentication and project. The port number can be defined in GEMINI_FRONTEND_PORT environment variable. The container shares volume of project-db with other container to have a common project data and volume of doc-db to access the documentation.

  3. GEMINI Celery

    This container provides python celery that enables asynchronous, background execution of time-consuming task. It prevents long-running processes from blocking web application user interfaces. It also provides task scheduling and horizontal scaling, supporting brokers like RabbitMQ or Redis.

  4. Grafana

    This is a multi-platform open source analytics and interactive visualization web application. It can produce charts, graphs, and alerts for the web when connected to supported data sources. It is used to visualize the time series data.

  5. MySQLDB

    It is an open-source relational database management system. To handle several data structured of GEMINI.

  6. InfluxDB

    It is an open-source time series database. It is used for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics. We use this database to store time series data from Geothermal assets.

  7. Redis

    Redis acts primarily as a high-performance message broker and result backend. It enables asynchronous task processing by storing task queues, facilitating communication between GEMINI app and workers, and storing task execution results. Redis provides rapid, in-memory storage, allowing workers to pick up tasks instantly and enhancing system scalability.

  8. mongodb

    MongoDB is a document-oriented NoSQL database designed for high-volume storage, flexibility, and scalability. It stores data in JSON-like documents (BSON) rather than tables, allowing for rapid development, easy handling of unstructured/semi-structured data, and horizontal scaling through sharding. We use this database to store the document uploaded by user.

  9. chromadb

    ChromaDB is an open-source vector database designed to store, manage, and query high-dimensional vector embeddings, making it a critical component in AI applications, particularly those utilizing Retrieval-Augmented Generation (RAG). It serves as a specialized, efficient repository for semantic data (text, images, etc.) to enhance the performance of Large Language Models (LLMs).

  10. Ollama

    An open-source framework for installing and running Llama or other open-source LLMs.

2.1.2. Chat Assistant Setup

The Chat Assistant setup process is designed to be simple and mostly automated.

The application uses Ollama to run Large Language Models (LLMs). Ollama is started automatically inside a separate Docker container when the following command is executed:

docker-compose up

The provided docker-compose.yml file creates and starts the Ollama container, among other necessary containers for the GEMINI digital twin. This container hosts the LLM and embedding models used by the Retrieval-Augmented Generation (RAG) application.

After the containers are running, the required Ollama models can be installed by double-clicking the pull_ollama_models.bat file. This step must be performed only after the docker-compose up command has completed successfully.

2.1.2.1. Model configuration

The Chat Assistant supports switching between different LLMs using environment variables defined for the gemini_gui container. To change the models, update the following variables:

LLM_MODEL_VERSION=llama3.2
EMBED_MODEL_VERSION=snowflake-arctic-embed

Only Ollama-supported models are allowed, as the Ollama client is integrated with the RAG application.

When selecting models other than the recommended defaults, it is important to ensure that the chosen models are also downloaded into the Ollama container.

For example, if you want to use mistral-nemo instead of llama3.2, you can install it while the container is running by executing the following command in a command prompt window:

docker exec -it ollama ollama pull mistral-nemo