Skip to main content

BentoML: Build Production-Grade AI Applications

Project description

bentoml

BentoML: The Unified AI Application Framework

pypi_status CI Twitter Community

BentoML is a framework for building reliable, scalable, and cost-efficient AI applications. It comes with everything you need for model serving, application packaging, and production deployment.

👉 Join our Slack community!

Highlights

🍱 Bento is the container for AI apps

  • Open standard and SDK for AI apps, pack your code, inference pipelines, model files, dependencies, and runtime configurations in a Bento.
  • Auto-generate API servers, supporting REST API, gRPC, and long-running inference jobs.
  • Auto-generate Docker container images.

🏄 Freedom to build with any AI models

🍭 Simplify modern AI application architecture

🚀 Deploy Anywhere

  • One-click deployment to ☁️ BentoCloud, the Serverless platform made for hosting and operating AI apps.
  • Scalable BentoML deployment with 🦄️ Yatai on Kubernetes.
  • Deploy auto-generated container images anywhere docker runs.

Documentation

🛠️ What you can build with BentoML

Getting Started

Save or import models in BentoML local model store:

import bentoml
import transformers

pipe = transformers.pipeline("text-classification")

bentoml.transformers.save_model(
  "text-classification-pipe",
  pipe,
  signatures={
    "__call__": {"batchable": True}  # Enable dynamic batching for model
  }
)

View all models saved locally:

$ bentoml models list

Tag                                     Module                Size        Creation Time
text-classification-pipe:kn6mr3aubcuf…  bentoml.transformers  256.35 MiB  2023-05-17 14:36:25

Define how your model runs in a service.py file:

import bentoml

model_runner = bentoml.models.get("text-classification-pipe").to_runner()

svc = bentoml.Service("text-classification-service", runners=[model_runner])

@svc.api(input=bentoml.io.Text(), output=bentoml.io.JSON())
async def classify(text: str) -> str:
    results = await model_runner.async_run([text])
    return results[0]

Now, run the API service locally:

bentoml serve service.py:svc

Sent a prediction request:

$ curl -X POST -H "Content-Type: text/plain" --data "BentoML is awesome" http://localhost:3000/classify

{"label":"POSITIVE","score":0.9129443168640137}%

Define how a Bento can be built for deployment, with bentofile.yaml:

service: 'service.py:svc'
name: text-classification-svc
include:
  - 'service.py'
python:
  packages:
  - torch>=2.0
  - transformers

Build a Bento and generate a docker image:

$ bentoml build
...
Successfully built Bento(tag="text-classification-svc:mc322vaubkuapuqj").
$ bentoml containerize text-classification-svc
Building OCI-compliant image for text-classification-svc:mc322vaubkuapuqj with docker
...
Successfully built Bento container for "text-classification-svc" with tag(s) "text-classification-svc:mc322vaubkuapuqj"
$ docker run -p 3000:3000 text-classification-svc:mc322vaubkuapuqj

For a more detailed user guide, check out the BentoML Tutorial.


Community

BentoML supports billions of model runs per day and is used by thousands of organizations around the globe.

Join our Community Slack 💬, where thousands of AI application developers contribute to the project and help each other.

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 the #bentoml-contributors channel here.

Thanks to all of our amazing contributors!


Usage Reporting

BentoML collects usage data that helps our team to improve the product. Only BentoML's internal API calls are being reported. We strip out as much potentially sensitive information as possible, and we will never collect user code, model data, model names, or stack traces. Here's the code for usage tracking. You can opt-out of usage tracking by the --do-not-track CLI option:

bentoml [command] --do-not-track

Or by setting environment variable BENTOML_DO_NOT_TRACK=True:

export BENTOML_DO_NOT_TRACK=True

License

Apache License 2.0

FOSSA Status

Citation

If you use BentoML in your research, please cite using the following [citation](./CITATION.cff:

@software{Yang_BentoML_The_framework,
author = {Yang, Chaoyu and Sheng, Sean and Pham, Aaron and  Zhao, Shenyang and Lee, Sauyon and Jiang, Bo and Dong, Fog and Guan, Xipeng and Ming, Frost},
license = {Apache-2.0},
title = {{BentoML: The framework for building reliable, scalable and cost-efficient AI application}},
url = {https://github.com/bentoml/bentoml}
}

Project details


Release history Release notifications | RSS feed

This version

1.1.8

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bentoml-1.1.8.tar.gz (852.7 kB view details)

Uploaded Source

Built Distribution

bentoml-1.1.8-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file bentoml-1.1.8.tar.gz.

File metadata

  • Download URL: bentoml-1.1.8.tar.gz
  • Upload date:
  • Size: 852.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for bentoml-1.1.8.tar.gz
Algorithm Hash digest
SHA256 45120822241ecc1476f6b5e1526bba955e693570dacc449498e2f031dd1e487f
MD5 2ca176dee49d7ef5866c129880a7df73
BLAKE2b-256 8042c00688314b9694f3a1cca74c9cb22398c8a515dc77a3148710902efb0a70

See more details on using hashes here.

File details

Details for the file bentoml-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: bentoml-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for bentoml-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 01f983a215c4d71eabe0d333889439d5eb8f57aa139c768bcd29e46d9a4d85c6
MD5 e00194a6c7d651be180a62f6803fe1ae
BLAKE2b-256 4291541c3aff93a81223c0accd9d86f32e13d5b4d29c65168fd5553192cb7fac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page