Skip to content

Installation

Antonio Fin edited this page Dec 16, 2024 · 12 revisions

Installation Guide

This step-by-step guide will walk you through the process of setting up the LLM Agentic Tool Mesh platform on your machine. Whether you're a developer or a non-technical user, we've made the installation process straightforward and easy to follow. By the end of this guide, you will have LLM Agentic Tool Mesh fully installed and ready to use, allowing you to start creating and managing your Gen AI tools and applications.

Prerequisites

General Requirements

  • Python Version: LLM Agentic Tool Mesh requires Python ^3.11.9. Ensure you have the correct version installed, which can be downloaded from the official Python website.
  • API Key: Set your LLM API key, for instance for ChatGPT by assigning it to the OPENAI_API_KEY environment variable.

Installation Options

You can choose between two setup methods based on your needs:

  1. LLM Agentic Tool Mesh Services Only: For users who only need the core LLM Agentic Tool Mesh services, this option allows for a straightforward pip installation without example applications, enabling quick access to core functionalities.
  2. Full Example Setup: Ideal for those looking to explore the full capabilities of LLM Agentic Tool Mesh, this setup includes example applications and tools, along with necessary dependencies and configuration steps to get the complete environment up and running.

Option 1: Install LLM Agentic Tool Mesh Services Only

If you only need the core LLM Agentic Tool Mesh services without the example applications, you can install them directly via pip:

pip install 'llmesh[all]'

After installation, refer to the Usage Guide for instructions on using platform services.


Option 2: Full Example Setup

If you want to install the full LLM Agentic Tool Mesh setup, including example applications, follow these steps:

Step 1: Clone the Repository

First, clone the project repository to your local machine using Git:

git clone https://github.com/HewlettPackard/llmesh
cd athon

Step 2: Set Up the Virtual Environment

Create and activate a virtual environment for the project:

cd llmesh  # Navigate to the project directory if you haven't already.
python3.11 -m venv .venv
source .venv/bin/activate

This will create a new virtual environment in the directory .venv and activate it.

Step 3: Install Dependencies

Install the necessary project dependencies using Poetry:

poetry install --all-extras

Alternatively, install using pip with the published wheel file:

pip install "path/to/ll_mesh-0.1.0-py3-none-any.whl[all]"

All dependencies are specified in the pyproject.toml file.

Step 4: Set Up Environment Variables

Configure the required environment variables for the reasoning engine and other services:

  1. Open the virtual environment's activate script:

    vi .venv/bin/activate
  2. Add the following lines at the end of the file:

    export OPENAI_API_KEY=[Your OpenAI API Key]
    export GOOGLE_API_KEY=[Your Google Gemini API Key]
    export ANTHROPIC_API_KEY=[Your Anthropic Claude API Key]
    export MISTRAL_API_KEY=[Your Mistral API Key]
    export NVIDIA_API_KEY=[Your NVIDIA API Key]
    export TAVILY_API_KEY=[Your Tavily API Key]
    export HPE_DEPLOYMENT=[Your HPE Deployment]
    export HPE_API_KEY=[Your HPE API Key]
    export HPE_ENDPOINT=[Your HPE Endpoint]

    Replace the bracketed sections with your actual keys and endpoints. Note that you should set HPE_* variables if you use ChatHPE and OPENAI_API_KEY if you use ChatGPT (look Usage Guide for details).

  3. Save and exit the file, then reactivate your virtual environment:

    deactivate
    source .venv/bin/activate

Step 5: Data Preparation

Two example tools require additional data that is not included in the Git repository to function properly:

  • tool_analyzer
  • tool_rag

Follow the steps below to prepare the necessary data for each tool.

Step 5a: Tool Analyzer

  1. Create Data Directory
    First, create the required data folder for the tool_analyzer:

    mkdir -p ./examples/tool_analyzer/data  # This will create the necessary directories.
  2. Download Data File
    Next, download the temperature data file GlobalLandTemperaturesByCountry.csv from the web and copy it into the newly created data folder:

    # Example command to download the file directly to the directory (Linux/MacOS)
    wget -O ./examples/tool_analyzer/data/GlobalLandTemperaturesByCountry.csv https://github.com/gindeleo/climate/raw/master/GlobalLandTemperaturesByCountry.csv

Step 5b: Tool RAG

  1. Create Data Directory
    Similarly, create the data folder for the tool_rag:

    mkdir -p ./examples/tool_rag/data  # This will create the necessary directories.
  2. Obtain Documentation
    Download the 5G specifications 23.501 and 23.502 from 3GPP website, , ensuring that the versions match those specified in the configuration file:

    data:
      path: examples/tool_rag/data/
      files:
        - source: 23501-i60.docx # Ensure the version is correct (e.g. i60)
        - source: 23502-i60.docx # Ensure the version is correct (e.g. i60)
  3. Inject File into Vector Database
    To load the document into the vector database, enable the load_files option in the examples/tool_rag/config.yaml file:

    function:
      ...
      debug:
        load_files: true
  4. Run the Tool
    Run the main.py script to process the document:

    python examples/tool_rag/main.py

    After running the script, make a request to trigger the file load:

    https://127.0.0.1:5006/tool?query="Info about Athonet"

  5. Reset Configuration
    Once the file has been successfully loaded, set the load_files option back to false in the config.yaml file to prevent reloading the files in future runs:

    function:
      ...
      debug:
        load_files: false

Step 5c: Tool Agents Example

  1. Download and Prepare the API Files
    First, download the API YAML files from the repository at https://github.com/jdegre/5GC_APIs. Extract the downloaded .zip file into the ./examples/tool_agents/data/ directory. For example, if you download the 5GC_APIs-Rel-18 version, extract it to create a folder like:

    ./examples/tool_agents/data/5GC_APIs-Rel-18/
    
  2. Update the Configuration File
    After extracting the files, update the configuration file to specify the path to the newly created folder. For example, update the path in the configuration file to:

    path: examples/tool_agents/data/5GC_APIs-Rel-18/

Finalizing Installation

After completing the above steps, your project environment should be set up and ready to go.