/operation-simulation-llm-bot

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Operation Simulation LLM Bot (SimBot)

The simulation bot is intended to serve as a mediator between an end user and simulation environment for military oprations using RL.

User can either make a conversation with LLM about the documentation of the API, to clarify further requst or to learn more about the operation sumulation. Or, straightforwardly prompt an LLM to request the API to make a specific operation, for example you may ask it to execute simulation with default parameters.

image

Prerequisites

  1. Install Llama-cpp for M1 Mac:

CMAKE_ARGS="-DLLAMA_METAL=on" FORCE_CMAKE=1 pip install llama-cpp-python CMAKE_ARGS="-DLLAMA_METAL=on" FORCE_CMAKE=1 pip install --upgrade --force-reinstall llama-cpp-python --no-cache-dir

  1. Install redis on Mac:

brew install redis

  1. Run redis locally:

brew start-service redis redis-cli

  1. Download NeuralHermes LLM from HuggingFace:

https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-GGUF

  1. Put it into model directory, and specify the name in models.yml file inside of parameters directory.

  2. Specify environment variables:

PROJECT_PATH=/path/to/project/folder;
REDIS_HOST=127.0.0.1;
REDIS_PORT=6379
  1. If needed specify API url and API documentation in src/packages/constants package

  2. Download dependency of RL operation simulator:

https://github.com/yvoievid/intro-to-data-science

  1. Install python dependecies for OpSim (this project) pip install -f dependenices.m1.txt or requirements.txt for not Apple M1 users
  2. Run debug.py script from src/bin/debug.py with working directory set equal to the PROJECT_PATH

MLOps Architecture Design

simbot-llm-design drawio (2)

MLOps Architecture Implementation

simbot-llm-implementation drawio (3)

End Result Visualization

image