Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

fix: relax openai version constraint to allow 2.x for litellm[proxy] compatibility

Summary

Fixes #4079 - CrewAI could not be installed alongside litellm[proxy]>=1.74.9 due to conflicting openai version requirements.

The openai dependency constraint was changed from ~=1.83.0 (which resolves to >=1.83.0,<1.84.0) to >=1.83.0,<3. This allows:

  • Backward compatibility with openai 1.83.x
  • Support for openai 2.x required by litellm[proxy]
  • Upper bound <3 to prevent future breaking changes

Added 5 tests to verify:

  • The version constraint allows openai 2.8.0
  • All OpenAI SDK imports used by crewAI's provider are valid
  • OpenAI clients can be instantiated
  • crewAI's OpenAICompletion provider loads and instantiates correctly

Review & Testing Checklist for Human

  • Verify the fix resolves the original issue: Try uv add 'litellm[proxy]>=1.74.9' followed by uv add 'crewai[tools]' in a fresh project to confirm no dependency conflict
  • Check instructor version in uv.lock: The old instructor 1.12.0 required openai<2.0.0. Verify the new lock resolves to an instructor version compatible with openai 2.x
  • Test actual LLM calls with openai 2.x: The new tests only verify imports/instantiation, not actual API calls. Consider running existing OpenAI provider tests to ensure no runtime regressions
  • Review uv.lock changes: The lock file was fully regenerated (not incrementally updated), which updated many unrelated packages. Verify this is acceptable or consider a more targeted update

Recommended test plan: Create a fresh virtualenv, install crewai with the new constraint alongside litellm[proxy], and run a simple crew with an OpenAI agent to verify end-to-end functionality.

Notes

  • Smoke test with openai 2.8.0 confirmed all imports from crewai.llms.providers.openai.completion work correctly
  • The <3 upper bound follows best practices for library dependencies to prevent silent breaks on future major versions

Link to Devin run: https://app.devin.ai/sessions/a408495cc237451389a7c33a747dcac9
Requested by: João (joao@crewai.com)

…compatibility

Fixes #4079

The openai version constraint was pinned to ~=1.83.0 (>=1.83.0,<1.84.0),
which prevented installation alongside litellm[proxy]>=1.74.9 that requires
openai>=2.8.0.

Changes:
- Updated openai constraint from ~=1.83.0 to >=1.83.0,<3
- Added tests to verify the constraint allows openai 2.8.0
- Added import smoke tests for OpenAI provider compatibility

The new constraint:
- Maintains backward compatibility with openai 1.83.x
- Allows openai 2.x for users who need litellm[proxy]
- Caps at <3 to prevent future breaking changes

Verified that all OpenAI SDK imports used by crewAI's OpenAI provider
work correctly with openai 2.8.0.

Co-Authored-By: João <joao@crewai.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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

Successfully merging this pull request may close these issues.

[BUG] CrewAI 1.7.0 dependency conflict with litellm[proxy] - incompatible openai version requirements

1 participant