How to connect CrewAI to different LLMs (GPT4o, Groq, Llama3, Ollama) - Tutorial & LLM comparison

Infinite Codes · Beginner ·🧠 Large Language Models ·1y ago
I tested CrewAI with different LLMs (GPT4o, Groq, Llama3, Ollama) - FULL walkthrough tutorial & LLM comparison In this tutorial, I will show you how to connect crewAI to different LLMs both local and in the cloud. I will then do a full performance and cost comparison for all the tested models. The tested LLMs are ChatGPT-3.5-turbo, ChatGPT-4-turbo, ChatGPT-4o, Groq with Meta’s Llama3 and Mixtral, as well as Llama3 locally with Ollama. I will do a technology review for all the technologies used in the video and walk you through setting up the crew from cloning Joao Moura’s crewai-examples repository, environment and dependency setup to changing the code to use the different LLM backends. I will then run the code for the different LLMs and compare them in terms of runtime, cost and results Links: https://www.crewai.com/ CrewAI website https://github.com/joaomdmoura/crewAI crewAI Github Repo https://github.com/joaomdmoura/crewAI-examples/tree/main crewAI Examples Repo https://console.groq.com/ Groq API key https://ollama.com/ Ollama https://platform.openai.com/docs/overview OpenAI Platform (for OpenAI API key) https://serper.dev/ SerperDev API key My previous CrewAI tutorials: https://www.youtube.com/watch?v=w0yJKFyQ2A8 general CrewAI tutorial https://www.youtube.com/watch?v=IacRMYTm-Is CrewAI instagram Crew Chapters 00:00 - Intro 01:08 - Technology Review: LLMs, CrewAI, AI Agents 03:46 - Set up the Crew: Clone the repo and change some code 12:20 - Set up environment and Dependencies, add API keys 17:15 - Comparing OpenAI LLMs (GPT-3.5, GPT-4, GPT-4o) 22:56 - Groq (with Llama3 and Mixtral) 29:40 - Run Local LLMs with Ollama 34:06 - Final Results & Cost comparison
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Infinite Codes · Infinite Codes · 15 of 39

