Unable to Initiate Crew using Local Ollama

I Have defined my LLM as

from crewai import Agent, Task, Crew, LLM
llm = LLM(
model=“ollama/llama3.2”,
base_url=“http://myremoteserveraddress:11434”,
api_key=“ollama”
)
Agents and Tasks are creating but while initiating Crew I am getting this error
ValidationError: 1 validation error for Crew
Value error, Please provide an OpenAI API key.

Have you enabled memory?

Yes I have enabled
#Create Crew
crew = Crew(
agents=[support_agent, support_quality_assurance_agent],
tasks=[inquiry_resolution, quality_assurance_review],
memory=True,
verbose=True,
llm=llm
)

Memory uses OpenAI by default hence why you need a key

1 Like

Thanks It worked. So resolution is
“Dont use memory when working with Local Models”. Hope it helps others

Using memory is not a requirement for using local models, If you want to use memory and you don’t want to use open AI, then you need to use a custom embedding on your crew

1 Like