Why Crewai always ask OPENAI_API_KEY

Why Crewai always ask KeyError: ‘OPENAI_API_KEY’. I have used ollama, but still getting open api key error.

Also tools return wrong info Total Workflow Count, Total Commit Count,

[2025-03-15 15:38:06][:white_check_mark: AGENT ‘GITHUB RESEARCHER’ COMPLETED TASK]: 2025-03-15 15:38:06.405346

[2025-03-15 15:38:06][:white_check_mark: TASK COMPLETED: SEARCH GITHUB REPOSITORIES FOR RELEVANT PROJECTS.]: 2025-03-15 15:38:06.405504

[2025-03-15 15:38:06][:white_check_mark: CREW ‘CREW’ COMPLETED, 3768B200-9594-4BD1-8155-001A6711BD36]: 2025-03-15 15:38:06.408029

GitHub Search Results: Relevant GitHub Repositories:


1. Generative AI Rag Milvus PDF Chatbot

Description

A chatbot that uses machine learning to generate conversational dialogue and engage with users in a more human-like manner.

Key Insights

  • Utilizes natural language processing (NLP) and machine learning algorithms for chatbot functionality.

  • Integrates with the Milvus search engine for efficient data storage and retrieval.

  • Designed to be highly customizable, allowing developers to tailor the chatbot’s conversational style and tone.

Programming Language Used

  • Python 3.8

Total Commit Count

  • 12,456

Total Workflow Count

  • 230

2. SimCard Shelf Space CNN

Description

A deep learning-based model for detecting anomalies in large datasets using convolutional neural networks (CNNs).

Key Insights

  • Develops a novel approach to anomaly detection that utilizes spatial attention mechanisms.

  • Employs transfer learning and fine-tuning techniques for improved performance on diverse dataset types.

  • Exhibits state-of-the-art accuracy on several benchmarking datasets.

Programming Language Used

  • Python 3.8

Total Commit Count

  • 9,124

Total Workflow Count

  • 141

CrewAI uses OpenAI models by default so there are builtin checks for an API key usage. If you are using Ollama just put a random string as your OPENAI_API_KEY in your .env file.

Make sure you are not using anything that needs embeddings and you haven’t defined an embedder because you will get OPENAI api key errors again.