HomeVideos

OpenHands + Devstral = A Fully Local Coding Agent

Now Playing

OpenHands + Devstral = A Fully Local Coding Agent

Transcript

174 segments

0:01

Hi everyone, this is Graham from Alhians

0:03

AAI and we have an exciting new uh model

0:07

that we'd like to share with everyone.

0:09

It's the Devastrol model that we work

0:11

together with Mistl to create. And what

0:14

I want to show you here is how we can

0:17

use this model uh completely locally on

0:20

our computer to create an AI agent that

0:23

allows us to go in and you know fix bugs

0:25

or implement features or something. So

0:28

the first thing that we need to do is we

0:30

need to download the model. Uh there's a

0:32

couple ways you can do this. You can do

0:33

it through the hugging face uh CLI or

0:36

just go and download it

0:38

directly. But I in the sake of time I've

0:42

downloaded the model. So we have it

0:44

right here. And I'll I'll go into this

0:46

directory. And we can see we have the

0:47

gguf uh format uh that we can do. And

0:53

for using the model, I'm going to use

0:56

lm's lm studio. And so what we do here

1:00

is we do lm's

1:03

import. And then we do the name of the

1:06

model. And in terms of the name of the

1:08

model, let us call that

1:13

um devastrol Q4 km

1:18

ggf. And so yeah, this is importing the

1:21

model and so I'll do

1:24

yes and uh I will do don't

1:30

categorize. So great. Now I've imported

1:32

the model into LM Studio and I'm going

1:35

to look over here and we can see indeed

1:38

the model was imported into LM

1:41

Studio. And so then we can go to the

1:43

developer settings and select the model

1:46

to load. And what we will want to do

1:48

here is we'll want to load it with some

1:52

custom settings. So I on the Mac I hold

1:54

down the option key and click here. This

1:56

gives us some custom

1:58

settings. The next thing we want to do

2:00

for context length is we want to make

2:02

sure the context length is not too long

2:04

because if it uh is too long, it might

2:07

use all the memory of my computer. Uh

2:09

but if it's too short, then we won't be

2:11

able to get all the nice long context

2:13

that's needed in order to do well at

2:14

coding tasks. So I'm going to copy in

2:17

something about uh 32,000 here which is

2:20

kind of a good number that balances this

2:23

off. So loading in the model now and

2:26

this will take a little

2:28

bit. So once we have the model loaded uh

2:31

the next thing that we need to do is we

2:32

need to set up some configuration so

2:35

that you can actually run the model uh

2:38

together with open hands with the model

2:40

as a back end.

2:42

And we're basically going to have to run

2:45

some commands. Uh the first command that

2:47

I will run is just uh exporting the

2:49

openhands

2:50

version. The next thing that I will do

2:54

is I will copy the model name from uh LM

2:58

Studio. So I just click in here and copy

3:00

that. And then I do export LM studio

3:05

model

3:09

name. And uh it's called

3:12

uncatategorized, but it's actually the

3:13

Devstral

3:14

model. And then the final thing I want

3:17

to do is I want to copy in the LM Studio

3:20

URL. So there we go. And don't worry if

3:23

you can't follow along with all of this.

3:25

I will put a link uh below the video

3:27

where you can click through and see all

3:29

of these steps step by

3:31

step. So the next thing I need to do is

3:33

I need to get the appropriate version of

3:35

OpenHands uh through a Docker pull. So

3:38

now I'm pulling this through Docker. Uh,

3:40

I actually did this before I started the

3:43

demo to save some time, but it might

3:45

take you a little bit of time if you do

3:46

it

3:47

yourself. And then the final thing uh

3:51

before we actually start running the

3:52

program is I'm going to export some uh

3:56

settings uh so that open hands already

3:58

starts up with the model set by default.

4:01

So I'm just going to do that there and

4:03

that's just a copy

4:05

paste. Okay, so let's get started. Um,

4:08

now we're starting up the open hands uh

4:11

kind of coding agent and we can click

4:13

through to this URL that it provided

4:16

with us and here we

4:22

go. So this opens up the repository and

4:27

I am going to launch something here and

4:32

it's uh starting up the container that

4:34

we will be using to run the agent in.

4:39

And this will take a little bit uh the

4:41

first time you run

4:46

it. Okay. And now we can see that the

4:48

agent is awaiting user input. And so the

4:51

next thing we need to do is we need to

4:54

come up with a task for the agent to do.

4:57

So what I would suggest you do here is

4:59

you just come up with the next kind of

5:00

coding task that you would be interested

5:02

in doing. So for me, you know, I'm

5:04

constantly coding on open hands. So I

5:06

have this uh pull request open that I

5:09

started but unfortunately it is not

5:12

passing the tests here. So we have the

5:14

Python unit tests and so I

5:17

will take this PR

5:21

ID and

5:23

say please clone the repo associated

5:27

with this pull

5:30

request and check out the branch. then

5:34

get started

5:36

working on running piunit tests. That's

5:42

the name of the testing file and fixing

5:45

any

5:52

errors. So right now the agent has

5:54

started working. Again, this will take a

5:57

little bit of time the first time you

5:59

run it uh because it will be reading in

6:02

uh kind of the long instruction that

6:06

the agent is provided with. And it

6:10

particularly takes a long time on my

6:12

computer because I have a old Mac M1

6:14

processor. So, I'll I'll wait, you know,

6:16

a minute or two for this to boot up.

6:30

And there it got started. So we can see

6:32

it's cloning the repository and checking

6:34

out the branch that it needs to be

6:36

cloning. And the best part about all of

6:38

this is we're not using any external uh

6:42

API services. Uh the only thing that

6:44

we're doing is we're generating directly

6:46

on my computer and it's uh just my Mac

6:49

M1 using the the M1 processor.

6:52

And we can see that uh you know the the

6:56

model is running here and all of this

6:58

was generated with the

7:00

model and it's uh successfully cloned

7:04

the repo. So we can see that it cloned

7:06

the repo in here and now it's going to

7:09

get started on uh checking out the

7:11

branch and

7:14

uh looking for the the unit tests and it

7:17

is off to the races.

7:19

So the great part about open hands is uh

7:23

it's you know completely local. You can

7:25

run it on your computer. Typically we do

7:27

it through calling an API like quad or

7:29

gemini but now with the new devstral

7:31

model you can run it entirely locally on

7:34

even my you know several years old

7:36

computer

7:38

and we can you know work and and make

7:41

the models better and better until you

7:43

know everybody can have their own coding

7:45

agent on their computer that does

7:46

whatever task they want. So, uh, hope

7:49

you're excited about this as I am. And

7:51

if you're interested, check the link,

7:53

uh, that you will see in the video and,

7:56

uh, below the video to learn more about

7:59

Open Hands in Devstral. Thanks a lot.

Interactive Summary

This video demonstrates how to run the Devstral AI model locally on a personal computer using LM Studio and OpenHands to create an autonomous coding agent. The presenter provides a step-by-step guide on importing the model, configuring context settings to manage memory, and setting up the environment via Docker to execute coding tasks, such as cloning repositories and running unit tests, entirely offline.

Suggested questions

3 ready-made prompts