{"id":19380577,"url":"https://github.com/techytushar/kserve_pytorch","last_synced_at":"2026-06-15T08:31:11.727Z","repository":{"id":227351040,"uuid":"771176187","full_name":"techytushar/kserve_pytorch","owner":"techytushar","description":"End to End MLOps demo","archived":false,"fork":false,"pushed_at":"2024-03-12T20:50:28.000Z","size":9180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T16:52:23.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/techytushar.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}},"created_at":"2024-03-12T20:31:49.000Z","updated_at":"2024-03-12T20:36:33.000Z","dependencies_parsed_at":"2024-03-12T21:47:46.091Z","dependency_job_id":"f6b4cb50-486d-4bca-ab53-cbce7c7a54c5","html_url":"https://github.com/techytushar/kserve_pytorch","commit_stats":null,"previous_names":["techytushar/kserve_pytorch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techytushar/kserve_pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techytushar%2Fkserve_pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techytushar%2Fkserve_pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techytushar%2Fkserve_pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techytushar%2Fkserve_pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techytushar","download_url":"https://codeload.github.com/techytushar/kserve_pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techytushar%2Fkserve_pytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34355157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T09:14:17.841Z","updated_at":"2026-06-15T08:31:11.709Z","avatar_url":"https://github.com/techytushar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Tech Stack used:\n* **PyTorch**: model training and fine-tuning\n* **MlFlow**: experiment tracking and logging\n* **Hydra**: configuration management\n* **KServe**: model serving\n* **minikube**: run a K8s cluster locally\n\n## Approach:\n1. I chose to fine-tune a pre-trained **MobileNetV2** model, because low inference latency was a priority. This is one of the model that was built to run on the edge, so its very small in size and has fast inference, with reasonable accuracy.\n2. Logged all the **parameters**, **metrics** and **artifacts** to MLFlow during the fine-tuning process, which helped in choosing the final model to deploy.\n3. Since I had to do some pre-processing on the input data for it to be compatible with the model input, I used the `Custom Predictor` feature of **KServe** and wrote a custom predictor for the PyTorch model.\n4. Packaged everything into a **Docker image** and tested locally.\n\u003e **Note:** For this task I also copied the model into the Docker image (for simplicity), but we can keep it outside in an object storage as well, for easy switching between models.\n5. Started a **minikube** cluster and installed **KServe** on it.\n6. Created a **KServe Inference Service** and applied it to the minikube cluster.\n7. Used Port-Forwarding from the Inference K8s service to test on localhost.\n\n## Further Enhancements:\n* Use **Poetry** python package manager for better dependency management\n* Use **Prometheus** for service monitoring\n\n## Screenshots:\n\n### MLFlow\n\nMlFlow Experiments\n![MlFlow Experiments](docs/mlflow1.png)\n\nMlFlow Run Metrics\n![MlFlow Metrics](docs/mlflow2.png)\n\n### Curl\n\nLocal curl prediction request\n![Curl Local](docs/curl_local.png)\n\nK8s curl prediction request (using port-forwarding)\n![Curl K8s](docs/curl_k8s.png)\n\nDocker image running locally\n![Docker Run](docs/docker_run.png)\n\n### K8s Resources\n\nK8s Deployment resource by KServe inference service CR\n![K8s Deployment](docs/k8s_deployment.png)\n\nK8s Service resource by KServe inference service CR\n![K8s Service](docs/k8s_service.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechytushar%2Fkserve_pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechytushar%2Fkserve_pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechytushar%2Fkserve_pytorch/lists"}