Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

BentoML

> 数据库
Open source

The easiest way to serve AI apps and models - Build Model Inference APIs, Job queues, LLM apps, Multi-model pipelines, and more!

8.7K stars0 likes1 views
WebsiteGitHub

About

The easiest way to serve AI apps and models - Build Model Inference APIs, Job queues, LLM apps, Multi-model pipelines, and more!

Unified Model Serving Framework

Build model inference APIs and multi-model serving systems with any open-source or custom AI models. Join our forum!

What is BentoML?

BentoML is a Python library for building online serving systems optimized for AI apps and model inference.

  • ** Easily build APIs for Any AI/ML Model.** Turn any model inference script into a REST API server with just a few lines of code and standard Python type hints.
  • ** Docker Containers made simple.** No more dependency hell! Manage your environments, dependencies and model versions with a simple config file. BentoML automatically generates Docker images, ensures reproducibility, and simplifies how you deploy to different environments.
  • ** Maximize CPU/GPU utilization.** Build high performance inference APIs leveraging built-in serving optimization features like dynamic batching, model parallelism, multi-stage pipeline and multi-model inference-graph orchestration.
  • ‍ Fully customizable. Easily implement your own APIs or task queues, with custom business logic, model inference and multi-model composition. Supports any ML framework, modality, and inference runtime.
  • ** Ready for Production.** Develop, run and debug locally. Seamlessly deploy to production with Docker containers or BentoCloud.

Getting started

Install BentoML:

bash
# Requires Python≥3.9
pip install -U bentoml

Define APIs in a service.py file.

python
import bentoml

@bentoml.service(
    image=bentoml.images.Image(python_version="3.11").python_packages("torch", "transformers"),
)
class Summarization:
    def __init__(self) -> None:
        import torch
        from transformers import pipeline

        device = "cuda" if torch.cuda.is_available() else "cpu"
        self.pipeline = pipeline('summarization', device=device)

    @bentoml.api(batchable=True)
    def summarize(self, texts: list[str]) -> list[str]:
        results = self.pipeline(texts)
        return [item['summary_text'] for item in results]

Run locally

Install PyTorch and Transformers packages to your Python virtual environment.

bash
pip install torch transformers  # additional dependencies for local run

Run the service code locally (serving at http://localhost:3000 by default):

bash
bentoml serve

You should expect to see the following output.

[INFO] [cli] Starting production HTTP BentoServer from "service:Summarization" listening on http://localhost:3000 (Press CTRL+C to quit)
[INFO] [entry_service:Summarization:1] Service Summarization initialized

Now you can run inference from your browser at http://localhost:3000 or with a Python script:

python
import bentoml

with bentoml.SyncHTTPClient('http://localhost:3000') as client:
    summarized_text: str = client.summarize([bentoml.__doc__])[0]
    print(f"Result: {summarized_text}")

Deploy using Docker

Run bentoml build to package necessary code, models, dependency configs into a Bento - the standardized deployable artifact in BentoML:

bash
bentoml build

Ensure Docker is running. Generate a Docker container image for deployment:

bash
bentoml containerize summarization:latest

Run the generated image:

bash
docker run --rm -p 3000:3000 summarization:latest

☁️ Deploy on BentoCloud

BentoCloud provides compute infrastructure for rapid and reliable GenAI adoption. It helps speed up your BentoML development process leveraging cloud compute resources, and simplify how you deploy, scale and operate BentoML in production.

Sign up for BentoCloud for personal access; for enterprise use cases, contact our team.

bash
# After signup, run the following command to create an API token:
bentoml cloud login

# Deploy from current directory:
bentoml deploy

For detailed explanations, read the Hello World example.

Examples

  • LLMs: Llama 3.2, Mistral, DeepSeek Distil, and more.
  • Image Generation: Stable Diffusion 3 Medium, Stable Video Diffusion, Stable Diffusion XL Turbo, ControlNet, and LCM LoRAs.
  • Embeddings: SentenceTransformers and ColPali
  • Audio: ChatTTS, XTTS, WhisperX, Bark
  • Computer Vision: YOLO and ResNet
  • Advanced examples: Function calling, LangGraph, CrewAI

Check out the full list for more sample code and usage.

Advanced topics

  • Model composition
  • Workers and model parallelization
  • Adaptive batching
  • GPU inference
  • Distributed serving systems
  • Concurrency and autoscaling
  • Model loading and Model Store
  • Observability
  • BentoCloud deployment

See Documentation for more tutorials and guides.

Community

Get involved and join our Community Forum , where thousands of AI/ML engineers help each other, contribute to the project, and talk about building AI products.

To report a bug or suggest a feature request, use GitHub Issues.

Contributing

There are many ways to contribute to the project:

  • Report bugs and "Thumbs up" on issues that are relevant to you.
  • Investigate issues and review other developers' pull requests.
  • Contribute code or documentation to the project by submitting a GitHub pull request.
  • Check out the Contributing Guide and Development Guide to learn more.
  • Share your feedback and discuss roadmap plans in our forum.

Thanks to all of our amazing contributors!

Usage tracking and feedback

The BentoML framework collects anonymous usage data that helps our community improve the product. Only BentoML's internal API calls are being reported. This excludes any sensitive information, such as user code, model data, model names, or stack traces. Here's the code used for usage tracking. You can opt-out of usage tracking by the --do-not-track CLI option:

bash
bentoml [command] --do-not-track

Or by setting the environment variable:

bash
export BENTOML_DO_NOT_TRACK=True

License

Apache License 2.0

Issues· 223 open

View all issuesOpen on GitHub
  • #5726

    `bentoml.save_config` always crashes with `yaml.representer.RepresenterError`

    Updated Sep 25, 2026
  • #5625

    BUG: IndexError in IODescriptor.from_output() with bare (unparameterized) iterator return annotations

    Updated Sep 13, 2026
  • #5566

    bug: `bentoml containerize` fails with `ValueError: Accessing file outside of current working directory` when using `dockerfile_template` (v1.4.36)

    bugUpdated Sep 8, 2026
  • #5718

    [HTTPXodus] Consider migrating from `httpx` to `httpx2` (the actively maintained fork)

    Updated Sep 4, 2026
  • #4718

    minor bug: Swagger docs.json not correctly specified for list[PydanticModel] Output

    bugUpdated Aug 31, 2026
  • #5607

    bug: [serve] `serve-grpc` failed: <class '_bentoml_sdk.service.factory.Service'> type doesn't support gRPC serving

    bugUpdated Aug 26, 2026
  • #5675

    Remote clients drop preceding URL values for multipart list file inputs

    Updated Aug 22, 2026
  • #5656

    bug: Dockerfile injection via unsanitized docker.env dict values

    Updated Aug 22, 2026
  • #5644

    SSRF blocklist bypass via CGNAT range (100.64.0.0/10)

    bugUpdated Aug 22, 2026
  • #4863

    bug: Async Return Latency Issues with BentoML Image IO API

    bugUpdated Aug 15, 2026

> Tags

Pythonai-inferencedeep-learninggenerative-aiinference-platform

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库