Today's Deep-Dive: Leon
Ep. 321

Today's Deep-Dive: Leon

Episode description

Leon AI is an open-source, self-hosted virtual assistant designed to offer the convenience of digital helpers without compromising user privacy. Unlike commercial alternatives that trade data for convenience, Leon operates entirely on the user’s own server, granting complete control over data and interactions. Its modular architecture, built with “skills” as self-contained units, allows for scalability and customization, enabling users to add new functionalities without updating the entire system. The MIT license under which it’s released promotes freedom, speed of development, and community contribution, making users part of the tool’s ownership. Leon supports an offline mode, providing digital sovereignty for sensitive data and conversations. Recent development focuses on integrating foundation models in a hybrid approach, balancing the power of large AI brains for complex tasks with faster, lighter methods for basic commands. Users can choose their preferred AI technologies for Natural Language Processing, Text-to-Speech, and Speech-to-Text, with options for both cloud services and robust local alternatives. The project relies heavily on community involvement, with a Discord channel for sharing ideas and contributing code. Financial support through sponsorships is crucial for its sustainability, allowing core contributors to dedicate more time to its development. Installation involves setting up Node.js and NPM, followed by installing the Leon CLI and using commands like “Leon create” and “Leon start” to set up and run the assistant, accessible via a web browser at localhost:1337. Leon AI represents a shift towards demanding higher standards for data privacy and user control in technology.

Gain digital sovereignty now and save costs

Let’s have a look at your digital challenges together. What tools are you currently using? Are your processes optimal? How is the state of backups and security updates?

Digital Souvereignty is easily achived with Open Source software (which usually cost way less, too). Our division Safeserver offers hosting, operation and maintenance for countless Free and Open Source tools.

Try it now!

Download transcript (.srt)
0:00

Welcome to the deep dive the place where we unlock the secrets of emerging tech and

0:04

Really figure out why it matters to you today. We're tackling something that I

0:08

think a lot of people are thinking about absolutely

0:10

We're talking about personal assistance, but with a huge twist one that doesn't spy

0:16

on you

0:16

We are diving into Leon AI right if you've ever wanted that convenience

0:23

You know of a digital helper, but without that feeling that some big company is

0:27

listening in on your living room

0:28

This is for you. It's a very common feeling these days

0:31

It is we're talking about an open source totally private and self-hosted virtual

0:36

assistant

0:37

But before we get into why Leon is sometimes called a virtual brain

0:41

We really want to thank the supporter of this deep dive of course this show is

0:45

brought to you by safe server

0:47

So if you're looking to host software just like Leon and you need some support for

0:51

your digital transformation

0:52

Safe server is there for you. You can find all the info at www.safeserver.de. Okay,

0:58

so let's unpack this

0:59

We've all used the big-name digital assistant. Yeah, but they all work on a trade.

1:03

You give them your data for convenience

1:05

That's the deal. Yeah, our mission today is to figure out what makes Leon

1:09

fundamentally different

1:10

we want to focus on its its core idea of ownership and

1:14

The really cool modular architecture behind it and that's the hook right there

1:19

Leon is designed to be your virtual brain, but and this is the critical part

1:25

This brain can live entirely on your server on my server not theirs. Exactly. That's

1:31

the whole shift

1:31

It's an assistant that does stuff when you ask it to whether you're talking or just

1:35

typing you control the entire relationship

1:38

So functionally it's similar to what we already know, but the whole infrastructure

1:42

is flipped upside down completely inverted

1:44

So I lead with open source. What is that MIT license, which I know the creator

1:48

chose. What does that actually mean for a regular person?

1:51

It means freedom and it means speed of development

1:54

The MIT license is basically the most permissive one out there. So no strings

1:58

attached pretty much

2:00

It signals that the goal is growth its contribution with almost no restrictions.

2:05

Anyone can see the code

2:06

They can change it use it for their own stuff commercial or not and then contribute

2:10

back

2:11

So you're not just a user you're part of a community that actually owns the tool

2:15

and that idea of ownership

2:16

Feeds directly into its main selling point, which is privacy. Yes, that is the

2:21

central pillar

2:21

This is where Leon goes head-to-head with all the concerns about data tracking from

2:25

commercial AI because it's on my server

2:27

Exactly, you are in complete control of your data

2:31

No conversation goes to the third-party server unless you explicitly set it up that

