I am trying to get the class proabilities from my model as well and I thought adding type = "prob" inside predict() would return 2 cols for .pred_0 and .pred_1, but that's not the case.
Is there a way I can specify the type of prediction i want the vetiver endpoint to return?
Yes, you'll need to specify what kind of predictions you want when you create your API, not when you call the API. This is because when you create your API, you are specifying what code will be run when you call it later. So something like this:
library(vetiver)
library(plumber)
mtcars_glm <- glm(mpg ~ ., data = mtcars)
v <- vetiver_model(mtcars_glm, "cars_glm")
pr() |> vetiver_api(v, type = "response")
#> # Plumber router with 4 endpoints, 4 filters, and 1 sub-router.
#> # Use `pr_run()` on this object to start the API.
#> ├──[queryString]
#> ├──[body]
#> ├──[cookieParser]
#> ├──[sharedSecret]
#> ├──/logo
#> │ │ # Plumber static router serving from directory: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/vetiver
#> ├──/metadata (GET)
#> ├──/ping (GET)
#> ├──/predict (POST)
#> └──/prototype (GET)