vetiver.VetiverAPI
vetiver.VetiverAPI#
- class vetiver.VetiverAPI(model: vetiver.vetiver_model.VetiverModel, check_prototype: bool = True, app_factory=<class 'fastapi.applications.FastAPI'>, **kwargs)#
Create model aware API
- Parameters
model (VetiverModel) – Model to be deployed in API
check_prototype (bool) – Determine if data prototype should be enforced
app_factory – Type of API to be deployed
**kwargs (dict) – Deprecated parameters.
Examples
>>> import vetiver as vt >>> X, y = vt.get_mock_data() >>> model = vt.get_mock_model().fit(X, y) >>> v = vt.VetiverModel(model = model, model_name = "my_model", prototype_data = X) >>> v_api = vt.VetiverAPI(model = v, check_prototype = True)
Notes
Parameter check_ptype was changed to check_prototype. Handling of check_ptype will be removed in a future version.
- __init__(model: vetiver.vetiver_model.VetiverModel, check_prototype: bool = True, app_factory=<class 'fastapi.applications.FastAPI'>, **kwargs) None #
Methods
__init__
(model[, check_prototype, 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