crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Vllm or Huggingface for local LLMs for CrewAI

Open rajeshkochi444 opened this issue 1 year ago • 1 comments

Would it be possible for us to use Huggingface or vLLM for loading models locally. Ollama implantation bit more challenging

rajeshkochi444 avatar Mar 27 '24 15:03 rajeshkochi444

I have the same request features.

tridungduong-unsw avatar May 17 '24 23:05 tridungduong-unsw

I have the same request features.

FBR65 avatar Jun 18 '24 11:06 FBR65

I have the same request features.

Atakey avatar Jul 12 '24 02:07 Atakey

Hi,

my solution on this request:

from langchain_openai import ChatOpenAI as LOAI

os.environ["OPENAI_API_KEY"] = "NA"

llm_model = LOAI(base_url="http://your_endpoint/v1", model_name = 'your_model')

your_agent = Agent(
    role="Your Role",
    goal="Your goal",
    backstory="Your backstory",
    async_execution=False,
    allow_delegation = False,
    llm=llm_model
)

or setting the environment varaibles:

os.environ["OPENAI_API_KEY"] = "NA"
os.environ["OPENAI_API_BASE"] = "Your Endpoint"
os.environ["OPENAI_MODEL_NAME"] = "Your Model"

I'm using the first solution because of the ability to use several models in my crew. The second is for those who only need one model.

FBR65 avatar Jul 12 '24 04:07 FBR65

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 Aug 19 '24 12:08 github-actions[bot]

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

github-actions[bot] avatar Aug 25 '24 12:08 github-actions[bot]

This solution is giving me this

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

ERROR:root:Failed to get supported params: argument of type 'NoneType' is not iterable

MohamedAliRashad avatar Dec 18 '24 12:12 MohamedAliRashad

same situation here. anyone has solved it?

Image

ruianlc avatar Feb 11 '25 03:02 ruianlc

You'll want to preface your model name with the provider.

I.e. for VLLM and llama3 it would be: model="hosted_vllm/meta-llama/Llama-3.3-70B-Instruct"

kellyaa avatar Feb 20 '25 16:02 kellyaa

You'll want to preface your model name with the provider.

I.e. for VLLM and llama3 it would be: model="hosted_vllm/meta-llama/Llama-3.3-70B-Instruct"

I was working with vLLM hosted model and adding prefix "hosted_vllm/" worked for me. Thanks @kellyaa

Pranjal-Tripathi-01 avatar Jul 07 '25 18:07 Pranjal-Tripathi-01