Skip to main content

Command Palette

Search for a command to run...

Installing the Leon Open-Source Personal Assistant on a Digital Ocean VM

Updated
3 min read
Installing the Leon Open-Source Personal Assistant on a Digital Ocean VM

I ventured into the world of open-source projects and found Leon. Leon is an open-source personal assistant and while not as sophisticated as Siri or Alexa, Leon holds some promise and is able to perform some interesting things.

Leon was built by Louis Grenard. He explains that he drew inspiration in 2016 from Mark Zuckerberg's published note on interactions with tech systems by voice. You can read more about Leon's conception here

Getting Started

I decided that my Leon personal assistant needed a VM that could easily be spun up and managed and while I had a lot of choices, I went with Digital Ocean. I love Digital Ocean's system because it's operability is seamless, it's UI is great and virtual machines can be deployed and equally destroyed with ease. Leon is compatible with Linux, Mac and Windows operating systems but for this I'll be using a Linux VM.

Droplet1.PNG

I deployed the VM with the settings above, setup my SSH key for authentication and placed my server in my location, Toronto.

The installation requires the following prerequisites:

  • Node.js >= 14

  • npm >= 5

  • Python >= 3

  • Pipenv >=2020.11.15

First Step

Update the system and get the latest curl version for Ubuntu

$ sudo apt update

$ sudo apt upgrade 

$ sudo apt install curl

How to Install Node.js

I installed nvm with the following script:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

This script clones nvm into the ~/.nvm file.

Running the nvm command will show that nvm is still not accessible on your server

Copy the following code and place into the `/.zshrc file

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Run source .zshrc

NVM is now installed and the next step lets you install the latest version of node js

nvm install --lts

node version.PNG

How to Install Python and Pipenv

curl https://pyenv.run | bash
exec $SHELL
python 3 --version
pip install pipenv --user
apt install python3-pip
$ python -m ensurepip --upgrade
apt install pipenv

Install Leon

# Clone the repository (stable branch)
git clone -b master https://github.com/leon-ai/leon.git leon

# Go to the project root
cd leon

# Install
npm install

# Check the installation/setup went well
npm run check

# Build
npm run build

# Run
npm start

# Go to http://youripaddress:1337 (Leon should be live!!!)

Leon Live.PNG

Configuring Leon's .env file will provide the ability to enable Leon's speech-to-text and text-to-speech functionality

You can interact with Leon to perform the following tasks:

  • Create basic lists (Verbiage: Create a shopping list )

  • Check status of domains (Verbiage: Is twitter.com down?)

  • Perform network speed tests ( Verbiage: What is my current Internet speed?)

Leon is also capable of other tasks all listed in its packages folder which can be found here

Leon's potential is limitless. For a future project, I will be integrating Leon with a raspberry pi and a smart mirror. This will serve as my alternative to Tony Stark's Jarvis :)