BentoML
BentoML is a modern, open-source framework for building, shipping, and scaling AI applications. It bridges the gap between ML experimentation and production deployment, letting you package any model from any framework into a production-ready API service in minutes. Run BentoML on Clore.ai's GPU cloud for cost-efficient AI application hosting.
What is BentoML?
BentoML makes it easy to take a trained model and turn it into a scalable API service:
Framework-agnostic: PyTorch, TensorFlow, JAX, scikit-learn, HuggingFace, XGBoost, LightGBM, and more
Bento: A self-contained, reproducible artifact (model + code + dependencies)
Runner: Scalable model inference unit with automatic batching
Service: FastAPI-like HTTP/gRPC service definition
BentoCloud: Optional managed deployment platform
Docker-first: Every Bento can be containerized with one command
Key features:
Adaptive micro-batching for throughput optimization
Built-in input/output validation with Pydantic
OpenAPI spec auto-generated
Prometheus metrics built-in
Streaming response support (LLMs)
Prerequisites
GPU VRAM
8 GB
16–24 GB
GPU
Any NVIDIA
RTX 4090 / A100
RAM
8 GB
16 GB
Storage
20 GB
40 GB
Python
3.9+
3.11+
Step 1 — Rent a GPU on Clore.ai
Log in to clore.ai.
Click Marketplace and select a GPU instance with ≥ 16 GB VRAM.
Set Docker image: we'll use a custom build (see Step 2).
Set open ports:
22(SSH) and3000(BentoML service).Click Rent.
Step 2 — Dockerfile
BentoML doesn't have an official GPU Docker image, so we build one:
Build and Push
Build the image and push it to your own Docker Hub account (replace YOUR_DOCKERHUB_USERNAME with your actual username):
Step 3 — Connect via SSH
Verify BentoML:
Step 4 — Your First BentoML Service
Simple Text Classifier
Create a service file:
Start the Service
Step 5 — Access the Service
Open the auto-generated Swagger UI:
Or test via curl:
Expected response:
Step 6 — Image Classification Service
Vision Model Service
Test with an image:
Step 7 — LLM Streaming Service
For language models with streaming responses:
Step 8 — Save and Build a Bento
A Bento is a packaged, reproducible artifact:
bentofile.yaml
Monitoring and Metrics
BentoML exposes Prometheus metrics at /metrics:
Key metrics:
Adaptive Batching Configuration
Troubleshooting
Service Won't Start
Solutions:
Check CUDA availability:
python -c "import torch; print(torch.cuda.is_available())"Verify GPU VRAM:
nvidia-smiCheck model download completed (look for download progress in logs)
Port 3000 Not Accessible
High Latency on First Request
This is normal — the first request triggers model loading (warm-up). All subsequent requests will be fast. Add a warm-up endpoint call after start:
Import Errors
Solution:
Clore.ai GPU Recommendations
BentoML is a serving framework — GPU requirements depend entirely on the model you deploy. Here's what to expect for common workloads:
RTX 3090
24 GB
$0.07–0.21/hr
~80 tok/s
~4 img/min
~400 req/s
RTX 4090
24 GB
$0.14–0.42/hr
~140 tok/s
~8 img/min
~700 req/s
Use case guidance:
LLM API serving (7B–13B): RTX 3090 ($0.07–0.21/hr) — optimal price-performance
Image generation APIs: RTX 3090 or RTX 4090 depending on throughput needs
Large models (34B–70B Q4): A100 40GB (bare metal) — fits comfortably
Production multi-model serving: A100 80GB for memory headroom
Useful Resources
Last updated
Was this helpful?