1 Why Python is the BEST programming language (Top 10 2024)
Why Python is the BEST programming language (Top 10 2024)
Infinite Codes
2 The Most Fun Programming Language for Beginners!
The Most Fun Programming Language for Beginners!
Infinite Codes
3 Why Python is the Hottest Programming Language
Why Python is the Hottest Programming Language
Infinite Codes
4 How to delete a repository in GitHub (2024 updated)
How to delete a repository in GitHub (2024 updated)
Infinite Codes
5 How to get OpenAI API key / ChatGPT API key (2024 updated)
How to get OpenAI API key / ChatGPT API key (2024 updated)
Infinite Codes
6 How to clone GitHub Repository (2024 updated)
How to clone GitHub Repository (2024 updated)
Infinite Codes
7 How to Clone GitHub Repository in Visual Studio Code (2024 updated)
How to Clone GitHub Repository in Visual Studio Code (2024 updated)
Infinite Codes
8 How to Push Code to GitHub from Visual Studio Code & Create a GitHub Repository (2024 updated)
How to Push Code to GitHub from Visual Studio Code & Create a GitHub Repository (2024 updated)
Infinite Codes
9 How to Push Code to GitHub on the Command Line (2024 updated) - with Authentication
How to Push Code to GitHub on the Command Line (2024 updated) - with Authentication
Infinite Codes
10 CrewAI Tutorial: Automate your Life with AI Agents
CrewAI Tutorial: Automate your Life with AI Agents
Infinite Codes
11 Automate your Life with AI Agents (EASY CrewAI Tutorial)
Automate your Life with AI Agents (EASY CrewAI Tutorial)
Infinite Codes
12 I Automated my Instagram with AI Agents - CrewAI Hierarchical Tutorial (Instagram Automation)
I Automated my Instagram with AI Agents - CrewAI Hierarchical Tutorial (Instagram Automation)
Infinite Codes
13 How I’d learn Machine Learning & AI in 2024 (if I could start over) -- 7-step Roadmap
How I’d learn Machine Learning & AI in 2024 (if I could start over) -- 7-step Roadmap
Infinite Codes
14 How to Create an EC2 Instance in AWS in 2024
How to Create an EC2 Instance in AWS in 2024
Infinite Codes
How to connect CrewAI to different LLMs (GPT4o, Groq, Llama3, Ollama) - Tutorial & LLM comparison
How to connect CrewAI to different LLMs (GPT4o, Groq, Llama3, Ollama) - Tutorial & LLM comparison
Infinite Codes
16 How to Learn Machine Learning in 2024 (7 step roadmap)
How to Learn Machine Learning in 2024 (7 step roadmap)
Infinite Codes
17 How to Use Ollama in 3 minutes -  Run LLMs locally for FREE (LLama3 & more)
How to Use Ollama in 3 minutes - Run LLMs locally for FREE (LLama3 & more)
Infinite Codes
18 How to get a Groq API key - Run LLMs for FREE (LLama3 etc.)
How to get a Groq API key - Run LLMs for FREE (LLama3 etc.)
Infinite Codes
19 What is Groq? - 30 seconds
What is Groq? - 30 seconds
Infinite Codes
20 Perplexity AI Tutorial: Why you don't need Google and ChatGPT anymore
Perplexity AI Tutorial: Why you don't need Google and ChatGPT anymore
Infinite Codes
21 All Machine Learning algorithms explained in 17 min
All Machine Learning algorithms explained in 17 min
Infinite Codes
22 How Math makes Machine Learning easy (and how you can learn it)
How Math makes Machine Learning easy (and how you can learn it)
Infinite Codes
23 15 Machine Learning Lessons I Wish I Knew Earlier
15 Machine Learning Lessons I Wish I Knew Earlier
Infinite Codes
24 Learn Machine Learning Like a GENIUS and Not Waste Time
Learn Machine Learning Like a GENIUS and Not Waste Time
Infinite Codes
25 All Machine Learning Concepts Explained in 22 Minutes
All Machine Learning Concepts Explained in 22 Minutes
Infinite Codes
26 All Machine Learning Beginner Mistakes explained in 17 Min
All Machine Learning Beginner Mistakes explained in 17 Min
Infinite Codes
27 Neural Networks in 100 seconds
Neural Networks in 100 seconds
Infinite Codes
28 Generative AI in 100 seconds
Generative AI in 100 seconds
Infinite Codes
29 GPTs in 100 seconds
GPTs in 100 seconds
Infinite Codes
30 22 Machine Learning Projects That Will Make You A God At Data Science
22 Machine Learning Projects That Will Make You A God At Data Science
Infinite Codes
31 Transformers in 100 seconds
Transformers in 100 seconds
Infinite Codes
32 THIS is Why Machine Learning Is Hard For you
THIS is Why Machine Learning Is Hard For you
Infinite Codes
33 Deep Learning in 100 seconds
Deep Learning in 100 seconds
Infinite Codes
34 30 Machine Learning Facts Most People Get Wrong
30 Machine Learning Facts Most People Get Wrong
Infinite Codes
35 Gradient Descent in 100 Seconds
Gradient Descent in 100 Seconds
Infinite Codes
36 Computer Vision in 100 Seconds
Computer Vision in 100 Seconds
Infinite Codes
37 Reinforcement Learning in 100 Seconds
Reinforcement Learning in 100 Seconds
Infinite Codes
38 32 Machine Learning Facts That Make No Sense
32 Machine Learning Facts That Make No Sense
Infinite Codes
39 What is Machine Learning? Your 2025 Guide to the AI Revolution
What is Machine Learning? Your 2025 Guide to the AI Revolution
Infinite Codes

Related AI Lessons

GPT-5.5 vs Claude Opus 4.7: Which Frontier Model Should You Actually Use?
Learn how to choose between GPT-5.5 and Claude Opus 4.7 for your workflow, and understand the key differences between these two frontier models
Medium · LLM
GPT-5.5 vs Claude Opus 4.7: Which Frontier Model Should You Actually Use?
Learn which frontier model, GPT-5.5 or Claude Opus 4.7, is best suited for your workflow and why it matters for AI-driven tasks
Medium · ChatGPT
I Audited 70 Companies' llms.txt Files. Most Don't Have One.
Learn why most companies don't have an llms.txt file and how to create one to improve LLM transparency
Dev.to · Intally
AI is a Bubble … But It’s Also the Future
AI is a rapidly growing field with immense potential, but also faces challenges and uncertainties, making it a bubble that's also the future
Medium · AI

Chapters (8)

Intro
1:08 Technology Review: LLMs, CrewAI, AI Agents
3:46 Set up the Crew: Clone the repo and change some code
12:20 Set up environment and Dependencies, add API keys
17:15 Comparing OpenAI LLMs (GPT-3.5, GPT-4, GPT-4o)
22:56 Groq (with Llama3 and Mixtral)
29:40 Run Local LLMs with Ollama
34:06 Final Results & Cost comparison
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →