Add FastAPI deployment tutorial for MONAI models#2050
Merged
ericspod merged 2 commits intoProject-MONAI:mainfrom Dec 4, 2025
Merged
Add FastAPI deployment tutorial for MONAI models#2050ericspod merged 2 commits intoProject-MONAI:mainfrom
ericspod merged 2 commits intoProject-MONAI:mainfrom
Conversation
This tutorial demonstrates how to deploy MONAI model bundles as production-ready REST APIs using FastAPI. Features: - Complete FastAPI application with inference endpoints - MONAI model bundle integration (spleen_ct_segmentation) - Singleton pattern for efficient model loading - Async/await for optimal performance - Pydantic validation for type safety - Auto-generated API documentation (Swagger/ReDoc) - Docker deployment with multi-stage builds - Comprehensive unit tests - Example client code and HTTP requests - Production-ready error handling and logging Structure: - app/: FastAPI application code - tests/: Unit test suite - docker/: Containerization configs - examples/: Usage examples - README.md: Complete tutorial documentation Addresses Project-MONAI#2048 Signed-off-by: Mohamed Salah <eng.mohamed.tawab@gmail.com>
for more information, see https://pre-commit.ci
ericspod
approved these changes
Dec 4, 2025
Member
ericspod
left a comment
There was a problem hiding this comment.
Hi @engmohamedsalah thanks for this tutorial on deployment (sorry for not responding to your original issue proposing this). I think this looks great as it is so we can hopefully merge this soon. We have automated testing for notebooks which this example doesn't use so we won't be tested regularly, we may want to return sometime later to see if we can integrate the tests into the CICD system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tutorial demonstrates how to deploy MONAI model bundles as production-ready REST APIs using FastAPI.
Features:
Structure:
Addresses #2048
Fixes # .
Description
A few sentences describing the changes proposed in this pull request.
Checks
./figurefolder./runner.sh -t <path to .ipynb file>