I'm going to shamelessly plug a
blog post I wrote recently, in which I discussed one possible solution for this exact problem (section "The bentoml-models repository"). In short, we isolate each bento into its own directory and put common code that is shared between multiple bentos into a separate repo/package that is pulled from our internal pypi server during the bentoml build step. Any modification to the external library would result in a new version of that package, which you would need to bump in whatever bento needs the new functionality. (I think it's safer anyway to explicitly control what changes go into each bento.)