Heuristic:Bentoml BentoML Warning Deprecated Server Module
| Knowledge Sources | |
|---|---|
| Domains | Deprecation, Migration |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Deprecation warning: the bentoml.server module and its Server/HTTPServer/GrpcServer classes are deprecated in favor of bentoml.serve().
Description
The bentoml.server module (src/bentoml/server.py) emits DeprecationWarning at four distinct points:
- Module import: Importing the module triggers a warning directing users to bentoml.serve().
- bento keyword argument: Passing the bento kwarg to the Server constructor triggers a warning to use positional arguments instead.
- Context manager usage: Using Server as a context manager triggers a warning to use Server.start instead.
- client() method: Calling Server.client() triggers a warning to use Server.get_client() instead.
This is part of BentoML's v2.x migration from the legacy server pattern to the new @bentoml.service() decorator-based architecture.
Usage
Be aware of this deprecation when encountering Server, HTTPServer, or GrpcServer in existing codebases. Migrate to bentoml.serve() for production use and bentoml.Server.start for programmatic server management.
The Insight (Rule of Thumb)
- Action: Replace from bentoml.server import HTTPServer with bentoml.serve().
- Value: All Server class functionality is now available through bentoml.serve() and the new SDK service pattern.
- Trade-off: Migration requires updating service definitions to use @bentoml.service() decorator.
Reasoning
BentoML v2.x introduced a new service paradigm using decorators (@bentoml.service(), @bentoml.api()) that replaces the legacy class-based Server approach. The old Server module is retained for backward compatibility but will be removed in a future major release.