Hope this helps:
from crewai import LLM
import os
os.environ['HUGGINGFACE_API_KEY'] = '<your-hf-key>'
llm = LLM(
model='huggingface/mistralai/Mistral-7B-Instruct-v0.3',
api_base=('https://api-inference.huggingface.co/models/'
'mistralai/Mistral-7B-Instruct-v0.3'),
temperature=0.7
)
response = llm.call("Say 'hi Aadishree' in 300 chars. "
"She's a member of the CrewAI community!")
print(f'\n[ 🤖 ] {response.strip()}\n')