You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The long import time is mostly due to DSPy’s design choice to expose many features at the top level. The init.py file imports numerous subpackages and re‑exports their symbols so users can simply write import dspy and immediately access predictors, retrievers, adapters, and evaluation utilities. These subpackages import heavy dependencies—such as litellm, regex, numpy, and pandas—as soon as they’re loaded. This eager loading ensures everything is ready to use but means that importing DSPy pulls in a large dependency graph, making startup slower than a lightweight library.
@17Reset Thanks for reporting the issue! We are aware of this, and in an effort of shrinking the memory/time consumption at importing time. In our incoming DSPy 3.0 release, we will ensure this runs much faster.
The text was updated successfully, but these errors were encountered: