Deserve is a nanoframework for serving ML models
Project description
Deserve
Deserve is a nanoframework for serving ML models. Flasker than Flask, faster than FastAPI, Deserve is asynchronous, lightweight and simple.
Features
- 🤙 Remote procedure call (RPC) architecture. There are no endpoints, methods, paths, nor resource to make decisions about — just the
host
:port
. - 📦 Send JSON, receive JSON. Accept a Python object, return an object. Conversions happen under the hood.
Installing
$ pip install deserve
Also install an ASGI server such as Uvicorn or Hypercorn.
$ pip install hypercorn
Quickstart
# Save this as example.py
import deserve
model = ... # Load your model
@deserve
async def predict(request: object) -> object:
... # Preprocess input
output = model.predict(input)
... # Postprocess output
return response
Run the server using the names of your file (example.py
) and function (predict
).
$ hypercorn server:predict
[INFO] Running on http://127.0.0.1:8000
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deserve-0.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for deserve-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4ac7739051053cff4ad385490b21267dbb2953e94306547c27bc826081a4e62 |
|
MD5 | 3b6db0f346d874d84dfb8a0c3e701c85 |
|
BLAKE2b-256 | 14f77a017f2bec0127dfdd58609d76ad3c11c44ce6a8b4a4b46a1f14b595042e |