2:36

way and the source material really highlights this

2:39

You can configure Leon to work while being completely offline. Wait, okay offline

2:45

mode. That's a total game-changer

2:46

You're talking about sensitive business data or just conversations in your own home

2:51

that gives you complete

2:53

Digital sovereignty. Mm-hmm. But here's the question then if I host it myself am I

2:59

sacrificing all the power of you know

3:02

Massive cloud computers and that's the exact challenge Leon is built to solve

3:06

It uses its modularity to stay powerful while keeping you in control

3:09

The whole goal is to automate stuff and make your virtual life easier

3:13

Right, so it uses this really flexible structure to manage all that complexity

3:18

right there locally

3:19

So tell me about that structure. It's not just one big program

3:23

Is it it's built on a system of modules they call skills, correct?

3:27

Think of Leon's core as like the central nervous system

3:31

Yeah, it's the conductor the skills are the individual musicians in the orchestra

3:37

I like that analogy each skill is a tiny self-contained module that does one

3:41

specific thing

3:42

It could check the weather manage your calendar control your smart lights

3:46

Anything so if I want Leon to learn something new, I don't have to update the

3:49

entire system

3:50

I just add a new skill precisely

3:52

It makes it super scalable without making the core program bloated or fragile the

3:57

structure lets anyone

3:59

You know any developer out there create their own skills and then share them like

4:03

an app score for abilities

4:04

That's a great way to put it the creators even say there is only one core to rule

4:08

them all

4:08

To keep it all consistent and the plan is to build a dedicated skill registry

4:12

platform

4:13

So like NPM for JavaScript or pip for Python exactly like that, but just for Leon's

4:18

automation skills

4:19

It'll make finding and installing new abilities super simple. That's really elegant

4:24

But let's look behind the curtain for a second the repository the actual code has a

4:29

bunch of different parts

4:30

What are those other things doing?

4:32

Like why does a personal assistant need a TCP server?

4:35

Yeah, that gets a little technical but it's all about performance

4:40

The different parts of Leon need to talk to each other and they need to do it fast

4:44

You have the main server the skills the web app for the interface and the hot work

4:49

No, that's always listening for you to say its name. So they're all separate

4:52

processes

4:53

They are and the TCP server is like the internal switchboard

4:57

it just makes sure data gets passed between all those different parts reliably and

5:00

quickly and

5:01

Since so many AI tools are written in Python. They also needed a dedicated Python

5:06

bridge to translate because it translate

5:08

Yeah, it lets the JavaScript core talk seamlessly with all the Python AI libraries

5:14

They need to use that paints a much clearer picture. It's like a distributed system

5:17

in a box

5:18

So speaking of cutting-edge tools, what's the current state of development?

5:23

Read the dev branch was going through some major changes around June

5:27

2024 it is the biggest shift is the integration of what are called foundation

5:32

models. Hmm. Okay for a beginner

5:34

What does that mean? Think of foundation models as those huge general purpose AI

5:38

brains

5:39

Like the ones that power the most famous chat bots you hear about

5:42

Leon is starting to use those but and this is key in a hybrid approach hybrid

5:48

So it's not just using that massive AI brain for everything

5:51

No, because that would be really slow and heavy for a self-hosted assistant their

5:55

hybrid model is smart

5:56

It balances the power of those big models for complex tasks

6:00

Like say summarize this long email for me with simpler faster techniques for basic

6:05

commands like turn on the light

6:06

Exactly for something simple like that. It uses a much lighter almost instant

6:10

classification method

6:12

It only calls in the big guns the foundation models when it actually needs that

6:16

extra brainpower

6:17

So you get the best of both worlds speed for simple things and power for complex

6:21

ones

6:22

Optimal speed and accuracy without sacrificing that local first efficiency. Okay.

6:27

Here's where it gets really interesting for me

6:29

The AI toolbox itself

6:32

How does Leon get its ears and mouth in a way that still respects my privacy, right?

6:37

We're talking about three core AI concepts here NLP or natural language processing

6:42

which is for understanding what you mean the brain part the brain part then TTS or

6:46

text-to-speech for its voice and

6:48

STT speech-to-text for listening to you and I the user get to choose which tech I

6:55

want for all of those you get total control

6:57

Absolute control this modularity means you can choose what you're comfortable with

