crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

ERROR: LiteLLM call failed: litellm.APIError: APIError: GroqException - Connection error.

Open SujayC66 opened this issue 1 year ago • 1 comments

Description

i have created project using command

crewai create crew project folder name

After editing script as per my requirements when Im runniung the code using crewai run Im getting above error

I have use chatgroq from langchain_groq as well crewai class LLM. Any lead will be appreciated

Steps to Reproduce

No

Expected behavior

markdown report

Screenshots/Code snippets

@CrewBase class QuestionCrew(): """KPIs questions discovery crew"""

agents_config = 'config/questions/agents.yaml'
tasks_config = 'config/questions/tasks.yaml'

# @llm
# def llm_model(self):
# 	return ChatGroq(model="groq/llama-3.1-70b-versatile",
# 		 	   api_key=os.environ.get("GROQ_API_KEY"),
# 			   max_tokens=8000,
# 			   temperature=0,
# 			   )

# @llm
# def llm_model(self):
# 	return openai.OpenAI(
# 						base_url="https://api.groq.com/openai/v1",
# 						api_key=os.environ.get("GROQ_API_KEY"),
# 						)

@llm
def llm_model(self):
	return LLM(model="groq/llama-3.1-70b-versatile",
		 	   api_key="",
			   max_tokens=8000,
			   temperature=0
			   )


@agent
def business_analyst(self) -> Agent:
	return Agent(
		config=self.agents_config['business_analyst'],
		max_rpm=None,
		verbose=True,
		# llm= LLM(model="groq/llama-3.1-70b-versatile",
		#  	   api_key="",
		# 	   max_tokens=8000,
		# 	   temperature=0,
		# 	   )
	)

Operating System

Windows 11

Python Version

3.11

crewAI Version

0.80.0

crewAI Tools Version

0.80.0

Virtual Environment

Venv

Evidence

ERROR: LiteLLM call failed: litellm.APIError: APIError: GroqException - Connection error.

Possible Solution

NA

Additional context

I tried through multiple ways

SujayC66 avatar Nov 19 '24 05:11 SujayC66

is anyone looking into it, I'm also facing these issues a lot, lately.

were you able to find a fix for it? @SujayC66

amansingh9097 avatar Dec 14 '24 03:12 amansingh9097

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jan 13 '25 12:01 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jan 19 '25 12:01 github-actions[bot]

You can give this method a try:

Add the following code in main.py:

import litellm
litellm.ssl_verify = False
from dotenv import load_dotenv
load_dotenv()

Add the following code in the .env file:

NO_PROXY=*

8JasonStatham8 avatar Nov 14 '25 11:11 8JasonStatham8