# How to use the gpt-4o-mini LLM?

**URL:** <https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369>\
**Category:** CrewAI Community Support\
**Created:** [September 13, 2024, 10:36am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369 "2024-09-13T10:36:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [September 13, 2024, 10:36am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/1 "2024-09-13T10:36:08Z")

</div>

# Code

```auto
from langchain_openai import ChatOpenAI
import streamlit as st

llm = ChatOpenAI(
    api_key=st.secrets["OPENAI_API_KEY"],
    model="gpt-4o-mini",
)

```

I pass the LLM to the `manager_llm` parameter of the Crew as follows:

```auto
self.crew = Crew(
    agents=[
        self.agent_1,
        self.agent_2,
        self.agent_3,
    ],
    tasks=[
        self.task_1,
        self.task_2,
        self.task_3,
    ],
    manager_llm=llm,
    process=Process.sequential,
    verbose=True,
)

```

# Problem

When I use AgentOps, I see the `gpt-4o` being used instead of the `gpt-4o-mini`. Do I need to pass the `gpt-4o-mini` directly to all agents and/or tasks?

---

<div class="post-metadata">

**Author:** ![Dabnis](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@Dabnis](https://community.crewai.com/u/Dabnis)\
**Post date:** [September 13, 2024, 10:41am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/2 "2024-09-13T10:41:06Z")

</div>

I believe that GTP-4o is the default. While you set your manager\_llm to GTP-4o-mini, you have not set that LLM for each of your Agents. The Agents will default to GTP-4o

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [September 13, 2024, 10:53am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/3 "2024-09-13T10:53:57Z")

</div>

@Dabnis Do I need to set that to each individual agent as well? I thought the `manager_llm` takes care of this.

---

<div class="post-metadata">

**Author:** ![Dabnis](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@Dabnis](https://community.crewai.com/u/Dabnis)\
**Post date:** [September 13, 2024, 10:58am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/4 "2024-09-13T10:58:01Z")

</div>

I believe that if you do not set an llm for an Agent then it defaults to GPT-4o, so yes in each Agent set llm=llm #your llm

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [September 13, 2024, 11:03am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/5 "2024-09-13T11:03:35Z")

</div>

@Dabnis That solved the problem. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/ecda97e72f77c7100e0a761444b1c991925cc789.png) [@system](https://community.crewai.com/u/system)\
**Post date:** [September 14, 2024, 11:04am UTC](https://community.crewai.com/t/how-to-use-the-gpt-4o-mini-llm/369/6 "2024-09-14T11:04:01Z")

</div>

Closed on September 14, 2024, 11:04am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
