Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vkuznet/mlhub
A proxy server for MLaaS
https://github.com/vkuznet/mlhub
Last synced: about 1 month ago
JSON representation
A proxy server for MLaaS
- Host: GitHub
- URL: https://github.com/vkuznet/mlhub
- Owner: vkuznet
- License: mit
- Created: 2023-04-10T16:54:42.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T13:24:00.000Z (over 1 year ago)
- Last Synced: 2024-10-30T06:27:35.036Z (3 months ago)
- Language: Go
- Size: 444 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MLHub
MLHub is a machine learning service for open science. It is a platform for storing and publishing trained ML models coupled with an inference engine that delivers insights on demand. MLHub democratizes access to machine learning resources for communities from all scientific domains.Using MLHub, researchers can easily:
* Upload, organize, and manage privacy settings on their own trained models.
* Publish thier models and assign DOIs with the click of a button.
* Search for models published by other researchers and generate citations.
* Run the inference engine to compute output predictions on any input dataset, using any model in the repository to which the researcher has access.MLHub is more than just a reference library of published science. It can be directly used in machine learning workflows as tool for research itself. So, by incorporating a public service like MLHub early in their research process, scientists simplify the eventual task of making their published research FAIR-compliant.
## Architecture
MLHub supports all common MLaaS backend frameworks, including TensorFlow, PyTorch, Keras, and scikit-learn. It consists of the following components:
- MetaData service for pre-trained ML models
- A reverse proxy to different MLaaS backends:
```
| -> TFaaS
client --> MLHub --| -> PyTorch
| | -> Keras+ScikitLearn
|
|--------> MetaData service
```
Each ML backend server may have different set of APIs and MLHub provides
an uniform way to query these services. So far we support the following set of APIs:
- `/model/` end-point provides the following methods:
- `GET` HTTP request will retrieve ML meta-data for provide ML name, e.g.
```
# fetch meta-data info about ML model
curl http://localhost:port/model/mnist
```
- `POST` HTTP request will create new ML entry in MLHub for provided
ML meta-data JSON record and ML tarball
```
# post ML meta-data
curl -X POST \
-H "content-type: application/json" \
-d '{"model": "mnist", "type": "TensorFlow", "meta": {}}' \
http://localhost:port/model/mnist
```
- `PUT` HTTP request will update exsiting ML entry in MLHub for provided
ML meta-data JSON record
```
# post ML meta-data
curl -X PUT \
-H "content-type: application/json" \
-d '{"model": "mnist", "type": "TensorFlow", "meta": {"param": 1}}' \
http://localhost:port/model/mnist
```
- `DELETE` HTTP request will delete ML entry in MLHub for provided ML name
```
curl -X DELETE \
http://localhost:port/model/mnist
```
- `/models` to list existing ML models, GET HTTP request
```
# to get all ML models
curl http://localhost:port/models
```### ML model APIs
- `/model//upload` uploads ML model bundle
```
# upload ML model
curl -X POST -H "Content-Encoding: gzip" \
-H "content-type: application/octet-stream" \
--data-binary @./mnist.tar.gz \
http://localhost:port/model/mnist/upload
```
- `/model//download` downloads ML model bundle
```
curl http://localhost:port/model/mnist/download
```
- `/model//predict` to get prediction from a given ML model.
```
# provide prediction for given input vector
curl -X GET \
-H "content-type: application/json" \
-d '{"input": [input values]}' \
http://localhost:port/model/mnist/predict# provide prediction for given image file
curl http://localhost:8083/model/mnist \
-F 'image=@./img4.png'
```