1. Learn
  2. /
  3. Courses
  4. /
  5. Deploying AI into Production with FastAPI

Connected

Exercise

GET endpoint for model information

You're part of a machine learning team that has developed several machine learning models, each designed for different tasks such as sentiment analysis, product categorization, and customer churn prediction. You're working on deploying these models, and you need to create an endpoint that provides basic information about each model.

Your task is to implement a GET endpoint at route /model-info/{model_id} that retrieves and returns this essential model information.

Instructions

100 XP
  • Create a GET endpoint at "/model-info/{model_id}" that returns information about a specific model.
  • The endpoint should accept a model_id as a path parameter.
  • Raise an HTTPException with a 404 status code indicating that the model was not found if the model_id is 0.