Model playground

When defining a Verta Standard Model class, additional methods can be provided to populate the web UI's model playground.
The playground can be found on the endpoint page, after the registered model version is deployed.


This method should return a dict describing the model:
# optional: populates the model playground
def describe(self):
"""Return a description of the model."""
return {
"method": "predict",
"args": ",".join(X_train.columns),
"returns": "income_labels, confidence",
"description": """
Predicts whether a person has >50k annual income based on
census data.
"input_description": """
list[dict[str, Any]] -- Batch of census information, one
individual per element.
"output_description": """
list[int] -- Binary classification, with 1 representing the
prediction that the person earns more than 50k a year.
The following items must be provided—keys and values all being strs:
  • "method" – The name of the model method that will be used to serve requests. For almost all models, this will be "predict"; for models that support batch prediction, this may be "batch_predict".
  • "args" – The names of the arguments to the model's predict method. This doesn't need to match the actual signature of the method (which would just be a single variable), but instead can be a more symbolic representation of the argument; this guide's example uses the column names of the source DataFrame.
  • "returns" – The names of the values returned by the model's predict method. As with args, this doesn't need to match the actual signature of the method.
  • "description" – A plain text description of the model's behavior, background, and/or purpose.
  • "input_description" – A plain text description of the model's predict method's input.
  • "output_description" – A plain text description of the model's predict method's output.
description, input_description, and output_description do not currently support formatting (such as newlines or indentation), but otherwise there are no constraints on their contents; this guide's example includes type information, but details can be freely included or omitted as desired.


This method should return a sample input for the model that could be passed directly to its predict() function:
# optional: populates the model playground
def example(self):
"""Return example input JSON-serializable data."""
return [
"age": 44,
"capital-gain": 0,
"capital-loss": 0,
"hours-per-week": 40,
"workclass": "private",
"education": "hs-grad",
"relationship": None,
"occupation": "craft-repair",
"age": 37,
"capital-gain": 7298,
"capital-loss": 0,
"hours-per-week": 36,
"workclass": "local-gov",
"education": "some-college",
"relationship": "married",
"occupation": "tech-support",
This return value—just like predict()'s input value—must be a fully-JSON-serializable object such as a basic Python list or dict.


The endpoint just finished deploying, but none of the playground fields are being populated.

It may take a few minutes after an endpoint is deployed for the playground fields to be populated in the web UI.

Even after waiting, certain playground fields are not being populated.

Please ensure that describe() and example() do not contain any errors, and that the value being returned by example() is fully JSON-serializable (i.e. can be passed to Python's json.dumps() without issue). Additionally, one can check the endpoint's running logs for any raised exceptions from GET /describe and/or GET /example.