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

Code

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:

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?

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

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

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

1 Like

@Dabnis That solved the problem. Thanks!

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