# What are the LLMs that crewai supports, getting error LLM value is an unknown object

**URL:** <https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796>\
**Category:** General\
**Created:** [February 13, 2025, 6:15am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796 "2025-02-13T06:15:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 13, 2025, 6:15am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/1 "2025-02-13T06:15:11Z")

</div>

I am building stock, forex and crypto research multi agent application.  
let me know what are the LLMs that crewai support apart from OpenAI, looking for free LLM.  
code1:

```python
ollama_llm = OllamaLLM(model="llama2") 
 agent = Agent(
            role=value["role"],
            goal=value["goal"],
            backstory=value["backstory"],
            tools=tools,
            llm=ollama_llm, # ✅ Pass Ollama LLM here
            verbose=True
        )
code2:
groq_llm = ChatGroq(
        model_name="mixtral-8x7b-32768",
        api_key=GROQ_API_KEY
    )
 agent = Agent(
            role=value["role"],
            goal=value["goal"],
            backstory=value["backstory"],
            tools=tools,
            llm=groq_llm,
            verbose=True
        )

```

I tried multiple options and still getting the error:

```bash
LLM value is an unknown object

Provider List: https://docs.litellm.ai/docs/providers

ERROR:root:Failed to get supported params: argument of type 'NoneType' is not iterable
Error in CrewAI analysis: 'str' object has no attribute 'get'

```

---

<div class="post-metadata">

**Author:** ![zinyando](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/zinyando/32/4435_2.png) [@zinyando](https://community.crewai.com/u/zinyando)\
**Post date:** [February 13, 2025, 9:28am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/2 "2025-02-13T09:28:55Z")

</div>

Here is a list of supported LLMs from the CrewAI docs [LLMs - CrewAI](https://docs.crewai.com/concepts/llms#available-models-and-their-capabilities)

---

<div class="post-metadata">

**Author:** ![Mayank\_Gupta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/mayank_gupta/32/2208_2.png) [@Mayank\_Gupta](https://community.crewai.com/u/Mayank_Gupta)\
**Post date:** [February 13, 2025, 10:49am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/3 "2025-02-13T10:49:14Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/2X/5/5ded94305f09f502c5076a1f3da5caded0cbba29.png)

This might help you.  
Like it if its of any help 😇

---

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 13, 2025, 6:14pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/4 "2025-02-13T18:14:18Z")

</div>

thanks you Mayank, I am not using Local LLMs.

---

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 13, 2025, 6:17pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/5 "2025-02-13T18:17:26Z")

</div>

CrewAI docs mentioned that most of the LLMs works. in reality it is not true, I have written wrapper class and tried to create handler and nothing worked out. not sure they have tested it or not. Still I am struggling to fix error:Provider List: [Providers | liteLLM](https://docs.litellm.ai/docs/providers)

ERROR:root:Failed to get supported params: argument of type ‘NoneType’ is not iterable  
Error in CrewAI analysis: ‘str’ object has no attribute ‘get’  
Providing my code. @crewai team, please help in fixing this issue and thanks in advance.  
code:  
import os  
import yaml  
from crewai import Crew, Process, Agent, Task  
from tools.pdf\_report\_tool import generate\_stock\_report  
from tools.market\_data\_tool import fetch\_market\_data  
from tools.fundamental\_tool import analyze\_fundamentals  
from tools.technical\_tool import analyze\_technical\_strength  
from tools.risk\_tool import assess\_risk  
from tools.trade\_plan\_tool import generate\_trade\_plan  
#from langchain\_ollama import OllamaLLM # ✅ Updated Ollama import  
#from langchain\_community.llms import Ollama  
from langchain\_ollama import OllamaLLM  
#from langchain.llms import LLM  
#from langchain\_community.llms import LLM  
from langchain\_mistralai import ChatMistralAI  
api\_key = “111”  
mistral\_model = “codestral-latest”  
llm\_mstral = ChatMistralAI(model=mistral\_model, temperature=0, api\_key=api\_key)  
MISTRAL\_API\_KEY=“111”  
#from litellm import LLM  
from litellm import completion  
from typing import List  
import requests  
import json

from langchain.schema import SystemMessage, HumanMessage

# # ------------------- Utility Function -------------------

# # Create a function wrapper for litellm completion

# def litellm\_handler(messages: List[str | SystemMessage | HumanMessage], \*\*kwargs):

# try:

# formatted\_messages =

# for message in messages:

# if isinstance(message, SystemMessage):

# formatted\_messages.append({“role”: “system”, “content”: message.content})

# elif isinstance(message, HumanMessage):

# formatted\_messages.append({“role”: “user”, “content”: message.content})

# elif isinstance(message, str):

# formatted\_messages.append({“role”: “user”, “content”: message})

# response = completion(

# model=“mistral/mistral-large-latest”,

# messages=formatted\_messages,

# temperature=0.7,

# api\_key=MISTRAL\_API\_KEY

# )

# return response.choices[0].message.content

# except Exception as e:

# print(f"LiteLLM Error: {str(e)}")

# return “Error processing request”

class MistralWrapper:  
def **init** (self, api\_key):  
self.api\_key = api\_key  
self.url = “[https://api.mistral.ai/v1/chat/completions](https://api.mistral.ai/v1/chat/completions)”  
self.headers = {  
“Content-Type”: “application/json”,  
“Authorization”: f"Bearer {api\_key}"  
}

```
def __call__ (self, prompt, **kwargs):
    try:
        if isinstance(prompt, list):
            messages = prompt
        else:
            messages = [{"role": "user", "content": prompt}]

        data = {
            "model": "mistral-large-latest",
            "messages": messages,
            "temperature": 0.7
        }

        response = requests.post(
            self.url,
            headers=self.headers,
            data=json.dumps(data)
        )
        
        if response.status_code == 200:
            return response.json()['choices'][0]['message']['content']
        else:
            return f"Error: {response.status_code}"
            
    except Exception as e:
        print(f"Error: {str(e)}")
        return "Error processing request"

```

def get\_mistral\_response(\*\*kwargs):  
response = completion(  
model=“mistral/mistral-large-latest”,  
messages=[{“role”: “user”, “content”: kwargs.get(“prompt”, “”)}],  
temperature=0.7,  
api\_key=MISTRAL\_API\_KEY  
)  
return response.choices[0].message.content  
def load\_yaml(filename):  
“”“Loads agents or tasks from a YAML file.”“”  
base\_path = os.path.dirname( **file** )  
full\_path = os.path.join(base\_path, “config”, filename)  
with open(full\_path, “r”) as file:  
return yaml.safe\_load(file)

# ------------------- Crew Creation -------------------

def create\_stock\_advisor\_crew(stock):  
“”“Create a Crew for stock analysis using Ollama LLM.”“”  
# Initialize Mistral wrapper  
mistral = MistralWrapper(api\_key=MISTRAL\_API\_KEY)  
# Initialize Ollama LLM  
#ollama\_llm = OllamaLLM(model=“llama2”) # ✅ Updated Ollama usage

# mistral\_llm = LLM(

# model=“mistral/mistral-large-latest”,

# temperature=0.7,

# api\_key=MISTRAL\_API\_KEY

# )

```
# Tool mapping
tool_mapping = {
    "fetch_market_data": fetch_market_data,
    "analyze_fundamentals": analyze_fundamentals,
    "analyze_technical_strength": analyze_technical_strength,
    "assess_risk": assess_risk,
    "generate_trade_plan": generate_trade_plan
}

# Load configurations
agents_config = load_yaml("agents.yaml")
tasks_config = load_yaml("tasks.yaml")

# Create agents
# In your create_stock_advisor_crew function, modify the agent creation:

```

# agent = Agent(

# role=value[“role”],

# goal=value[“goal”],

# backstory=value[“backstory”],

# tools=tools,

# llm=litellm\_handler,

# allow\_delegation=True, # Add this line

# verbose=True

# )

```
agents = {}
for key, value in agents_config.items():
    tools = [tool_mapping[tool] for tool in value.get("tools", [])]
    agent = Agent(
        role=value["role"],
        goal=value["goal"],
        backstory=value["backstory"],
        tools=tools,
        llm=mistral,#litellm_handler,#get_mistral_response,#mistral_llm,#llm_mstral,#mistral_llm,#ollama_llm, # ✅ Pass Ollama LLM here
        #allow_delegation=True, # Add this line
        verbose=True
    )
    agents[value["role"]] = agent

# Create tasks
tasks = []
for key, value in tasks_config.items():
    if value["agent"] in agents:
        task = Task(
            description=f"{value['description']} Stock: {stock}",
            expected_output=value['expected_output'],
            agent=agents[value["agent"]],
            context=[stock, key] # ✅ Pass context as a list
        )
        tasks.append(task)

# Create crew
crew = Crew(
    agents=list(agents.values()),
    tasks=tasks,
    process=Process.sequential,
    verbose=True
)

return crew

```

# ------------------- Stock Analysis Function -------------------

def analyze\_stock(stock):  
“”“Analyze a single stock and return results.”“”  
print(f"🔍 Analyzing {stock}…")

```
# Run individual tool analyses
market_data = fetch_market_data._run(stock, "stock")
fundamentals = analyze_fundamentals._run(stock)
technicals = analyze_technical_strength._run(stock)
risk_analysis = assess_risk._run(stock)
trade_plan = generate_trade_plan._run(stock)

# Combine individual analyses
stock_result = {
    "symbol": stock,
    "market_data": market_data,
    "fundamentals": fundamentals,
    "technicals": technicals,
    "risk_analysis": risk_analysis,
    "trade_plan": trade_plan
}

# Run CrewAI analysis
try:
    crew = create_stock_advisor_crew(stock)
    crew_result = crew.kickoff()
    stock_result["crew_analysis"] = crew_result
    print(f"\n📊 CrewAI Final Report for {stock}:\n{crew_result}")
except Exception as e:
    print(f"Error in CrewAI analysis: {str(e)}")
    stock_result["crew_analysis"] = f"Error: {str(e)}"

return stock_result

```

# ------------------- Main Function -------------------

def main():  
“”“Main function to analyze stocks.”“”  
stock = “HDFCBANK.NS”  
results =

```
# Analyze single stock
result = analyze_stock(stock)
results.append(result)

```

if **name** == “ **main** ”:  
main()

---

<div class="post-metadata">

**Author:** ![tonykipkemboi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/tonykipkemboi/32/4070_2.png) [@tonykipkemboi](https://community.crewai.com/u/tonykipkemboi)\
**Post date:** [February 13, 2025, 8:09pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/6 "2025-02-13T20:09:36Z")

</div>

what models are you using? it seems it is through Ollama but you mention that it is not local?

---

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 14, 2025, 5:07am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/7 "2025-02-14T05:07:37Z")

</div>

I tried all options. please share any code snippet where I can use free LLM with crewai frame work. Local Ollama tried, due to local space issue … not able to test it.  
agent = Agent(  
role=value[“role”],  
goal=value[“goal”],  
backstory=value[“backstory”],  
tools=tools,  
llm=mistral,#litellm\_handler,#get\_mistral\_response,#mistral\_llm,#llm\_mstral,#mistral\_llm,#ollama\_llm, # ✅ Pass Ollama LLM here  
#allow\_delegation=True, # Add this line  
verbose=True  
)

---

<div class="post-metadata">

**Author:** ![tonykipkemboi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/tonykipkemboi/32/4070_2.png) [@tonykipkemboi](https://community.crewai.com/u/tonykipkemboi)\
**Post date:** [February 18, 2025, 3:53pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/8 "2025-02-18T15:53:19Z")

</div>

I think you’re going about this the wrong way. You can’t use free locally without enough memory to do so. You will have to used a hosted LLM if you don’t have anough memory. Also, please share a repo with your full code so we can better troubleshoot it for you.

---

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 20, 2025, 3:32pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/9 "2025-02-20T15:32:17Z")

</div>

Thank You Tony.  
I am sharing the code, initially I was using main.py and crew.py separately. All the code merged into main.py to test it. You can help me creating separate files.  
I am looking your help in working this code for both ollama\_llm. How can I share the code?  
Let me know your mail id, so that I can attach the code.  
Thanks in advance Tony.

---

<div class="post-metadata">

**Author:** ![Nanda\_Doneparthy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/nanda_doneparthy/32/1925_2.png) [@Nanda\_Doneparthy](https://community.crewai.com/u/Nanda_Doneparthy)\
**Post date:** [February 21, 2025, 5:19pm UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/10 "2025-02-21T17:19:42Z")

</div>

@crewai staff Tony.  
Please provide me the mail id where I can share the code.  
Thanks in advance for your support.

---

<div class="post-metadata">

**Author:** ![tonykipkemboi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/tonykipkemboi/32/4070_2.png) [@tonykipkemboi](https://community.crewai.com/u/tonykipkemboi)\
**Post date:** [March 25, 2025, 5:30am UTC](https://community.crewai.com/t/what-are-the-llms-that-crewai-supports-getting-error-llm-value-is-an-unknown-object/3796/11 "2025-03-25T05:30:27Z")

</div>

You can upload to GitHub and add me as a collaborator for that repo. Here’s my GitHub username: @tonykipkemboi
