https://promptfoo.dev/ logo
Issue with peer deps in prod
# ❓|questions
a
Out of the entire list of providers that promptfoo has to offer, I am only using customProvider as a javascript file. However because of these other providers , and their deps I am facing issues. @aws-sdk/client-bedrock-runtime": "^3.602.0", "@azure/identity": "^4.0.0", "@azure/openai-assistants": "^1.0.0-beta.5", "@fal-ai/serverless-client": "^0.14.3", "@ibm-generative-ai/node-sdk": "^2.0.6", "@playwright/browser-chromium": "^1.47.2", "@smithy/node-http-handler": "^3.1.1", "google-auth-library": "^9.7.0", "langfuse": "^3.7.0", } Are all these necessary to be installed, if I am not even using these in my testing? Is there something like a minimal install that can be done at my end?
m
@aashi92 this is definitely something we can improve. How are you using promptfoo? Are you talking about while developing, as a package you're importing, in docker? For most users they should not be installed by default, which is why we have setup instructions like https://www.promptfoo.dev/docs/providers/aws-bedrock/#setup
a
Using promptfoo as a node library. I do an npm install but because of company policies, cannot install external libs mentioned as peer deps.
m
ah try installing it with
--legacy-peer-deps
a
but that is for conflicting deps right
m
This is tricky. You could try --legacy-peer-deps or update your .npmrc file by adding legacy-peer-deps=true to ignore peer dependencies during installation. However, keep in mind this is more of a workaround and could result in missing packages if any peer dependencies are actually required. Alternatively, you could fork the Promptfoo repository, remove the unnecessary peer dependencies from package.json, and maintain a custom version without the ones you don't need. Promptfoo uses over 100 packages under the hood. Are the rest of them going to be ok for your comany?
a
--legacy-peer-deps fixxed the issue ! thanks!