We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Tutorials - Ethan Swan: Building a Model Prediction Server
Learn how to build a model prediction server using Pydantic, FastAPI, and other popular Python libraries and tools, and explore options for deployment on various cloud platforms.
- Use Pydantic for data validation: Pydantic is a library that allows for easy data validation and is very tightly integrated with Python.
- Use FastAPI for building a model prediction server: FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
-
Create a virtual environment: Create a virtual environment using
python -m venv venvto isolate the dependencies for your project. -
Use
pytestfor testing:pytestis a powerful testing framework for Python that allows for easy testing of your code. -
Use
conftestfor configuration of tests:conftestis a file that can be used to configure tests. -
Use
pytest.fixtureto define a test client:pytest.fixturecan be used to define a test client that can be used to test your API. -
Use
HTTPXfor making HTTP requests:HTTPXis a library that can be used to make HTTP requests. -
Use
pandasfor data manipulation:pandasis a library that can be used for data manipulation and analysis. -
Use
scikit-learnfor machine learning:scikit-learnis a library that can be used for machine learning. -
Use
picklefor model serialization:pickleis a library that can be used to serialize and deserialize Python objects. -
Use
JSONfor data serialization:JSONis a format that can be used to serialize and deserialize data. -
Use
requestsfor making HTTP requests:requestsis a library that can be used to make HTTP requests. -
Use
curlfor making HTTP requests:curlis a command-line tool that can be used to make HTTP requests. -
Use
Dockerfor containerization:Dockeris a containerization platform that can be used to run your application in a container. -
Use
Azurefor cloud deployment:Azureis a cloud platform that can be used to deploy your application. -
Use
Linodefor cloud deployment:Linodeis a cloud platform that can be used to deploy your application. -
Use
DigitalOceanfor cloud deployment:DigitalOceanis a cloud platform that can be used to deploy your application.