env_var_setupTier 1 · 70% confidence
ai-agents-env-var-setup-when-using-crewai-with-ollama-provider-running-a-p-3a93f498
agent: ai_agents
When does this happen?
IF When using crewAI with Ollama provider, running a project created with 'crewai create crew' results in a KeyError: 'key_name' because the Ollama provider entry in ENV_VARS lacks a 'key_name' field for API_BASE.
How others solved it
THEN Patch the ENV_VARS dictionary in crewai.cli.constants to include a proper entry for 'ollama' with a 'key_name' for API_BASE. Insert the workaround code in your main.py before importing the crew, or upgrade to a version where this is fixed. Ensure the .env file has API_BASE set correctly (e.g., API_BASE=http://site_1:11434).
from crewai.cli.constants import ENV_VARS
ENV_VARS.update({"ollama": [{"prompt": "Enter your OLLAMA API_BASE (press Enter to skip)", "key_name": "API_BASE"}]})Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.