def get_service(model_name: str, **config: Unpack[ServiceConfig]) -> Service[t.Any]:
    """
    Get a BentoML service for the catboost model given by name.

    Args:
        model_name (``str``):
            The name of the model to get the service for.
        **config (``Unpack[ServiceConfig]``):
            Configuration options for the service.
    Returns:
        A BentoML service instance that wraps the CatBoost model.
    Example:

    .. code-block:: python

        import bentoml

        service = bentoml.catboost.get_service("my_catboost_model")
    """

    @bentoml.service(**config)
    class CatBoostService:
        bento_model = bentoml.models.get(model_name)

        def __init__(self) -> None:
            self.model = load_model(self.bento_model)
            self.predict_params = {"task_type": "CPU"}

            # check for resources
            available_gpus = os.getenv("CUDA_VISIBLE_DEVICES", "")
            if available_gpus not in ("", "-1"):
                self.predict_params["task_type"] = "GPU"
            else:
                nthreads = os.getenv("OMP_NUM_THREADS")
                if nthreads is not None and nthreads != "":
                    nthreads = max(int(nthreads), 1)
                else:
                    nthreads = -1
                self.predict_params["thread_count"] = nthreads

        @bentoml.api
        def predict(self, input_data: np.ndarray) -> np.ndarray:
            rv = self.model.predict(data=cb.Pool(input_data), **self.predict_params)
            return np.asarray(rv)  # type: ignore (incomplete np types)

    return CatBoostService
Get a BentoML service for the catboost model given by name.

Args:
model_name (``str``):
The name of the model to get the service for.
**config (``Unpack[ServiceConfig]``):
Configuration options for the service.
Returns:
A BentoML service instance that wraps the CatBoost model.
Example:

.. code-block:: python

import bentoml

service = bentoml.catboost.get_service("my_catboost_model")
src/_bentoml_impl/frameworks/catboost.py