Skip to content
Vinícius Nunes da Costa edited this page Oct 17, 2024 · 1 revision

AI Deployment as Template

A quality template to deploy containerized AI projects. Pronounced "AI that", this repository is a template for quick deployment of AI Python projects using Machine Learning, Poetry, FastAPI, Docker, and Pytests.

Project Structure

The repository is divided into two main modules:

App Module:

Contains all the FastAPI configurations, routes, services, and I/O models.
Key components:
    api: Web-related stuff, including routes.
    core: Application configuration, startup events, logging.
    models: Pydantic models for the application.
    services: Logic that is not just CRUD related.
    main.py and main-aws-lambda.py: FastAPI application creation and configuration.

ML Module:

Handles data discovery steps, data handling, and the train/test pipeline.
Includes inference-ready model binaries and their custom inference classes for handling pre and post-processing.
Key components:
    data: Scripts to download or generate data.
    features: Scripts to turn raw data into features for modeling.
    model: Scripts to train models and evaluate predictions, including train.py and eval.py.
    pipeline.py: Orchestrates the custom pipeline class.

The inference code and models in the ML module are automatically imported and built along the App module for the dedicated Docker image.