    def __init__(
        self,
        name: str,
        *,
        runners: list[AbstractRunner] | None = None,
        models: list[Model] | None = None,
    ):
        """Service definition itself. Runners and models can be optionally pass into a ``bentoml.Service``.

        Args:
            name: name of the service
            runners: Optional list of runners to be used with this service.
            models: Optional list of ``bentoml.Model`` to be used with this service.
        """
        name = get_valid_service_name(name)

        # validate runners list contains Runner instances and runner names are unique
        if runners is not None:
            runner_names: t.Set[str] = set()
            for r in runners:
                assert isinstance(r, AbstractRunner), (
                    f'Service runners list can only contain bentoml.Runner instances, type "{type(r)}" found.'
                )

                if r.name in runner_names:
                    raise ValueError(
                        f"Found duplicate name `{r.name}` in service runners."
                    )
                runner_names.add(r.name)

        # validate models list contains Model instances
        if models is not None:
            for model in models:
                assert isinstance(model, Model), (
                    f'Service models list can only contain bentoml.Model instances, type "{type(model)}" found.'
                )

        self.__attrs_init__(  # type: ignore
            name=name,
            runners=[] if runners is None else runners,
            models=[] if models is None else models,
        )

        # Set import origin info - import_str can not be determined at this stage yet as
        # the variable name is only available in module vars after __init__ is returned
        # get_service_import_origin below will use the _caller_module for retriving the
        # correct import_str for this service
        caller_module = inspect.currentframe().f_back.f_globals["__name__"]
        self._caller_module = caller_module
        self._working_dir = os.getcwd()
Service definition itself. Runners and models can be optionally pass into a ``bentoml.Service``.

Args:
name: name of the service
runners: Optional list of runners to be used with this service.
models: Optional list of ``bentoml.Model`` to be used with this service.
src/bentoml/_internal/service/service.py