{"id":13935687,"url":"https://github.com/davidefiocco/streamlit-fastapi-model-serving","last_synced_at":"2025-04-04T19:12:15.564Z","repository":{"id":37260788,"uuid":"273767286","full_name":"davidefiocco/streamlit-fastapi-model-serving","owner":"davidefiocco","description":"Simple web app example serving a PyTorch model using streamlit and FastAPI","archived":false,"fork":false,"pushed_at":"2024-02-12T12:31:46.000Z","size":48,"stargazers_count":493,"open_issues_count":7,"forks_count":91,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-28T18:13:30.166Z","etag":null,"topics":["docker-compose","fastapi","pycones","pytorch","streamlit"],"latest_commit_sha":null,"homepage":"https://davidefiocco.github.io/streamlit-fastapi-ml-serving","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidefiocco.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-06-20T18:57:39.000Z","updated_at":"2025-03-27T07:43:40.000Z","dependencies_parsed_at":"2024-09-22T09:40:48.129Z","dependency_job_id":null,"html_url":"https://github.com/davidefiocco/streamlit-fastapi-model-serving","commit_stats":{"total_commits":61,"total_committers":6,"mean_commits":"10.166666666666666","dds":0.6229508196721312,"last_synced_commit":"2879ab7cb37c2de7b755a9d590f9b43ee7c88797"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fstreamlit-fastapi-model-serving","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fstreamlit-fastapi-model-serving/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fstreamlit-fastapi-model-serving/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fstreamlit-fastapi-model-serving/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidefiocco","download_url":"https://codeload.github.com/davidefiocco/streamlit-fastapi-model-serving/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"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-compose","fastapi","pycones","pytorch","streamlit"],"created_at":"2024-08-07T23:01:59.763Z","updated_at":"2025-04-04T19:12:15.541Z","avatar_url":"https://github.com/davidefiocco.png","language":"Python","readme":"# streamlit-fastapi-model-serving\n\nSimple example of usage of streamlit and FastAPI for ML model serving described on [this blogpost](https://davidefiocco.github.io/streamlit-fastapi-ml-serving) and [PyConES 2020 video](https://www.youtube.com/watch?v=IvHCxycjeR0).\n\nWhen developing simple APIs that serve machine learning models, it can be useful to have _both_ a backend (with API documentation) for other applications to call and a frontend for users to experiment with the functionality.\n\nIn this example, we serve an [image semantic segmentation model](https://pytorch.org/hub/pytorch_vision_deeplabv3_resnet101/) using `FastAPI` for the backend service and `streamlit` for the frontend service. `docker compose` orchestrates the two services and allows communication between them.\n\nTo run the example in a machine running Docker and docker compose, run:\n\n    docker compose build\n    docker compose up\n\nTo visit the FastAPI documentation of the resulting service, visit http://localhost:8000/docs with a web browser.  \nTo visit the streamlit UI, visit http://localhost:8501.\n\nLogs can be inspected via:\n\n    docker compose logs\n\n### Debugging\n\nTo modify and debug the app, [development in containers](https://davidefiocco.github.io/debugging-containers-with-vs-code) can be useful (and kind of fun!).\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidefiocco%2Fstreamlit-fastapi-model-serving","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidefiocco%2Fstreamlit-fastapi-model-serving","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidefiocco%2Fstreamlit-fastapi-model-serving/lists"}