-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
models[Component] Issues related to model support[Component] Issues related to model support
Description
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Describe the bug
A clear and concise description of what the bug is.
some imports are very slow
from google.adk.models import LLMRegistry, BaseLlm
from google.adk.models.lite_llm import LiteLlm
takes a lot of time on first import here is a screenshot from profiling it.

To Reproduce
Please share a minimal code and data to reproduce your problem.
Steps to reproduce the behavior:
- pip install -U google-adk - I ran on
google-adk==1.15.1
- run the following code:
import time
start_time = time.time()
from google.adk.models import LLMRegistry, BaseLlm
from google.adk.models.lite_llm import LiteLlm
end_time = time.time()
print(f"Time taken: {end_time - start_time} seconds")
WITH PROFILING
import cProfile
import pstats
from io import StringIO
pr = cProfile.Profile()
pr.enable()
import time
start_time = time.time()
from google.adk.models import LLMRegistry, BaseLlm
from google.adk.models.lite_llm import LiteLlm
end_time = time.time()
print(f"Time taken: {end_time - start_time} seconds")
pr.disable()
s = StringIO()
sortby = 'cumulative'
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
# Save the profiling stats to a file
ps.dump_stats('profile_stats.prof')
- this already reproduces the issue but to open the profile file I used snakeviz
snakeviz profile_stats.prof
Expected behavior
A clear and concise description of what you expected to happen.
The import shouldn't take so long
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
- OS: macos
- Python version(python -V): 3.11.5
- ADK version(pip show google-adk):1.15.1
Model Information:
- Are you using LiteLLM: Yes but this happens with other imports like LLMRegistry
- Which model is being used - N/A
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
models[Component] Issues related to model support[Component] Issues related to model support