crewAI
crewAI copied to clipboard
Default Agent LLM factory Mistral/other OpenAI compatible API problem
Hi @ all
after some discussions in discord and testing with mistral it seems that the agent setup cases some problems.
https://github.com/joaomdmoura/crewAI/blob/2f0bf3b325c86d913ec0c58a280c85120330776d/src/crewai/agent.py#L94-L99
Right now if I do not explicitly set the LLM.model value, anything that is passed as variable is getting overwritten by the default factory.
export OPENAI_API_KEY=your-mistral-api-key # ok
export OPENAI_API_BASE=https://api.mistral.ai/v1 # ok
export MODEL_NAME="mistral-medium" # get over written by default factory setting model="gpt4"
I can think of two solutions:
- remove the default to gp4 and only add it in post_init after checking for the system environment variables
- write a general wrapper around the agent instantiation that supports alternative settings i.e using the specific implementations from different llm providers.
I'm in discord up for discussion :) cheers Michael
Me too!
Possibly related to #244 ?
Fixing this with a new patch and updating the docs tonight