Skip to content

Conversation

@lorenzejay
Copy link
Collaborator

@lorenzejay lorenzejay commented Nov 28, 2025

Note

Convert package and CLI to lazy-load heavy modules, minimizing import overhead and speeding up command startup.

  • Core (crewai/__init__.py):
    • Introduce lazy attribute access via __getattr__ to defer imports of Agent, Crew, Flow, LLM, etc.
    • Move Telemetry imports inside _track_install and _track_install_async to avoid eager import costs.
    • Keep public API via __all__ while reducing import-time work.
  • CLI (crewai/cli/cli.py):
    • Replace top-level imports with on-demand imports inside command handlers (e.g., create, train, replay, deploy, tool, flow, triggers, org, enterprise, config).
    • Update uv wrapper to import utils lazily and construct env at runtime.

Written by Cursor Bugbot for commit 8e175f7. This will update automatically on new commits. Configure here.

@lorenzejay lorenzejay marked this pull request as draft November 28, 2025 21:06
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.

2 participants