Feature request
I would like it if BentoML also supports using pylock.toml to specify Python dependencies.
Motivation
The current options to specify Python dependencies have their limitations because it is impossible to easily configure per-dependency index urls.
- Using
bentoml.images.Image().python_packages()
- will duplicate dependency specification (e.g. for the project in pyproject.toml, and for the bento the service).
- does not support
--extra-index-url. In other words, GPU acceleration with torch does not work.
- Using
bentoml.images.Image().requirements_file()
- only supports
--extra-index-url when specified in the file, but uv explicitly does not export these becuase requirements.txt is not powerful enough.
- BentoML can add the
--extra-index-url to the requirements.txt file on the fly, but this will apply to all packages.
- BentoML can add
pip_args to specify --index-strategy unsafe-best-match but these are added to the uv pip install. Maybe the documentation is outdated?
- Using
bentoml.images.Image().run() or run_script().
- There is no way to copy artifacts (e.g. a requirements.txt, or pylock.toml) to the Docker before executing the run.
Hence, any situation where some package require conflicting --extra-index-url the current setup is not sufficient. I downgraded to bentoml<1.3 to fix this.
I think supporting pylock.toml will fix this, because it explicitly defines all the index urls.
Other
I'm creating this as a feature request, because I don't think there is a good solution based on requirements.txt. That will only work when specifying the index urls per package line, but uv is not going to do that.
Feature request
I would like it if BentoML also supports using pylock.toml to specify Python dependencies.
Motivation
The current options to specify Python dependencies have their limitations because it is impossible to easily configure per-dependency index urls.
bentoml.images.Image().python_packages()--extra-index-url. In other words, GPU acceleration with torch does not work.bentoml.images.Image().requirements_file()--extra-index-urlwhen specified in the file, but uv explicitly does not export these becuase requirements.txt is not powerful enough.--extra-index-urlto the requirements.txt file on the fly, but this will apply to all packages.pip_argsto specify--index-strategy unsafe-best-matchbut these are added to theuv pip install. Maybe the documentation is outdated?bentoml.images.Image().run()orrun_script().Hence, any situation where some package require conflicting
--extra-index-urlthe current setup is not sufficient. I downgraded tobentoml<1.3to fix this.I think supporting
pylock.tomlwill fix this, because it explicitly defines all the index urls.Other
I'm creating this as a feature request, because I don't think there is a good solution based on requirements.txt. That will only work when specifying the index urls per package line, but uv is not going to do that.