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

Connected

Exercise

POST endpoint for model registration

While the GET endpoint you created earlier allows users to retrieve information about existing models, you now need a way for authorized team members to register new models or update information about existing ones.

You need to create a POST endpoint that allows team members to register new models or update existing ones. This endpoint will store model information on the server.

Instructions

100 XP
  • Create a POST request endpoint at "/register-model".
  • Define the function parameter model_info to accept and validate the incoming model information using the ModelInfo Pydantic model.
  • Convert the ModelInfo object to a dictionary and store it in the model_db.