You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the Agent() class where the parameter name for specifying the language model (llm) is case-sensitive, leading to unexpected behavior:
Using llm=llm works correctly with a custom LLM (e.g., Ollama).
Using LLM=llm causes the system to fallback to OpenAI's LLM, prompting for an API key (liteLLM error).
This inconsistency causes confusion and may lead to unintended fallback behavior.
- Add case normalization for 'LLM' parameter with deprecation warning
- Add comprehensive type conversion for LLM parameters
- Add proper error handling for parameter conversion
- Add tests to verify parameter handling
Fixes#1817
Co-Authored-By: Joe Moura <[email protected]>
Description
There is a bug in the Agent() class where the parameter name for specifying the language model (llm) is case-sensitive, leading to unexpected behavior:
This inconsistency causes confusion and may lead to unintended fallback behavior.
Steps to Reproduce
Expected behavior
The Agent() class should:
Screenshots/Code snippets
Operating System
Windows 11
Python Version
3.12
crewAI Version
0.86.0
crewAI Tools Version
0.17.0
Virtual Environment
Venv
Evidence
With LLM used
the code:
terminal output:
With llm used
The code:
terminal output:
** The code is working
Possible Solution
The issue can be resolved by:
Additional context
This issue is critical for users integrating custom LLMs like Ollama and can lead to unnecessary fallback to OpenAI if not addressed.
The text was updated successfully, but these errors were encountered: