OpenHands + Devstral = A Fully Local Coding Agent
174 segments
Hi everyone, this is Graham from Alhians
AAI and we have an exciting new uh model
that we'd like to share with everyone.
It's the Devastrol model that we work
together with Mistl to create. And what
I want to show you here is how we can
use this model uh completely locally on
our computer to create an AI agent that
allows us to go in and you know fix bugs
or implement features or something. So
the first thing that we need to do is we
need to download the model. Uh there's a
couple ways you can do this. You can do
it through the hugging face uh CLI or
just go and download it
directly. But I in the sake of time I've
downloaded the model. So we have it
right here. And I'll I'll go into this
directory. And we can see we have the
gguf uh format uh that we can do. And
for using the model, I'm going to use
lm's lm studio. And so what we do here
is we do lm's
import. And then we do the name of the
model. And in terms of the name of the
model, let us call that
um devastrol Q4 km
ggf. And so yeah, this is importing the
model and so I'll do
yes and uh I will do don't
categorize. So great. Now I've imported
the model into LM Studio and I'm going
to look over here and we can see indeed
the model was imported into LM
Studio. And so then we can go to the
developer settings and select the model
to load. And what we will want to do
here is we'll want to load it with some
custom settings. So I on the Mac I hold
down the option key and click here. This
gives us some custom
settings. The next thing we want to do
for context length is we want to make
sure the context length is not too long
because if it uh is too long, it might
use all the memory of my computer. Uh
but if it's too short, then we won't be
able to get all the nice long context
that's needed in order to do well at
coding tasks. So I'm going to copy in
something about uh 32,000 here which is
kind of a good number that balances this
off. So loading in the model now and
this will take a little
bit. So once we have the model loaded uh
the next thing that we need to do is we
need to set up some configuration so
that you can actually run the model uh
together with open hands with the model
as a back end.
And we're basically going to have to run
some commands. Uh the first command that
I will run is just uh exporting the
openhands
version. The next thing that I will do
is I will copy the model name from uh LM
Studio. So I just click in here and copy
that. And then I do export LM studio
model
name. And uh it's called
uncatategorized, but it's actually the
Devstral
model. And then the final thing I want
to do is I want to copy in the LM Studio
URL. So there we go. And don't worry if
you can't follow along with all of this.
I will put a link uh below the video
where you can click through and see all
of these steps step by
step. So the next thing I need to do is
I need to get the appropriate version of
OpenHands uh through a Docker pull. So
now I'm pulling this through Docker. Uh,
I actually did this before I started the
demo to save some time, but it might
take you a little bit of time if you do
it
yourself. And then the final thing uh
before we actually start running the
program is I'm going to export some uh
settings uh so that open hands already
starts up with the model set by default.
So I'm just going to do that there and
that's just a copy
paste. Okay, so let's get started. Um,
now we're starting up the open hands uh
kind of coding agent and we can click
through to this URL that it provided
with us and here we
go. So this opens up the repository and
I am going to launch something here and
it's uh starting up the container that
we will be using to run the agent in.
And this will take a little bit uh the
first time you run
it. Okay. And now we can see that the
agent is awaiting user input. And so the
next thing we need to do is we need to
come up with a task for the agent to do.
So what I would suggest you do here is
you just come up with the next kind of
coding task that you would be interested
in doing. So for me, you know, I'm
constantly coding on open hands. So I
have this uh pull request open that I
started but unfortunately it is not
passing the tests here. So we have the
Python unit tests and so I
will take this PR
ID and
say please clone the repo associated
with this pull
request and check out the branch. then
get started
working on running piunit tests. That's
the name of the testing file and fixing
any
errors. So right now the agent has
started working. Again, this will take a
little bit of time the first time you
run it uh because it will be reading in
uh kind of the long instruction that
the agent is provided with. And it
particularly takes a long time on my
computer because I have a old Mac M1
processor. So, I'll I'll wait, you know,
a minute or two for this to boot up.
And there it got started. So we can see
it's cloning the repository and checking
out the branch that it needs to be
cloning. And the best part about all of
this is we're not using any external uh
API services. Uh the only thing that
we're doing is we're generating directly
on my computer and it's uh just my Mac
M1 using the the M1 processor.
And we can see that uh you know the the
model is running here and all of this
was generated with the
model and it's uh successfully cloned
the repo. So we can see that it cloned
the repo in here and now it's going to
get started on uh checking out the
branch and
uh looking for the the unit tests and it
is off to the races.
So the great part about open hands is uh
it's you know completely local. You can
run it on your computer. Typically we do
it through calling an API like quad or
gemini but now with the new devstral
model you can run it entirely locally on
even my you know several years old
computer
and we can you know work and and make
the models better and better until you
know everybody can have their own coding
agent on their computer that does
whatever task they want. So, uh, hope
you're excited about this as I am. And
if you're interested, check the link,
uh, that you will see in the video and,
uh, below the video to learn more about
Open Hands in Devstral. Thanks a lot.
Ask follow-up questions or revisit key timestamps.
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.
Videos recently processed by our community