{"id":28955855,"url":"https://github.com/grigorkh/fastapi-ml-deployment-template","last_synced_at":"2026-01-20T16:30:23.723Z","repository":{"id":299244669,"uuid":"1002453193","full_name":"grigorkh/fastapi-ml-deployment-template","owner":"grigorkh","description":"This repository provides a complete example of serving a machine learning model with FastAPI, containerizing it using Docker, and deploying it on Kubernetes.","archived":false,"fork":false,"pushed_at":"2025-06-22T14:34:07.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T15:38:20.645Z","etag":null,"topics":["api","docker","fastapi","fastapi-template","kubernetes","ml","mlops","python"],"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/grigorkh.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,"zenodo":null}},"created_at":"2025-06-15T14:08:15.000Z","updated_at":"2025-06-22T14:34:10.000Z","dependencies_parsed_at":"2025-06-23T20:11:54.122Z","dependency_job_id":null,"html_url":"https://github.com/grigorkh/fastapi-ml-deployment-template","commit_stats":null,"previous_names":["grigorkh/fastapi-ml-deployment-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/grigorkh/fastapi-ml-deployment-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grigorkh%2Ffastapi-ml-deployment-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grigorkh%2Ffastapi-ml-deployment-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grigorkh%2Ffastapi-ml-deployment-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grigorkh%2Ffastapi-ml-deployment-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grigorkh","download_url":"https://codeload.github.com/grigorkh/fastapi-ml-deployment-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grigorkh%2Ffastapi-ml-deployment-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","docker","fastapi","fastapi-template","kubernetes","ml","mlops","python"],"created_at":"2025-06-23T20:11:53.175Z","updated_at":"2026-01-20T16:30:23.705Z","avatar_url":"https://github.com/grigorkh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI ML Deployment Template\n\nThis repository provides a complete example of serving a machine learning model with FastAPI, containerizing it using Docker, and deploying it on Kubernetes.\n\n## 🧠 Features\n\n- ✅ FastAPI app with `/predict` endpoint\n- ✅ Real scikit-learn model (Iris dataset)\n- ✅ Lightweight Dockerfile with best practices\n- ✅ Kubernetes manifests: Deployment, Service, HPA, Ingress\n- ✅ Ready for production and educational use\n\n## 📖 Related Medium Articles\n\n- Part 1: [Serving ML Models with FastAPI](https://grigorkh.medium.com/serving-ml-models-with-fastapi-a-production-ready-api-in-minutes-b5f4839a33a9)\n- Part 2: [Dockerizing Your FastAPI ML App](https://grigorkh.medium.com/dockerizing-your-fastapi-ml-app-from-script-to-container-5dcc28d3a6c0)\n- Part 3: [Deploying Your ML API on Kubernetes - Comming Soon](https://grigorkh.medium.com/)\n\n## 🚀 Quickstart\n\n1. Clone the repo:\n   ```\n   git clone https://github.com/your-username/fastapi-ml-deployment-template.git\n   ```\n\n2. Train the model:\n   ```\n   python model/train_model.py\n   ```\n\n3. Build the Docker image:\n   ```\n   docker build -t your-dockerhub-username/fastapi-ml:latest .\n   ```\n\n4. Push it to Docker Hub (detailed guide coming soon).\n\n5. Apply Kubernetes manifests:\n   ```\n   kubectl apply -f k8s/\n   ```\n\n6. Test the endpoint:\n   ```\n   curl -X POST http://localhost:8000/predict -H \"Content-Type: application/json\" -d '{\"sepal_length\": 5.1, \"sepal_width\": 3.5, \"petal_length\": 1.4, \"petal_width\": 0.2}'\n   ```\n\n---\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrigorkh%2Ffastapi-ml-deployment-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrigorkh%2Ffastapi-ml-deployment-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrigorkh%2Ffastapi-ml-deployment-template/lists"}