Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some dependencies optional #708

Open
notpushkin opened this issue Jun 23, 2024 · 1 comment
Open

Make some dependencies optional #708

notpushkin opened this issue Jun 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@notpushkin
Copy link

Hey, first of all thanks for your wonderful project!

I've noticed that the default setup of Aider is at 926 MB now. This is mostly due to dependencies. Here's top 15:

124M    pyarrow
107M    playwright
103M    scipy
90M     pandas
85M     tree_sitter_languages
74M     googleapiclient
33M     numpy
27M     streamlit
27M     numpy.libs
24M     litellm
23M     scipy.libs
16M     networkx
15M     pydeck
15M     google
13M     grpc

The way around that is to make some dependencies optional. One low-hanging fruit is Streamlit, which is 484 MB (incluing its own dependencies)! To do that, you could declare it as an extra:

setup(
    name="aider",
    ...,
    extras_require={
        "browser": ["streamlit", "pyarrow", "pandas", ...],
    },
)

And check if it's available in the runtime:

def launch_gui(args):
    from aider import gui
    try:
        from streamlit.web import cli
    except ModuleNotFoundError:
        print(
            "Aider was installed without web support. To add it, run:\n"
            "    pip install aider-chat[browser]"
        )
        sys.exit(1)

Please let me know if you would be interested in a PR!

@notpushkin
Copy link
Author

(Another option, of course, would be to replace Streamlit with something lighter, but I'm not sure if it's feasible at this point.)

@paul-gauthier paul-gauthier added the enhancement New feature or request label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants