Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bentoml/BentoML
The most flexible way to serve AI/ML models in production - Build Model Inference Service, LLM APIs, Inference Graph/Pipelines, Compound AI systems, Multi-Modal, RAG as a Service, and more!
https://github.com/bentoml/BentoML
deep-learning generative-ai inference-platform llm llm-inference llm-serving llmops machine-learning ml-engineering mlops model-inference-service model-serving multimodal python
Last synced: about 2 months ago
JSON representation
The most flexible way to serve AI/ML models in production - Build Model Inference Service, LLM APIs, Inference Graph/Pipelines, Compound AI systems, Multi-Modal, RAG as a Service, and more!
- Host: GitHub
- URL: https://github.com/bentoml/BentoML
- Owner: bentoml
- License: apache-2.0
- Created: 2019-04-02T01:39:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T08:38:37.000Z (7 months ago)
- Last Synced: 2024-05-13T03:01:03.781Z (7 months ago)
- Topics: deep-learning, generative-ai, inference-platform, llm, llm-inference, llm-serving, llmops, machine-learning, ml-engineering, mlops, model-inference-service, model-serving, multimodal, python
- Language: Python
- Homepage: https://bentoml.com
- Size: 79.5 MB
- Stars: 6,591
- Watchers: 73
- Forks: 742
- Open Issues: 229
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Governance: GOVERNANCE.md
Awesome Lists containing this project
- awesome-local-ai - BentoML - BentoML is a framework for building reliable, scalable, and cost-efficient AI applications. (Platforms / full solutions)
- awesome-llmops - BentoML - square) | (Serving / Frameworks/Servers for Serving)
- Awesome-AIML-Data-Ops - BentoML - BentoML is an open source framework for high performance ML model serving (Model Serving and Monitoring)
- awesome-list - BentoML - BentoML is compatible across machine learning frameworks and standardizes ML model packaging and management for your team. (Deep Learning Framework / Deployment & Distribution)
- Awesome-Earth-Artificial-Intelligence - BentoML - BentoML is an open-source framework for high-performance ML model serving. (Tools)
- awesome-production-machine-learning - BentoML - BentoML is an open source framework for high performance ML model serving. (Deployment and Serving)
- StarryDivineSky - bentoml/BentoML
- awesome-mlops - BentoML - Open-source platform for high-performance ML model serving. (Model Serving)
- awesome-google-colab - BentoML - A platform for serving and deploying machine learning models (Technologies)
README
## Unified Model Serving Framework
🍱 Build model inference APIs and multi-model serving systems with any open-source or custom AI models. 👉 [Join our Slack community!](https://l.bentoml.com/join-slack)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202-green.svg)](https://github.com/bentoml/BentoML?tab=Apache-2.0-1-ov-file)
[![Releases](https://img.shields.io/github/v/release/bentoml/bentoml.svg)](https://github.com/bentoml/bentoml/releases)
[![CI](https://github.com/bentoml/bentoml/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bentoml/BentoML/actions/workflows/ci.yml?query=branch%3Amain)
[![Twitter](https://badgen.net/badge/icon/@bentomlai/1DA1F2?icon=twitter&label=Follow)](https://twitter.com/bentomlai)
[![Community](https://badgen.net/badge/Join/Community/cyan?icon=slack)](https://l.bentoml.com/join-slack)## 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](https://www.bentoml.com/).## Getting started
Install BentoML:
```
# Requires Python≥3.9
pip install -U bentoml
```Define APIs in a `service.py` file.
```python
from __future__ import annotationsimport bentoml
@bentoml.service(
resources={"cpu": "4"}
)
class Summarization:
def __init__(self) -> None:
import torch
from transformers import pipelinedevice = "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 the service code locally (serving at http://localhost:3000 by default):
```bash
pip install torch transformers # additional dependencies for local runbentoml serve service.py:Summarization
```Now you can run inference from your browser at http://localhost:3000 or with a Python script:
```python
import bentomlwith bentoml.SyncHTTPClient('http://localhost:3000') as client:
summarized_text: str = client.summarize([bentoml.__doc__])[0]
print(f"Result: {summarized_text}")
```### Deploying your first Bento
To deploy your BentoML Service code, first create a `bentofile.yaml` file to define its dependencies and environments. Find the full list of bentofile options [here](https://docs.bentoml.com/en/latest/guides/build-options.html).
```yaml
service: 'service:Summarization' # Entry service import path
include:
- '*.py' # Include all .py files in current directory
python:
packages: # Python dependencies to include
- torch
- transformers
docker:
python_version: "3.11"
```Then, choose one of the following ways for deployment:
🐳 Docker Container
Run `bentoml build` to package necessary code, models, dependency configs into a Bento - the standardized deployable artifact in BentoML:
```bash
bentoml build
```Ensure [Docker](https://docs.docker.com/) 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
```☁️ BentoCloud
[BentoCloud](www.bentoml.com) 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](https://cloud.bentoml.com/signup) for personal access; for enterprise use cases, [contact our team](https://www.bentoml.com/contact).
```bash
# After signup, run the following command to create an API token:
bentoml cloud login# Deploy from current directory:
bentoml deploy .
```![bentocloud-ui](./docs/source/_static/img/bentocloud/get-started/bentocloud-playground-quickstart.png)
For detailed explanations, read [Quickstart](https://docs.bentoml.com/en/latest/get-started/quickstart.html).
## Use cases
- LLMs: [Llama 3.1](https://github.com/bentoml/BentoVLLM/tree/main/llama3.1-8b-instruct), [Mixtral](https://github.com/bentoml/BentoVLLM/tree/main/mixtral-8x7b-instruct), [Solar](https://github.com/bentoml/BentoVLLM/tree/main/solar-10.7b-instruct), [Mistral](https://github.com/bentoml/BentoVLLM/tree/main/mistral-7b-instruct), and [more](https://github.com/bentoml/BentoVLLM)
- Image Generation: [Stable Diffusion 3 Medium](https://github.com/bentoml/BentoDiffusion/tree/main/sd3-medium), [Stable Video Diffusion](https://github.com/bentoml/BentoDiffusion/tree/main/svd), [Stable Diffusion XL Turbo](https://github.com/bentoml/BentoDiffusion/tree/main/sdxl-turbo), [ControlNet](https://github.com/bentoml/BentoDiffusion/tree/main/controlnet), [LCM LoRAs](https://github.com/bentoml/BentoDiffusion/tree/main/lcm), and [more](https://github.com/bentoml/BentoDiffusion).
- Text Embeddings: [SentenceTransformers](https://github.com/bentoml/BentoSentenceTransformers)
- Audio: [ChatTTS](https://github.com/bentoml/BentoChatTTS), [XTTS](https://github.com/bentoml/BentoXTTS), [WhisperX](https://github.com/bentoml/BentoWhisperX), [Bark](https://github.com/bentoml/BentoBark)
- Computer Vision: [YOLO](https://github.com/bentoml/BentoYolo)
- Multimodal: [BLIP](https://github.com/bentoml/BentoBlip), [CLIP](https://github.com/bentoml/BentoClip)
- RAG: [RAG-as-a-Service with custom models](https://github.com/bentoml/rag-tutorials)Check out the [examples](./examples/) folder for more sample code and usage.
## Advanced topics
- [Model composition](https://docs.bentoml.com/en/latest/guides/model-composition.html)
- [Workers and model parallelization](https://docs.bentoml.com/en/latest/guides/workers.html)
- [Adaptive batching](https://docs.bentoml.com/en/latest/guides/adaptive-batching.html)
- [GPU inference](https://docs.bentoml.com/en/latest/guides/gpu-inference.html)
- [Distributed serving systems](https://docs.bentoml.com/en/latest/guides/distributed-services.html)
- [Concurrency and autoscaling](https://docs.bentoml.com/en/latest/bentocloud/how-tos/autoscaling.html)
- [Model packaging and Model Store](https://docs.bentoml.com/en/latest/guides/model-store.html)
- [Observability](https://docs.bentoml.com/en/latest/guides/observability/index.html)
- [BentoCloud deployment](https://docs.bentoml.com/en/latest/guides/deployment.html)See [Documentation](https://docs.bentoml.com) for more tutorials and guides.
## Community
Get involved and join our [Community Slack 💬](https://l.bentoml.com/join-slack), 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](https://github.com/bentoml/BentoML/issues/new/choose).### Contributing
There are many ways to contribute to the project:
- Report bugs and "Thumbs up" on [issues](https://github.com/bentoml/BentoML/issues) that are relevant to you.
- Investigate [issues](https://github.com/bentoml/BentoML/issues) and review other developers' [pull requests](https://github.com/bentoml/BentoML/pulls).
- Contribute code or [documentation](https://docs.bentoml.com/en/latest/index.html) to the project by submitting a GitHub pull request.
- Check out the [Contributing Guide](https://github.com/bentoml/BentoML/blob/main/CONTRIBUTING.md) and [Development Guide](https://github.com/bentoml/BentoML/blob/main/DEVELOPMENT.md) to learn more.
- Share your feedback and discuss roadmap plans in the `#bentoml-contributors` channel [here](https://l.bentoml.com/join-slack).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](https://github.com/bentoml/BentoML/blob/main/src/bentoml/_internal/utils/analytics/usage_stats.py) 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](https://github.com/bentoml/BentoML/blob/main/LICENSE)