These instructions are for installing TrainMyAI on your own server.

If you prefer a hassle-free trial of the product, fill out this form for a free cloud-based demo.

Local or Remote Language Models

Before installing TrainMyAI, it's important to decide whether to use a local language model or not, since this affects the server requirements. For more information, see choosing a language model.

Requirements

  • Modern 64-bit Linux server:
    • For ChatGPT only (remote language models): Ubuntu 18/20/22, Debian 10/11/12 or CentOS Stream 8/9.
    • For Llama 3 (local language model): Ubuntu 22 required.
  • Minimum memory: 4 GB (ChatGPT only) or 16 GB (Llama 3).
  • Disk: SSD with 20 GB free (ChatGPT only) or 40 GB (Llama 3).
  • For ChatGPT (remote language models):
  • For Llama 3 (local language model):
    • Best performance: NVIDIA GPU with 12+ GB of RAM and CUDA 7.5+ (see table), e.g. NVIDIA RTX 3060 12GB.
      Cloud providers include Amazon EC2 (G4dn), Azure (NCasT4_v3), Google Cloud (N1+T4, G2+L4).
    • Reasonable performance: High-end Intel/AMD systems with at least 16 CPU cores.

Easy Installation for Ubuntu and Debian

A shell script is available to automatically install TrainMyAI on a clean Ubuntu or Debian server:

  • Log in to the Ubuntu or Debian server command line.
  • Download the installation script from our site:

    wget -O install-trainmyai.sh https://trainmy.ai/install-demo/install-trainmyai.php

  • If you only wish to use ChatGPT (remote language models), run the script with no parameters:

    sudo bash install-trainmyai.sh

    During installation, the script will ask some questions – in most cases, you can accept the defaults presented.
  • To use Llama 3 with an NVIDIA GPU, install the GPU drivers, reboot, then run the install script:

    sudo bash install-trainmyai.sh nvidia
    sudo reboot
    sudo bash install-trainmyai.sh local

    To use Llama 3 without a GPU, just run the install script with the local parameter:

    sudo bash install-trainmyai.sh local

  • Open the server's address in your web browser and sign up as the first TrainMyAI admin user.
  • To use ChatGPT, connect TrainMyAI to your OpenAI Platform or Azure OpenAI Service account:
    • OpenAI Platform: Enter your OpenAI API key in the 'Configuration' page (via the 'Manage' menu). We recommend adding a payment method to your OpenAI account, to increase the API rate limit and test TrainMyAI properly. Each TrainMyAI chat response costs well under $0.01 (excluding GPT-4).
    • Azure OpenAI Service: Open the config.ini file in the trainmyai directory in a text editor. If you did not change the default location, run nano -w /home/trainmyai/config.ini. In the [openai] section, set provider = azure, set api_key to your Azure OpenAI API key, and enter the other Azure credentials.
  • Now create the first knowledge base and start adding content to it.
  • Once the content is analyzed, click 'Chat' in the menu to start asking questions.

Getting help

If you encounter any problems with the installation process, please contact us with the following information:

  • A description of the problem, including any error messages shown.
  • Linux distribution, e.g. Ubuntu 22.
  • MySQL/MariaDB version.
  • PHP version.
  • Any relevant lines of Apache's error_log file.

You can run the following set of commands to collect much of this information together:

grep PRETTY_NAME /etc/os-release ; mysql --version ; php -v
sudo grep -s PHP /var/log/httpd/error_log /var/log/apache2/error.log | tail -n 10

Manual Installation

If you are not running Ubuntu or Debian, or prefer to follow the installation process step-by-step, you can also install TrainMyAI manually. This process will take around half an hour for experienced system administrators.