{"id":19214664,"url":"https://github.com/garethjns/sklearn-model-server","last_synced_at":"2026-05-05T04:31:37.793Z","repository":{"id":111936832,"uuid":"240700894","full_name":"garethjns/sklearn-model-server","owner":"garethjns","description":"A set of Dockerized microservices for training and serving sklearn models over gRPC and REST.","archived":false,"fork":false,"pushed_at":"2024-06-17T22:59:39.000Z","size":7981,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-04T18:13:07.641Z","etag":null,"topics":["docker","grpc","microservice","minio","rest-api","serving-sklearn-models","sklearn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garethjns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-15T11:54:22.000Z","updated_at":"2020-05-03T01:02:05.000Z","dependencies_parsed_at":"2023-03-13T13:31:10.780Z","dependency_job_id":null,"html_url":"https://github.com/garethjns/sklearn-model-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethjns%2Fsklearn-model-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethjns%2Fsklearn-model-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethjns%2Fsklearn-model-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethjns%2Fsklearn-model-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garethjns","download_url":"https://codeload.github.com/garethjns/sklearn-model-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240288200,"owners_count":19777627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grpc","microservice","minio","rest-api","serving-sklearn-models","sklearn"],"created_at":"2024-11-09T14:10:53.505Z","updated_at":"2025-10-08T11:10:42.748Z","avatar_url":"https://github.com/garethjns.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sklearn-Model-Servers\n\n![Test Model-Client-GRPC](https://github.com/garethjns/sklearn-model-server/workflows/Test%20Model-Client-GRPC/badge.svg)\n![Test Model-Client-REST](https://github.com/garethjns/sklearn-model-server/workflows/Test%20Model-Client-REST/badge.svg)\n![Test Model-Server-GRPC](https://github.com/garethjns/sklearn-model-server/workflows/Test%20Model-Server-GRPC/badge.svg)\n![Test Model-Server-REST](https://github.com/garethjns/sklearn-model-server/workflows/Test%20Model-Server-REST/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=garethjns_sklearn-model-server\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=garethjns_sklearn-model-server)\n\nA small set of Dockerized microservices for training and serving Sklearn models over gRPC and REST. Currently includes a server and a client that hassles the server for predictions. \n\nThe servers include pre-trained models on generated data. These are handled locally, but in the future the training will be moved to a separate service, and models and data will be persisted in a will be moved to a Minio instance. \n\n\n ## Running\n Running the whole system requires docker and docker-compose, running the individual services just requires docker.\n \n ### Docker-compose\n\n ```bash\nsudo docker-compose build\nsudo docker-compose up --scale model_client_grpc=3 --scale model_client_rest=3\n```\n \nThis will start the server with the pre-trained models, and start 3 of each clients that randomly request predictions from the model. Output look something like this:\n\n````\nStarting sklearn-model-server_model_server_grpc_1 ... done\nStarting sklearn-model-server_minio_1        ... done\nStarting sklearn-model-server_model_client_grpc_1 ... done\nCreating sklearn-model-server_model_client_grpc_2 ... done\nCreating sklearn-model-server_model_client_grpc_3 ... done\nCreating sklearn-model-server_model_client_rest_1 ... done\nCreating sklearn-model-server_model_client_rest_2 ... done\nCreating sklearn-model-server_model_client_rest_3 ... done\n[Minio stuff ...]\nmodel_client_1  | ClientId: 40614\nmodel_client_1  | X {\nmodel_client_1  |   f0: -2.545633554458618\nmodel_client_1  |   f1: -0.24103513360023499\nmodel_client_1  |   f2: -1.0877643823623657\nmodel_client_1  |   f3: -1.8311690092086792\nmodel_client_1  |   f4: -0.1957949697971344\nmodel_client_1  | }\nmodel_client_1  | ModelName: \"RandomForestClassifier.pkl\"\n[...]\nmodel_client_2  | ClientId: 16356\nmodel_client_2  | X {\nmodel_client_2  |   f0: -2.180135488510132\nmodel_client_2  |   f1: -3.1747219562530518\nmodel_client_2  |   f2: -2.9947762489318848\nmodel_client_2  |   f3: 0.9534611701965332\nmodel_client_2  |   f4: -0.6837826371192932\nmodel_client_2  | }\nmodel_client_2  | ModelName: \"SGDClassifier.pkl\"\n[...]\nmodel_client_rest_1  | Client: 27472: Saved preds: data/data_test.hdf_client_27472_RandomForestClassifier.pkl_preds.csv\n[...]\nmodel_client_rest_2  | Client 16348: Returned path: data/data_test.hdf_client_16348_RandomForestClassifier.pkl_preds.csv in 1.29s\n[... etc.]\n````\n \n ### Individual containers\n \n #### Model-Server-GRPC\n (see also Model-Server-GRPC/README)  \n \nAccepts gRPC requests for predictions, and returns the predicted probabilities. Full data is included in request and response.\n \nRun:\n  ```Bash\ncd Model-Server-GRPC\nsudo docker build . -t model_server_grpc\nsudo docker run -p 8080:8080 model_server_grpc\n ```\n \n #### Model-Client-GRPC\n (see also Model-Client-GRPC/README)  \n  \nA simple service to emulate a client that randomly queries the server for predictions every few seconds.\n \nRun:\n ```Bash\ncd Model-Client-GRPC\nsudo docker build . -t model_client_grpc\nsudo docker run model_client_grpc\n ```\n \n  #### Model-Server-REST\n (see also Model-Server-REST/README)  \n \nAccepts REST requests for predictions, and returns the path to a file containing the predicted probabilities. Paths to files are included in request and response.\n \nRun:\n  ```Bash\ncd Model-Server-REST\nsudo docker build . -t model_server_rest\nsudo docker run -p 8000:8000 -t -i model_server_rest\n ```\n \n #### Model-Client-REST\n (see also Model-Client-REST/README)  \n  \nA simple service to emulate a client that randomly queries the server for predictions every few seconds.\n \nRun:\n ```Bash\ncd Model-Client-REST\nsudo docker build . -t model_client_rest\nsudo docker run model_client_rest\n ```\n \n ### Model-Trainer\n Planned. Will replace the training scripts in Model-Server/model_server/scripts/, and save models (pickled and ONNYX) to Min.io for the Model-Server to use.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethjns%2Fsklearn-model-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarethjns%2Fsklearn-model-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethjns%2Fsklearn-model-server/lists"}