Deploying with custom Python environments
When you deploy, Modelbit will detect the pip
packages needed to replicate your Notebook's environment.
To further customize the Python environment, use the python_version
, python_packages
and system_packages
parameters.
To deploy to an environment with a specific version of sklearn
:
mb.deploy(my_deploy_function, python_packages=["scikit-learn==1.0.2",])
To deploy to an environment with a specific versions of multiple pip
packages:
mb.deploy(my_deploy_function, python_packages=["scikit-learn==1.0.2", "xgboost==1.5.2"])
To deploy to an environment with a specific version of Python:
mb.deploy(my_deploy_function, python_version="3.9")
To deploy to an environment with specific system libraries (installed using apt-get
):
mb.deploy(my_deploy_function, system_packages=["libgomp1"])
With customized Python environment it's possible to deploy many kinds of models. Here are some examples:
- Example sklearn deployment
- Example XGBoost deployment
- Example Prince PCA deployment
- Example BTYD deployment
- Example Prophet deployment
- Example fasttext deployment
Including additional files
Modelbit has different workflows depending on how you want to add additional Python files with your deployments:
- Extra Files for one deployment: If you have one or two
.py
files that only one deployment depends on. - Common files for all deployments: If you have Python files that should be available in all deployments.
- Private packages & wheels: If you have a
setup.py
orpyproject.toml
and usepip install
to make your libraries available for import.