This video is perfect for anyone eager to run Llama3 locally on their computer and in the cloud using Grog. We cover what Llama3 is and how it compares to other LLMs. Additionally, we explore how to connect Llama3 to CrewAI. The majority of the video is spent on building an Instagram posting crew that generates image descriptions and text for Instagram using Llama3. By the end of this tutorial, you'll know how to set up, customize, and use Llama3 to automate tasks and enhance your project's capabilities. Get ready to upgrade your tech skills and make your work with AI more productive and innovative. Start now and see how simple it is to bring the power of Llama3 into CrewAI.
Timestamps: 00:00 Introduction 00:12 Video Overview 02:44 Llama 3 Overview, Comparison, & Testing 07:06 Setup Llama3 Locally with Ollama 12:05 Crew Overview 13:20 Run CrewAI & Llama 3 Locally with Ollama & Crew Deep Dive 22:18 Run CrewAI & Llama 3 with Groq 27:39 Fix Rate Limiting with Groq 29:27 Results 31:01 Outro
Hey guys, in today's video, I'm going to teach you everything you need to know about using
Llama 3 with Crew AI so that you can run your crews completely for free.
So let's go ahead and dive into the three major parts that we're going to be covering
in this video.
So in the first part of this video, you're going to learn what is Llama 3, how does it
compare to other LLMs, and you're going to see a live demo of Llama 3 so you can see
just how smart this new LLM is.
After that, we're going to move over to actually running a crew using Llama 3, and we're going
to do all of this locally on your own computer using Ollama.
So let me go ahead and show you exactly the crew that you're going to be running.
So just as a quick high-level overview, it's a crew that generates Instagram posts for
whatever company you want to advertise.
In our case, we're doing a smart thermos that keeps your coffee hot all day.
So this Instagram crew will go off and actually write text for you that you can show off in
your Instagram posts.
And it's actually pretty smart.
Like it shows you exactly the problem your customers would have, lukewarm coffee, and
it comes up with pretty catchy taglines.
And the part that's super cool that I think you're going to like is it comes up with mid-journey
descriptions that you can go off and paste into mid-journey to generate some really cool
looking pictures.
So let me show you what these pictures look like.
Yep, right here.
So it came up with these futuristic looking thermoses right here that you could go off
and upgrade, download, and post over to Instagram to start getting some traction for your new
business.
And it is important to mention this crew already was built by the creator of Crew.ai, Xiao.
I just formatted it to work exactly for this tutorial right here, working with Llama 3.
All right, cool.
So once we built it locally and we got it running locally, what we're going to do is
then update our crew to start working with Grok.
So we're going to be using Grok plus Llama 3 to run our crews much faster.
And the important thing to mention is as once we start using Grok, we can start accessing
the bigger version of Llama 3, the 7 billion parameter version, but we'll talk more about
that in just a bit, but I'm excited for you guys to get to this part because once you
start using Grok plus Llama 3, especially on the 70 billion parameter model, your minds
are just going to be blown.
So go ahead and we're going to dive into the rest of the video, but I do want to mention
before we do that, all of the source code that you're about to see, I'm going to give
away completely for free.
Just check out the description below to see how you can download it so you can skip all
the setup and everything and just download the source code and start playing around.
Let's go ahead and dive into the video.
Oh, wait, real quick.
I just want to mention if you run into any issues while you're watching this video, feel
free to check out the school community I created just for you guys.
You can actually post a problems that you're having with your code and post some screenshots
and myself or other developers in the community will make sure we get you help so that you
can get unstuck and continue coding out your crews, but it's completely free to join and
I'm sure you'll love to meet some of the other like-minded AI developers in the community,
but enough of that.
Check out the link down the description below and I can't wait to see you in the school
community, but let's hop back to the video real fast.
All right, so let's quickly cover what is Llama 3, how does it stack up against other
large language models, and then let's look at it in action before we start using it with
our crew.
So Llama 3 is the third generation of Meta's open source large language model known as
Llama, and this third generation is honestly getting super impressive and I've actually
really enjoyed using it on my own.
So here are basically key changes that compare Llama 3 to Llama 2.
So one of the main one is the context window doubled.
So right now it's at 8,000, so it's getting super comparable to ChatGPT 4.
Another thing is the new model of Llama is basically a lot more cooperative.
If you use Llama 2 a lot, you would notice that sometimes you would ask it something
and it would just plain out say, I can't do that.
I'm a large language model.
I can't do that.
So now it's getting a lot more cooperative, which I really like.
The other thing is there are two versions of Llama 3 that just came out, the 8 billion
parameters and the 70 billion parameters.
So the 80 billion parameter one is probably the one you're going to want to run locally
on your computer.
It's a lot smaller and it's actually super fast, which you'll see here in just a second.
However, if you need to do some more complex tasks, the 70 billion parameter model is honestly
really smart and it's slowly as time goes on, these Llama models are starting to get
really close to what ChatGPT 4 can do.
We're not quite there, but we're getting there.
Okay, so let's keep going.
So how does this LLM compare to some of the other ones?
Well, if you're looking at the 8 billion parameter model, you can see compared to Mistral and
Gemma that the new Llama 3 model basically wins on pretty much every front except this
one of these, basically this evaluation.
And also these are just different ways to evaluate models compared to one another.
And then when it comes to comparing the 70 billion parameter model for Llama 3, it's
also right up there and pretty much winning on pretty much every front.
So like I said, this is probably my new favorite LLM that I'm going to be using with to test
and basically troubleshoot some of my production apps.
And then especially if I'm looking for some free and fast alternatives to ChatGPT.
All right, let's keep chugging along.
So the other thing that's important, yeah, these are just some more comparisons.
So you can just see Llama 3 is pretty much kicking everything else's butt compared to
Claude Mistral and really everything else.
Let's keep going.
So the thing that's important for you as a developer when you're using these different
models is to know how big they are.
So you can see we're over here on the Ollama website, which is going to allow us to run
Llama 3 locally on our computer.
This is where you'll download it for Mac.
This is where you'll download it for Windows, but we'll talk more about this later on.
The important thing for you to know as a developer, the Llama 3 8 billion parameter model is about
4.57 gigs.
So pretty beefy.
And that's the really quick, fast one that you can run on your computer.
And if you want to use the one that's starting to get comparable to like ChatGPT 4-ish, then
you're going to have to use the 70 billion parameter model, which is 40 gigs.
So I know that's huge.
I've went ahead and downloaded it on my computer so you can see it in action here in just a
little bit.
But yeah, those are the two different models.
I definitely recommend starting off with the 8 billion one before moving over to the 70
billion one.
All right, let's keep chugging.
So right now we're over in Grok Cloud, and this is where you can basically test out using
different large language models using Grok.
And if you haven't heard of Grok, I have a video for it.
You'll definitely want to check it out after this one.
But basically Grok allows you to run large language models on chipsets that are designed
for running large language models, meaning they're super fast and it's also free to use.
So right now I just want to show you how fast this large language model is, Llama 3, using
Grok.
So let's say, hey, explain the importance of large language models.
So I'll run it and then you can see it spits out basically 900 tokens per second, which
is stupid because if you want to use Chachabit 4, you're going to expect to get around 40.
So this is like 40 to 20 times faster compared to Chachabit 4.
And then if we switch things up, so let me just save this, refresh it, and let's hop
over to the 70 billion parameter model.
So remember this one's bigger, larger, slower, but it's smarter.
So if I tried this one out once again, so it's still super fast and it's going to spit
out a really big and insightful answer.
But the main thing is we're still at 300 tokens per second.
So right there, or like I said, 8 to 10 times faster than Chachabit 4.
So this is, this is honestly crazy.
So now that we've kind of covered what is Llama, how it compares to everything else,
and just to show you how fast it is.
Now let's go ahead and move on to the next part of this video where we're actually going
to get Llama 3 up and running on our local computers using Ollama.
And then eventually after that, we're going to work on using Llama 3 with Grok.
So let's go ahead, hop over to our terminal and start getting things stood up.
All right, so let's quickly cover how to download and set up Ollama on your local computer so
that you can run large language models like Llama 3 completely for free and keep all your
data completely private on your local computer.
So the first thing you're going to want to do is head over to Ollama.com.
Once you're here, you're just going to click the download button and this will actually
just allow you to download it and then you're going to install it.
I actually have a full video that walks you through the entire process of getting it set
up.
I'll put a card in the corner so you can watch that video right after this if you have any
questions.
But once you've downloaded and installed Ollama, what we can start to do is start using some
of the models they have available to us.
So today we're going to be using Llama 3, but as you can see, they have a bunch of different
options.
So let's go ahead and click Llama 3 so we can see what commands we need to do to get
started.
So right here is the important command that you're going to want to run once you have
Ollama set up to actually pull down the Llama 3 language model and then run it.
And the important thing is, just in case you haven't used this before, over here on the
left hand side, you can see there are some different tags.
So the latest model, which we currently have selected, is the 8 billion parameter option
that is right about 5 gigs.
But if you wanted to, you can change things up and you could click the 70 billion model
and this is how you can get the 40 gig option.
So my computer really isn't beefy enough to run this one yet.
I actually tried it out.
Not strong enough.
I got to get an upgrade.
So we're mostly going to be sticking with the 8 billion parameter model.
So let's be super explicit.
Click that one.
And now we're going to copy this command right here.
Next what we're going to do is head over to our terminal.
And this is where we're going to be actually interacting with Ollama.
So once you have Ollama installed, you should be able to type it in and see all the different
available commands that you have.
And in our case, what I'm going to do is type in Ollama list so you can see which models
I have installed.
So right now you can see that I actually do have Llama 3, the 8 billion parameter model
already installed and I can run it.
So what we'll do is we'll paste in that command that we just grabbed from Ollama.
And what this will do, if this is your first time running the command, is first it will
download the large language model.
And that'll usually take about 20, 30 minutes or less, depending on your internet speed.
And once it's downloaded and saved on your computer, you can just run it instantly.
So I'm just going to type in Ollama run.
And what this will do is it'll allow me to start chatting with it, just like we normally
do whenever we're talking to like chatGBT.
So tell me about the importance of large language models.
So, you know, what you'll notice is this is not generating at the 800 or 900 tokens per
second, like we were working on when we were using Grok.
But the part is nice that this is all private and it's all local and it's free.
So, but like you see, it is completely working.
So now that we have Ollama set up, what we can start to do is we can actually create
if we wanted to, we're going to make something called a, we're going to use a make file so
that we can start creating our own custom large language models that are specialized
to work with crew AI.
So here's how we do that.
First, what you're going to want to do, if you haven't already downloaded the free code
repo that I have shared down in the description below, be sure to click that.
But what you're going to do is you're going to start using this model file.
Now what the heck is this?
Well, a model file defines some specific properties that we want to use whenever we are custom
making a custom large language model.
And the important thing that you really just need to take out of all of this is we are
setting up parameters to listen to the keyword stop.
So anytime we see the word result, we want to stop.
That's basically my interpretation of it.
And there's actually over on the crew AI website, there's a full basically page talking about
this.
And I go into much more detail in that specialized OLAMA tutorial that I have in just referenced
a few minutes ago.
So what we're going to do is we're actually going to use this command right here to create
a brand new large language model that's made just for our crew.
So what we're going to do is hop back over to our code real fast, right over here.
And what we're going to do, if I just type in LS, you can see that I can see our model
file.
And what you're going to do is you're going to type in OLAMA create.
And then we want to create basically the name that we want to reference it.
So in our case, we're going to pass in the name.
So I'm just going to do crew AI LLAMA3.
And I'm just going to do the 8 billion model.
Because if you come back over here, you can see that's the one we're going to use.
And then from there, we do dash F, which says, Hey, go look at this file.
And then I want to look at the model file.
So what this will do is it'll take a few seconds, but it'll actually configure and customize
our language model to start using this.
So now if I do OLAMA list, I can now see that I have a crew AI LLAMA3 8B.
So that's exactly what we just typed up here.
Cool.
So now we have OLAMA set up and we have created basically our LLAMA3 model that's specialized
for working with crew AI.
So what we're going to do next is let's actually go ahead and hop over to Visual Studio Code
so we can see the crew that you're going to be building and we can start connecting it
up to run with OLAMA.
So let's go ahead and hop over there now.
And real quick, before we dive into the code, I think it's super important to give you an
overview of what we're about to do.
So our whole goal is we are trying to create all of the content that we need to advertise
a new product that we're trying to create and create some images and copy for Instagram.
So that's what we're trying to do.
So we have set up two crews that are going to work together.
So crew one is going to be responsible for writing the copy.
So basically all the nice text and descriptions of a new product we're going to be creating.
And then the second crew is going to be basically the image creator.
And we're really just going to be creating the descriptions that we need to pass over
to Midjourney.
So here's exactly what's going to happen.
We're going to have in the first crew, three different agents that are going to go and
look at what's happening in the market, basically come up with some strategy and then a creative
agent who's going to actually work on typing up the nice copy that's going to get passed
over to crew two.
Now crew two is going to take in that copy that was just generated and come up with for
each of the three different copies that were created or three different like, you know,
nice summaries of the product.
We're going to create a Midjourney prompt for each one of those copies that we will
have nice images and nice text that we could go over and post on Instagram.
So that's what we're going to basically create.
So let's go ahead and hop over to the code again.
And here I'll actually walk you through setting up your environment and then building these
crews.
So let's go ahead and hop over.
All right.
So welcome to the fun stuff.
We're going to start coding up our crew and help speed things up.
What I'm going to do is quickly run you through the process of setting up your environment.
Then we're quickly going to run through our agent task and our crew.
I'm not going to spend a ton of time on that just because this is a Llama 3 tutorial.
And then finally, we're going to go ahead and run our local crew and talk about some
of the feedback that I have about using Llama 3 locally.
Okay.
So let's go ahead and dive in.
So the first thing you're going to recognize over here is we have a file called our pyproject.toml.
Now if you haven't used this before, definitely check out my crew AI crash course, but basically
this is our project dependency file where we define, you know, Hey, this is the tool
we're creating and it helps us create a Python environment for this crew and install these
dependencies.
So let's go ahead and do that real fast.
So what we can do is head over to our terminal and we can, you know, once we have poetry
installed to our, whenever you type in poetry, it gives us these types of commands.
What we can do is go ahead and install all of these dependencies.
So in our case, we'll do poetry install dash dash no root.
And what this will do is go off and download all of these dependencies.
And it takes, you know, just about five to 30 seconds to install.
I've already done that on my machine.
So I'm going to skip it.
What'll happen next is you can type in, let me get rid of that.
Once it's installed, you can type in poetry shell.
And what this will do is it'll spin up an interactive version of the shell that you
can see, you know, it went ahead and created our marketing crew and it basically created
a Python virtual environment that's going to encapsulate all of our dependencies that
we can use as we are building out our project and to run our crew whenever it comes time.
And one of my favorite tricks is you can just copy that URL right there.
And then whenever you're looking at a file inside of Visual Studio Code, you can click
down here where basically it's asking for the interpreter.
You can click enter interpreter path and then paste in that line right there and it'll set
your Visual Studio Code to look at the virtual environment you just created.
And that's going to make it so that you don't end up with a bunch of squiggly lines inside
of your Python code of like, Hey, this dependency is missing.
All right.
Now that we got all that out of the way, let's go ahead and start talking about our main.py
file.
We're going to talk about our agents and our task.
And like I said, we're going to speed through this just because this is, we just want to
get over to actually running our crews with Llama.
So what do we have going on?
Well, inside of our main.py file, this is where we're going to be setting up our crew,
setting up our agents and tasks.
And what you can kind of see just at a very high level, you can see we have the copy crew,
which we discussed earlier.
And then down here, we have the, basically the image crew or the mid journey crew.
So let's give a quick deep dive into each one of these so you can see what the heck's
going on.
Well, inside of our copy crew, we're going to have these three agents, our product, a
competitor agent, strategy planner, and creative agent.
And these ones are just going to be focused towards, you know, basically looking at the
market.
It's important to know each one of these agents does have access to go search the internet
and also search Instagram, and you can actually dive in to actually looking at what these
tools do.
So you can see Zhao, the creator of this tool, which by the way, you can actually see over
here, I'm just pulled down the Instagram post example that Zhao created.
And I went ahead and repurposed it.
So it will work nicer for LLM, basically Llama3 for you guys.
So yeah, all credit goes to Zhao on this one.
I just went ahead and tweaked it, but what you can see is he set up a nice tool called
search internet.
And then what he does is whenever he wants to search Instagram is he just adds an additional
query phrase before passing in the query.
That way we'll actually search on Instagram.
So that's what's going to happen.
We're going to have agents that go off and search the internet.
They're going to search Instagram as well, and they're basically just going to collaborate
to start writing copy for our, basically for our Instagram ads.
Same with a creative agent.
They're going to go off and make some, some nice narratives about what we're doing.
Okay.
So that's, what's happening on the agent side, but what about the task side?
Well, once again, this is where we're going to pass each one of these agents that you
can see right here.
Each one of these agents is start is going to start getting tasks.
So we can see the product competitor agent is going to do the website analysis and same.
They're also going to do the market analysis and strategy planner is going to do strategy.
And then when it comes to the creative agent, that's just going to get called for basically
writing the copy.
All right.
So over here, what you can see in the task, this is all pretty standard crew AI stuff.
We pass in the agent that we want to perform the task, and then we're going to pass in
the product website and product details so that our crew knows what it needs to write
about.
And we're just going to do the same for all of our different tasks.
Like I said, we're kind of speeding through this because we want to focus on Lama three.
All right.
So how do we actually start using Lama three?
Great question.
Well, if you come back over to our agents.py file, what you'll notice at the very top of
our file, we set up a self LLM.
So we basically set up inside of our marketing and analysis agents, our class.
We are defining a property on the class called our LLM, our large language models.
And we're saying, Hey, I want our large language model to be equal to, and this is a little
trick that you'll notice whenever you want to start referencing, Oh, Lama, Oh, Lama is
actually running at all times.
So if you actually go up to your top of your toolbar, when it's running, you can see, Oh,
Lama is running right here.
And then that's how you know it's running.
But what's cool is it's a server that's constantly running all of your different, basically large
language models that you can actually make API requests to.
So in our case, we are wrapping our large language models inside of the chat, open AI
library.
And what that is going to allow us to do is start interacting with our local LLMs and
make them behave just like we're talking to chat GBT.
So this is going to be super nice.
And the other thing that's super important to mention is you can define which crew or
which LLM you want to talk to.
So in our case, we want to talk to our 8 billion parameter Lama three model.
So in our case, we'll update this to be our 8 billion one.
And just to double check, you can see which one you need to use by doing, let's clear
all this out.
Oh, Lama list.
And then you can see right here that I want to use crew AI Lama three, eight B copy and
paste that.
And that looks exactly like what we have here.
All right, good.
And this is the URL for that server for running a Lama that has access to all of our LLMs.
Okay, cool.
So that's how we set it up.
And now we can start using this LLM and all of our agents.
So that's what you're going to see right here.
LLM is equal to that.
And we're going to do this for each one of our LLMs.
And the reason this is super important that you add it to each one of the LLMs inside
of your agents that pie file is if you don't, it's going to default over to chat GPT four.
So if you actually command click the agent class, you can see if you scroll down in here
and actually look up LLM right around here, the default is going to be chat, open AI,
and the default is going to be chat GPT four.
So if you don't specify a name, it's going to do one for you.
And that's going to be checked up for, which is going to start costing you money.
Okay.
The other thing that you might notice that's interesting about this file is I say that
the API key is in a.
You just have to put something here.
You just can't leave it blank.
So in a works and that's how you can start accessing along.
All right, cool.
So now that we have this set up, let's go ahead and actually start running it.
And then I can describe some of the feedback that I have about using the 8 billion parameter
model of LLMA3.
So what we're going to do is we're going to head back over to our, over here in our terminal.
Let's clear things up.
Let's get rid of this one too.
See clear this it's split for some reason.
Yeah.
We'll just run it down here.
We'll just make a new one just so you guys can see it from scratch.
Cool.
So one more time, poetry shell.
Now we have access to our marketing crew and now I can start running it.
So if I type in Python and I'll type in main.py, this will start running our crew and it'll
start using that, you know, making sure we're going to be using that 70 billion, sorry,
8 billion parameter model three of LLMA3.
So if I run it, it'll go off and it'll start actually executing.
So here are a few things that I think are super important about using LLMA3.
Now this will run, this will just take an insanely long amount of time.
So you can see right now that it's kicking off our crew and it is going to actually start
using some of the tools.
But what I have noticed is LLMA3, the 8 billion one is phenomenal at smaller tasks.
So the fact that this crew is going to be talking and making decisions and searching
the internet, getting back a ton of information, I have noticed this model kind of falls apart.
So I would definitely recommend using LLMA3 for smaller tasks that are just very quick
and dirty, such as, you know, hey, convert this file that is in Markdown over to HTML.
I like those simple inputs and output tasks that don't require a lot of creativity.
I have noticed LLMA3 works the best for, so I would definitely recommend doing that.
But I just want to show you guys that it is feasible to go ahead and do it and then it
will run.
And like I said, this will just take a very long time to do.
So I'm going to go ahead and stop this and we're going to switch over to the next part
where I'm going to show you how to start speeding things up because you can see this is super
slow.
So next in the next part of this, we're going to start connecting things to Grok.
We're going to use the same model and you're going to see how much faster it works.
And then we're also going to start using the 70 billion parameter model of LLMA3 just so
you can see how much smarter and how much better the results are.
So let's go ahead and cut to the next part where we're going to start working with Grok.
All right.
So let's go ahead and start setting up Grok inside of our crew.
Now, this is going to be the simplest change that you've ever seen, but this is why I love
working with crew AI because it makes it super easy to substitute the different LLMs that
you're working with.
So let me show you what you got to do.
So up here in the constructor of our agents.py file, we're going to remove this LLM file
or property right here, and we're going to update it.
And all we did is we changed it.
I'll go back.
We used to have chat open AI, and then now we changed it over to chat Grok.
Chat Grok is the way that you can access Grok.
Now let me show you, how are we able to do that in the first place?
Well, what you notice is back in our pyproject.toml, we had something called LangChainGrok, and
this is what enables us to add in the chat Grok package.
So what we can do now is if you are on a Mac, you can hit command dot, and this will give
you the ability to update your package imports.
So now you can see from LangChainGrok, that library that we just imported, we can now
add in the chat Grok class, which basically makes our crew, it gives us access to start
using Grok.
All right.
Now let's dive into this because it's a little bit different.
So the first thing you'll notice is we are now passing in an API key, specifically we're
passing in our Grok API key.
Well where the heck did that come from?
Well, if we head over to our .env file, you'll see that I have a Grok API key, and I got
this actually from working over here in Grok cloud.
So if you head over here, let me zoom in for you guys.
So if you head over to console.grok.com, it'll take you to like the cloud area.
And inside of here, you can update and create your own crew AI API keys.
So you'll just click create API keys, give it a name, and it'll generate the keys.
And it's important that you save these keys inside of your environment variable file.
That way no one else has access to them.
And it's super important to make sure that your .env file is ignored so you don't accidentally
copy and paste your Grok keys to the web.
Okay.
All right.
Now that we have that set up, what we need to do is hop over to the next part, which
is figuring out which model we want to use.
So you have a few different options when it comes to LLAMA3.
Remember you have the 70 billion parameter or the 8 billion parameters.
So how do you know what are the official names?
Well, if you head back over here to the Grok playground, what I like to do is go over to
the model sidebar that you can see right here and clicking it to see what are the different
names.
So in our case, you can see you can use LLAMA3.
This is the 7 billion one.
And basically this 8 number is the context window.
So this is how many tokens you can pass in.
And as you can see earlier, we talked about it doubled.
Yep.
This is where you can see it doubled.
We went from 4096 to almost 8200, which is huge.
So, but yeah, these are the two different models you can use when it comes to LLAMA3.
And eventually you'll be able to use the LLAMA3 400 billion parameter one that's, it's still
in training.
So we don't, no one has access to it yet, but we hopefully will all soon.
So what we're gonna do in our case is start off with the 8 billion parameter model.
So what you can see is come back over here, LLAMA3 8 billion.
Great.
So that is all working.
So what we can do now is we can head over to our terminal and start running our crew
now using the updated version that's using Grok.
And like I said, because we set this LLM everywhere inside of our different agents, we had to
make a substitution in one place and it's just going to work everywhere and be super
seamless.
So let's go ahead and head back over to our terminal and let's go ahead and start running
it.
So we can just type in python.main and I actually have to reopen poetry.
Yeah.
As you can see, it said base, but now it says the actual proper, proper one.
So I can type in now python.main.py and it'll start running our new crew.
And what you can see is it's going so much faster than the other one.
Whenever we were running it locally, it actually went ahead and timed out.
What did it time out?
It just got stuck for a long, long time.
So now it's going to go off and just start pinging the web, going back and forth, back
and forth.
So I'm going to go ahead and actually cancel this because it takes forever to run.
And like I said earlier, when it comes to working with the, basically the 8 billion
parameter set, it is smart, but it's made for quick tasks that need to be executed.
And like I said, when we're working with this large, creative, complex crew, it's not the
best.
So what I want to do is go ahead and update it to the 70 billion parameter model.
So you can see that in action.
Super, super simple change.
You'll update this to 70 billion.
And what that'll do is, like I said, just swap which LLM we're using, but we also need
to make a quick change.
And what I'm going to do just so you can actually see what I'm talking about is we're going
to get rate limited.
So I'm going to go ahead and run it, show you that we get rate limited, and then I'm
going to show you how to fix it afterwards.
So if we come back over here, let's go ahead and rerun our crew.
And you can see now we're going to be using the 80 billion, 70 billion parameter model.
And this one is going to go off and basically it just, the results it's going to get and
the ability of the model to understand its historical context and really just understand
where it's going.
Like these results are 10 times better than what we were just experiencing a few seconds
ago.
So as you can see, this is going off.
It's actually already starting to generate potential.
You know, it's doing research to figure out competitors for our temperature controlled
coffee mugs.
That's by the way, what we're creating our Instagram posts about is smart mugs.
So as you can see, it's going off and actually finding mugs on the internet.
So this one is awesome.
But if you keep letting it run, what you're going to see here in a little bit is it's
going to get rate limited.
So I'm going to pause and come back once it actually hits a rate limit and show you how
we're going to fix it.
So after a few more minutes of running, we actually got rate limited, like I was just
talking about.
And this comes down to the fact that when you use Grok, you are only allowed a certain
number of tokens per minute.
So you can see right here, we hit a rate limit.
So 429 means rate limit.
And then we hit a token per minute limit.
So you can see that the limit is 3,500.
We used 1,400 and we're requesting another 22, which would have all in all exceeded us.
So that's why we got rate limited and it stopped.
So here's what we can do to actually fix this issue so that we don't have to keep worrying
about it.
Now, this is a temporary solution and crew AI is improving and fingers crossed, they're
going to add in a token per minute feature as well to our crews so that we no longer
have to worry about it.
But as a current workaround, what you have to do is come down in here and set up your
RPM max.
So this stands for maximum, basically, you can see right here, the maximum number of
requests per minute for the crew to execute.
So what I'm going to do is set it to two, which is kind of slow, but this is the current
workaround to get access to LLAMA3 and have that smarter LLM working and not get rate
limited.
So that's what I'm going to have to do.
And two seems to be the, you know, for large creative tasks like this, where we're doing
a ton of research on the internet, two has seemed to be sweet spot to get it working.
So what I'm going to do is now that I have it saved, we're going to hop back over here
to our crew and we're going to go ahead and rerun it.
And once it's done, I'll go ahead and show you the results as soon as it gets done.
So we're going to do python.main, kick it off.
And once it's finished running, I'll tag you guys back in so you can see the final copy
and mid journey pictures that it generates for us.
So let's go ahead and give it a second and dive back in.
All right, guys.
So now that we fixed the rate limit issue, it took just a few more minutes to run, but
it finally worked.
And I want to show you the outputs that it created.
So here are the three different pieces of copy that it created.
So these are the tags that we could put on our Instagram post, you know, like, Hey, wake
up to the perfect cup of coffee.
Say goodbye to lukewarm coffee, which is crazy because we're making a temperature controlled
coffee mug and it figured out exactly what to say, like, this is the problem and here's
the solution, our temperature controlled coffee mug.
So like it actually produced some pretty amazing results.
And also you can see it came up with some other ones like, Hey, here's our temperature
controlled mug.
And then same thing for the other option.
But what's really cool is here are our three mid journey descriptions that it created for
us.
So here are the images created.
So not going to lie, the first options and it's just a regular coffee mug.
But if you go to option number two, it actually properly called out the fact that like, Hey,
we're using lighting and some smart LEDs on the display to show that this is a smart mug.
So I really like this mug and this mug, and you know, this is just the start AI.
We gave it the initial prompt, it got us 80% there to the, to the solution.
And now it's up to us to go off and tweak what we want to do.
So this is, this is super cool.
And then option three and not a, not a big fan of two, but I think it, you know, it got
us started in the right direction with some smart thermoses.
So this is exactly what we needed.
So yeah, all around super impressed with the results.
And this is super cool because you build this crew once and then you can run it as much
as you want.
And AI does all the work for you.
And that's a wrap for this video, guys.
I hope you enjoyed learning about Llama 3, Crew AI, Grok, and literally everything else.
And if you did, I have a ton of other AI content right here on this channel that I'm sure you're
going to love.
I have a bunch of full stack tutorials and a bunch of other crew AI material.
So definitely want to check that out after this video.
And if you need any help, drop a comment down below or check out that free school community
I created for you guys.
But enough of that.
Can't wait to see you guys in the next video.
Have a great day.
See ya.