{"id":16940209,"url":"https://github.com/sudohainguyen/cookiecutter-ml-fastapi-template","last_synced_at":"2026-04-18T06:03:29.933Z","repository":{"id":100129597,"uuid":"365915187","full_name":"sudohainguyen/cookiecutter-ml-fastapi-template","owner":"sudohainguyen","description":"A Cookiecutter-based code structure template for a simple API to serve ML/DL models using FastAPI.","archived":false,"fork":false,"pushed_at":"2021-09-18T03:31:01.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T06:11:27.137Z","etag":null,"topics":["cookiecutter","fastapi","fastapi-template","machine-learning"],"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/sudohainguyen.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":"2021-05-10T04:16:18.000Z","updated_at":"2023-05-13T06:26:10.000Z","dependencies_parsed_at":"2023-03-10T08:15:33.795Z","dependency_job_id":null,"html_url":"https://github.com/sudohainguyen/cookiecutter-ml-fastapi-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sudohainguyen/cookiecutter-ml-fastapi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudohainguyen%2Fcookiecutter-ml-fastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudohainguyen%2Fcookiecutter-ml-fastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudohainguyen%2Fcookiecutter-ml-fastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudohainguyen%2Fcookiecutter-ml-fastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudohainguyen","download_url":"https://codeload.github.com/sudohainguyen/cookiecutter-ml-fastapi-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudohainguyen%2Fcookiecutter-ml-fastapi-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31958469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["cookiecutter","fastapi","fastapi-template","machine-learning"],"created_at":"2024-10-13T21:06:33.415Z","updated_at":"2026-04-18T06:03:29.871Z","avatar_url":"https://github.com/sudohainguyen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ML FastAPI template\n\nA Cookiecutter-based code structure template for a simple API to serve ML/DL models using FastAPI.\n\n\n\n\n## Features\n\n- `flake8` for code styling.\n- Auto clean code before making commits with `pre-commit`.\n- Pre-written Dockerfile.\n- Requirements split into multiple files (base, dev, prod).\n- Include `pip-chill` which is able to quickly export pip packages cleaner.\n- Cookiecutter will generate entire FastAPI project based on given info. The project stucture should include:\n  - `data`: where ml models or static files stored\n  - `envs`: env files for dev, staging or prod environment.\n  - `requirements`: python packages requirements\n  - `src`: where to put your code\n\n  \n## Run Locally\n\nYou can either create a virtual env python or use existing one\n\nInstall Cookiecutter\n\n```bash\n  pip install cookiecutter==1.7.3\n```\n\nClone the project using cookiecutter, while cloning, you need to specify some information such as `project_name` or `short_description`, etc...\n\n```bash\n  cookiecutter https://github.com/sudohainguyen/ml-fastapi-template\n```\n\nGo to the project directory\n\n```bash\n  cd [your_project_name]\n```\n\nInstall dependencies\n\n```bash\n  pip install requirements/dev.txt\n```\n\nInstall pre-commit hook\n```bash\n  pre-commit install\n```\n\nStart the server\n\n```bash\n  python src/api.py\n```\n\n  \n## Deployment\n\nTo deploy this project, please use Dockerfile to build image for the API.\n\n```bash\n  docker build -t [image_name]:[tag] --build-arg PROD .\n```\n\n  \n## Running Tests\n\nRecommended to use `pytest` for automation test purposes. All test cases should be placed in `test` folder.\n\n```bash\n  pytest -s\n```\n\n  \n## Contributing\n\nContributions or suggestions are always welcome! Please feel free to contact me or create new PRs.\n\n\n  \n## Acknowledgements\n\nInspired by [cookiecutter-spacy-api](https://github.com/microsoft/cookiecutter-spacy-fastapi) and [topdup](https://github.com/forummlcb/topdup).\n\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudohainguyen%2Fcookiecutter-ml-fastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudohainguyen%2Fcookiecutter-ml-fastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudohainguyen%2Fcookiecutter-ml-fastapi-template/lists"}