7:01

if you want the absolute best performance and the clearest voice

7:04

You can connect it to cloud services like Google cloud AWS or IBM Watson, but if I'm

7:09

doing this whole thing for privacy

7:10

I'd want the local options. Are they any good? Are they robust enough?

7:13

They're getting better all the time. And yes, there are strong offline options for

7:17

text-to-speech

7:19

You have tools like CMU flight for the listening part speech to text

7:23

They support Koki STT and more are on the way. What's the trade-off then? The trade-off

7:29

is usually a little bit of speed and

7:31

Maybe the voice doesn't sound quite as natural as the big cloud ones

7:35

But for people who are serious about privacy the peace of mind you get from running

7:39

it all locally is well

7:41

It's often worth that small dip in quality

7:43

It's just amazing how the flexibility is built into every single layer from the

7:47

core right down to the voice engine

7:49

Now open source projects like this live and die by their community for someone

7:54

listening who's getting excited about this

7:56

How is it all maintained and how can they get involved?

7:58

Leon is really driven by that idea that the more skills he has the more skillful he

8:03

becomes the author

8:04

Louie grenard is big on community

8:06

he encourages people to join their discord channel to share ideas or you know,

8:10

Even contribute code and building something this complex has to take a ton of time.

8:15

It does it's mostly a spare time project

8:17

So what's the plan for sustainability? Yeah, make sure it doesn't just you know

8:20

fade out

8:20

That's a super important point for any big open source project

8:24

The source material notes that at the end of the day sustainability is key. The

8:28

author has bills to pay, right?

8:30

We all do we all do so sponsoring the project lets him and other core contributors

8:35

Dedicate more real focused time to it instead of just grabbing a few hours here and

8:40

there

8:40

Financial support helps turn a passion project into well a full-time dedicated job.

8:46

That makes perfect sense

8:47

Okay, let's get practical for anyone listening. Who's ready to install this virtual

8:52

brain on their own machine

8:54

What do they need to get started? It's actually not as scary as it sounds

8:58

You just need a few standard things installed first. This is for Linux Mac OS or

9:03

Windows

9:04

You need a modern version of node.js and its package manager NPM

9:08

Okay node.js and NPM got it and we always recommend using the latest stable

9:12

versions

9:12

It just helps avoid headaches down the line. So once that's on my machine, what's

9:17

the first Leon specific step?

9:18

The first step is to install the Leon command line interface or CLI

9:23

You just open your terminal and type NPM install global at Leon ICLEI

9:28

That one command gives you the main tool to manage Leon

9:32

Okay, then to actually download all the files and set up your assistant

9:36

You run a really simple kind of cool command Leon create birth Leon create birth. I

9:42

like that

9:42

Yeah, it downloads everything gets the whole structure ready for beginners

9:46

We definitely say stick to the stable version for now

9:48

Especially with the big changes we talked about happening on the development branch

9:52

your tip and then to actually fire it up you just run Leon start the server will

9:55

boot up and then you just open a

9:57

Web browser and go to HTTP dot localhost dot one three three seven, and that's it.

10:01

That's it

10:02

You should see the web interface ready for you to configure skills and start

10:05

talking to your own private AI

10:07

They've really tried to make self hosting less intimidating. This has been a really

10:11

fascinating deep dive

10:13

Leon AI is clearly this powerful privacy first and

10:17

Super customizable assistant that's built by and for its community. Yeah, it's more

10:22

than just an alternative

10:23

It really is. Yeah, it feels like it's demanding a higher standard for how we think

10:27

about our data

10:28

And that kind of leads us to a final provocative question for you to talk about if

10:33

we connect the rise of these

10:35

open-source self hosted AIs like Leon to the bigger picture

10:40

How will this shift change what we expect from technology?

10:45

We'll self hosting tools like this eventually make us see those big centralized

10:50

assistance as being you know

10:51

Fundamentally broken because they're missing the most important feature

10:55

Privacy that is something to mull over as you decide what tech you want in your

11:00

life and where you want to draw that line

11:01

On your own digital sovereignty

11:03

Thank you again to safe server for supporting this deep dive into open-source

11:07

architecture

11:08

You can learn more about how they can help of your software hosting and digital

11:11

transformation at www safe server dot de

11:14

We will, for another Deep Dive.

11:14

We will, for another Deep Dive.