Skip to content

feature: Support building Bento using uv.lock instead of requirements.txt #5376

@isuyyy

Description

@isuyyy

Feature request

When developing a service using uv, it's common to initialize the project with uv init and manage dependencies via uv add, which generates a uv.lock file to capture an exact snapshot of the environment.

It would be great if BentoML could support uv.lock as a first-class source for building environments, as an alternative to requirements.txt or inferring from pyproject.toml. If uv.lock is present and lock_packages: false is set in bentofile.yaml, BentoML could leverage the pre-resolved lock file to ensure reproducibility and avoid re-resolving dependencies unnecessarily.

Motivation

Currently, BentoML copies the [project].dependencies from pyproject.toml into bento_home/bentos/envs/python/requirements.txt and resolves them again, independently of the existing uv.lock. This can lead to discrepancies between the development environment and the Bento environment, reducing reproducibility.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions