{"id":13424862,"url":"https://github.com/eightBEC/fastapi-ml-skeleton","last_synced_at":"2025-03-15T18:36:01.375Z","repository":{"id":40970612,"uuid":"240726747","full_name":"eightBEC/fastapi-ml-skeleton","owner":"eightBEC","description":"FastAPI Skeleton App to serve machine learning models production-ready.","archived":false,"fork":false,"pushed_at":"2024-07-05T23:42:10.000Z","size":960,"stargazers_count":412,"open_issues_count":7,"forks_count":83,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-17T02:01:46.242Z","etag":null,"topics":["fastapi","machine-learning","model-serving","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eightBEC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-15T14:27:08.000Z","updated_at":"2024-12-16T02:27:07.000Z","dependencies_parsed_at":"2024-01-03T02:30:09.462Z","dependency_job_id":"2de9d92f-005d-40e8-86e5-0d67246c668f","html_url":"https://github.com/eightBEC/fastapi-ml-skeleton","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightBEC%2Ffastapi-ml-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightBEC%2Ffastapi-ml-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightBEC%2Ffastapi-ml-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightBEC%2Ffastapi-ml-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eightBEC","download_url":"https://codeload.github.com/eightBEC/fastapi-ml-skeleton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775938,"owners_count":20346292,"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":["fastapi","machine-learning","model-serving","python","python3"],"created_at":"2024-07-31T00:01:00.241Z","updated_at":"2025-03-15T18:35:56.365Z","avatar_url":"https://github.com/eightBEC.png","language":"Python","readme":"# FastAPI Model Server Skeleton\n\nServing machine learning models production-ready, fast, easy and secure powered by the great FastAPI by [Sebastián Ramírez]([)](https://github.com/tiangolo).\n\nThis repository contains a skeleton app which can be used to speed-up your next machine learning project. The code is fully tested and provides a preconfigured `tox` to quickly expand this sample code.\n\nTo experiment and get a feeling on how to use this skeleton, a sample regression model for house price prediction is included in this project. Follow the installation and setup instructions to run the sample model and serve it aso RESTful API.\n\n## Requirements\n\n- Python 3.11+\n- Poetry\n\n## Installation\nInstall the required packages in your local environment (ideally virtualenv, conda, etc.).\n\n```bash\npoetry install\n``` \n\n\n## Setup\n1. Duplicate the `.env.example` file and rename it to `.env` \n\n\n2. In the `.env` file configure the `API_KEY` entry. The key is used for authenticating our API. \u003cbr\u003e\n   A sample API key can be generated using Python REPL:\n\n```python\nimport uuid\nprint(str(uuid.uuid4()))\n```\n\n## Run It\n\n1. Start your  app with:\n\n```bash\nset -a\nsource .env\nset +a\nuvicorn fastapi_skeleton.main:app\n```\n\n2. Go to [http://localhost:8000/docs](http://localhost:8000/docs).\n3. Click `Authorize` and enter the API key as created in the Setup step.\n![Authroization](./docs/authorize.png) \n4. You can use the sample payload from the `docs/sample_payload.json` file when trying out the house price prediction model using the API.\n   ![Prediction with example payload](./docs/sample_payload.png)\n\n## Linting\n\nThis skeleton code uses isort, mypy, flake, black, bandit for linting, formatting and static analysis.\n\nRun linting with:\n\n```bash\n./scripts/linting.sh\n```\n\n## Run Tests\n\nRun your tests with:\n\n```bash\n./scripts/test.sh\n```\n\nThis runs tests and coverage for Python 3.11 and Flake8, Autopep8, Bandit.\n\n\n## Changelog\n\nv.1.0.0 - Initial release\n\n- Base functionality for using FastAPI to serve ML models.\n- Full test coverage \n\nv.1.1.0 - Update to Python 3.11, FastAPI 0.108.0\n\n- Updated to Python 3.11\n- Added linting script\n- Updated to pydantic 2.x\n- Added poetry as package manager\n\n","funding_links":[],"categories":["Projects","Python"],"sub_categories":["Boilerplate"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeightBEC%2Ffastapi-ml-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeightBEC%2Ffastapi-ml-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeightBEC%2Ffastapi-ml-skeleton/lists"}