LibreTools AI Assistant Plugin Documentation

The primary goal of LibreTools is to seamlessly integrate a program called LMStudio into LibreOffice, allowing users to run large language models (LLMs) locally on their machines. LMStudio will utilise the local computer's GPU to efficiently process and serve these models. To ensure smooth operation and easy access, LibreTools will feature a user-friendly GUI that connects directly to the LLM's IP address. This connection can be established either through the local intranet or using a service like ngrok for remote access.

By leveraging local hardware and providing a straightforward interface, LibreTools aims to make advanced AI capabilities accessible to all users, without the need for expensive cloud services or complex setup procedures. This approach not only enhances the functionality of LibreOffice but also ensures that users maintain control over their data and resources, aligning with the principles of privacy and open-source development.

Installation instructions

Windows

Step 1: Install LM Studio

Download and install LM Studio from this link.

Step 2: Download the LLM Model

Download the required LLM model. this link

Step 3: Download LibreOffice

Download and install LibreOffice from the official LibreOffice website.

Step 4: Clone the Repository

  1. Open a Terminal or Command Prompt.
  2. Navigate to the directory where you want to clone the project using the cd command. For example: cd ~
  3. Clone the repository using the following command :
    git clone https://dagshub.com/Omdena/NorthCarolinaUSAChapter_LibreToolsAIAssistantPlugin.git

Step 5: Copy the Python Script

Run the following command in the command line :

copy "C:\Path\To\Your\scriptlocatepython.py" "C:\Program Files\LibreOffice\share\Scripts\python"

Step 6: Load the Dialog File

  1. Open LibreOffice and create a new file.
  2. In the navigation bar, go to Tools > Macros > Organize Dialogs.
  3. Select "Libraries" and click "Edit".
  4. Go to File (in navbar) > Import Dialog.

Step 7: Run LM Studio Server

Open LM Studio and start the server.

Image 4

Step 8: Run the Macro

In LibreOffice, go to Tools > Macros > Run Macro > script locate python > Main

Ubuntu

Step 1: Install LM Studio.

Download and install LM Studio following the instructions for your operating system from the link.

(Step 2): Download and install Libre Office.

If not already installed, download and install Libre Office from the link.

(Step 3): Ensure Libre Office can run Python scripts.

Open Libre Office Writer and ensure that Tools > Macros > Organize Macros > Python exists. If it does not exist, install libreoffice-script-provider-python by running:

sudo apt-get install libreoffice-script-provider-python

Step 4: Clone the repository.

  1. In terminal, navigate to the directory where you want to clone the project.
  2. Clone the repository:
    git clone https://dagshub.com/Omdena/NorthCarolinaUSAChapter_LibreToolsAIAssistantPlugin.git

Step 5: Copy the Python script.

Copy the Python script to the Libre Office shared folder:

sudo cp path/to/your/script/scriptlocatepython.py /usr/lib/libreoffice/share/Scripts/python

Step 6: Load the dialog file.

  1. Open LibreOffice Writer and create a new file.
  2. Navigate to Tools > Macros > Organize Dialogs.
  3. Select Dialogs > Libraries and click Edit, which opens a new window.
  4. Navigate to File > Import Dialog and open MyDialog.xdl file from the NorthCarolinaUSAChapter_LibreToolsAIAssistantPlugin folder.

Step 7: Download the model.

Open LM Studio, navigate to the Discover tab and download the model you wish to use.

Step 8: Run LM Studio Server.

In LM Studio, navigate to the Developer tab. Select the model to load and start the server.

Step 8: Run the Macro.

In LibreOffice Writer, navigate to Tools > Macros > Run Macro... > My Macros > scripttolocatepython > main. This action opens a new dialog with the promt and instruction options.