Skip to content

Document how to reduce the amount of dependencies needed #1580

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

Closed
fire015 opened this issue Dec 30, 2024 · 8 comments
Closed

Document how to reduce the amount of dependencies needed #1580

fire015 opened this issue Dec 30, 2024 · 8 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fire015
Copy link

fire015 commented Dec 30, 2024

Describe the bug
Installing llamaindex adds almost 900MB of packages to node modules! Ironically the workflow package is not installed and has to be done separately. Is there a way to reduce the total sizes of dependencies especially if just using OpenAI? I don't need Gemini etc but it seems to install every LLM provider by default.

To Reproduce

npm i llamaindex
  • OS: macOS
  • JS Runtime / Framework / Bundler (select all applicable)
  • Node.js
@fire015 fire015 added the bug Something isn't working label Dec 30, 2024
@marcusschiesser marcusschiesser changed the title Reduce the amount of dependencies needed to be installed Document how to Reduce the amount of dependencies needed to be installed Jan 3, 2025
@marcusschiesser
Copy link
Collaborator

You can reduce this by just installing the core package https://www.npmjs.com/package/@llamaindex/core and the LLM provider that you need (e.g. Openai: https://www.npmjs.com/package/@llamaindex/openai)

How about adding a "Reduce Dependencies" section to the docs: https://ts.llamaindex.ai/docs/llamaindex ?

"Guide" looks like a good place:
https://github.com/run-llama/LlamaIndexTS/blob/main/apps/next/src/content/docs/llamaindex/guide/meta.json

Anyone wants to help with that?

@marcusschiesser marcusschiesser added good first issue Good for newcomers help wanted Extra attention is needed and removed bug Something isn't working labels Jan 3, 2025
@marcusschiesser marcusschiesser changed the title Document how to Reduce the amount of dependencies needed to be installed Document how to reduce the amount of dependencies needed Jan 3, 2025
@fire015
Copy link
Author

fire015 commented Jan 10, 2025

Unfortunately installing core alone is not enough to get this working. For example you can't access to vector stores they seem to be part of the main package.

@marcusschiesser
Copy link
Collaborator

Yes, if you need vector stores, then please wait for #1587 - coming soon!

@AndreMaz
Copy link
Contributor

AndreMaz commented Jan 14, 2025

@marcusschiesser any ETA for this? I'm getting the following error at Vercel:

Image

after bumping llamaindex from 0.6.9 to 0.8.31.

I think that importing the @llamaindex/core , @llamaindex/openai and @llamaindex/vector-store could reduce the bundle size of my (serverless) function

Link to Vercel docs: https://vercel.com/docs/functions/runtimes#bundle-size-limits
Related issue: #1572

@AndreMaz
Copy link
Contributor

AndreMaz commented Jan 15, 2025

Turns out that, in my case, the culprit is the onnxruntime-node that takes 727.79MB of space

Image

@marcusschiesser
Copy link
Collaborator

@AndreMaz which vector store are you using? We're already extracted postgres and azure. Using those with core should result in a small package size.

onnx is used by huggingface and chromadb. We will optimize bundle sizes and import handling in the 0.9 release

@AndreMaz
Copy link
Contributor

Hey @marcusschiesser thank you for replying and thank you guys for your work!

I'm using PGVectorStore. Can you also take a look at #1598 ? At the moment I'm still relying on llamaindex to import VectorStoreIndex and serviceContextFromDefaults

@marcusschiesser
Copy link
Collaborator

@AndreMaz just released the 0.9 package, for migration check: https://ts.llamaindex.ai/docs/llamaindex/migration/0.8-to-0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants