Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollama local LLM instead OpenAI issue #1

Open
ciaotesla opened this issue Feb 27, 2024 · 3 comments
Open

Ollama local LLM instead OpenAI issue #1

ciaotesla opened this issue Feb 27, 2024 · 3 comments

Comments

@ciaotesla
Copy link

ciaotesla commented Feb 27, 2024

I am testing this crewai example.
I modified using ollama as LLS and did the necessary changes.
I am getting this error:

It seems we encountered an unexpected error while trying to use the tool. This was the error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: DUMMY_KEY. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Btw the code still runs but it repeats this error. So not sure what is happening. Will try to leave it running for a while.

I created a .env with a dummy OpenAI key, but this error persist.
Looks like CrewAI default to OpenAI and does not let me use my local LLM somehow.

I did other examples and look ok. Any idea?

@bhancockio
Copy link
Owner

Hey! I have a few questions for you to help me understand what's going wrong:

  • Do you have Ollama installed and running on your computer?
  • What is the name of the custom LLM you created?
  • When you run ollama list what do you see?
  • Could you please try NA instead of DUMMY_KEY
  • Could you please send me a quick snippet of what your .env file looks like. Please make sure you don't share any secret keys when you post and can you pulease share a snippet of the code where you create ChatOpenAI.

@ciaotesla
Copy link
Author

ciaotesla commented Feb 28, 2024

Ok, I added the following lines to the .env

OPENAI_API_BASE='http://localhost:11434/v1'
OPENAI_MODEL_NAME='openhermes'
OPENAI_API_KEY=NA

and seems to work.
Hopefully they remove this OpenAI default from the api.
thx
BTW great tutorials !

@ciaotesla
Copy link
Author

ciaotesla commented Mar 2, 2024

I did more testing and getting this error, did you encounter this? I running crewai 16.3

Traceback (most recent call last): File "/home/pi4/tweetbot/youtubeAI/main.py", line 71, in <module> results = crew.kickoff() ^^^^^^^^^^^^^^ File "/home/pi4/tweetbot/.venv/lib/python3.11/site-packages/crewai/crew.py", line 213, in kickoff result, manager_metrics = self._run_hierarchical_process() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi4/tweetbot/.venv/lib/python3.11/site-packages/crewai/crew.py", line 273, in _run_hierarchical_process task_output = task.execute( ^^^^^^^^^^^^^ File "/home/pi4/tweetbot/.venv/lib/python3.11/site-packages/crewai/task.py", line 120, in execute task.thread.join() ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'join'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants