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

Possible to reduce node package size? #26

Closed
dmb0058 opened this issue Jul 11, 2023 · 6 comments · Fixed by #29
Closed

Possible to reduce node package size? #26

dmb0058 opened this issue Jul 11, 2023 · 6 comments · Fixed by #29
Assignees
Labels
enhancement New feature or request

Comments

@dmb0058
Copy link

dmb0058 commented Jul 11, 2023

Describe the bug
AWS Lambda functions are restricted to 250Mb including layers. Packaging the aws-sdk, faiss-node, fs, langchain, openai and adm-zip blows the limit.

I've pulled out only the aws sub-packages I need (s3 and secrets-manager) and the fs and adm-zip packages are tiny, but faiss-node is pretty big. I see it has Readme files and stuff, so I guess it's not 'minimal' - any chance of a slimmed down npm package?

Environment:

  • Operating system: AWS Lambda
  • Nodejs Version: v18.x
  • Package Version: latest

To Reproduce
Steps to reproduce the behavior:

  1. Zip the nodejs/node_modules hierarchy
  2. Attempt to create a Lambda layer
  3. Error is "Layer max. size is 250Mb" (paraphrased)

Expected behavior
The layer is correctly created.

@dmb0058 dmb0058 added the bug Something isn't working label Jul 11, 2023
@ewfian
Copy link
Owner

ewfian commented Jul 12, 2023

@dmb0058 Now use MKL on linux and openblas on musllinux.
We can consider replacing it with openblas for reducing size.

image

@dmb0058
Copy link
Author

dmb0058 commented Jul 12, 2023 via email

@ewfian ewfian self-assigned this Jul 21, 2023
@ewfian ewfian added enhancement New feature or request and removed bug Something isn't working labels Jul 21, 2023
@dmb0058
Copy link
Author

dmb0058 commented Aug 2, 2023

Just checking if the latest version is the one on https://www.npmjs.com/package/faiss-node, or need to install from git?

@ewfian
Copy link
Owner

ewfian commented Aug 4, 2023

@dmb0058 I will publish a new version to npm soon.

You can check pre-release version here: https://github.com/ewfian/faiss-node/releases/tag/v0.2.3-alpha.0
image

@ewfian
Copy link
Owner

ewfian commented Aug 7, 2023

@dmb0058 The new version v0.2.3 was released.

@dmb0058
Copy link
Author

dmb0058 commented Aug 7, 2023 via email

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

Successfully merging a pull request may close this issue.

2 participants