vetiver.VetiverAPI#

class vetiver.VetiverAPI(model: vetiver.vetiver_model.VetiverModel, check_ptype: bool = True, app_factory=<class 'fastapi.applications.FastAPI'>)#

Create model aware API

Parameters
  • model (VetiverModel) – Model to be deployed in API

  • check_ptype (bool) – Determine if data prototype should be enforced

  • app_factory – Type of API to be deployed

Example

>>> import vetiver
>>> X, y = vetiver.get_mock_data()
>>> model = vetiver.get_mock_model().fit(X, y)
>>> v = vetiver.VetiverModel(model = model, model_name = "my_model", ptype_data = X)
>>> v_api = vetiver.VetiverAPI(model = v, check_ptype = True)
__init__(model: vetiver.vetiver_model.VetiverModel, check_ptype: bool = True, app_factory=<class 'fastapi.applications.FastAPI'>) None#

Methods

__init__(model[, check_ptype, app_factory])

run([port, host])

Start API

vetiver_post(endpoint_fx[, endpoint_name])

Create new POST endpoint that is aware of model input data

Attributes

app