code: def __init__(
      self,
      # ModelLibrary arguments
      settings: Optional[Union[Dict, LibrarySettings]] = None,
      assetsmanager_settings: Optional[dict] = None,
      configuration: Optional[
          Dict[str, Union[Dict[str, Any], ModelConfiguration]]
      ] = None,
      models: Optional[LibraryModelsType] = None,
      required_models: Optional[
          Union[List[str], Dict[str, Any]]
      ] = None,
      # APIRouter arguments
      **kwargs,
  ) -> None:
      # add custom startup/shutdown events
      on_startup = kwargs.pop("on_startup", [])
      # on_startup.append(self._on_startup)
      kwargs["on_startup"] = on_startup
      on_shutdown = kwargs.pop("on_shutdown", [])
      on_shutdown.append(self._on_shutdown)
      kwargs["on_shutdown"] = on_shutdown
      super().__init__(**kwargs)
  
      self.lib = ModelLibrary(
          required_models=required_models,
          settings=settings,
          assetsmanager_settings=assetsmanager_settings,
          configuration=configuration,
          models=models,
      )
  
file_path: modelkit/modelkit/api.py
imports: import os
  from typing import Any, Dict, List, Optional, Union
  import fastapi
  from rich.console import Console
  from structlog import get_logger
  from modelkit.core.errors import ModelsNotFound
  from modelkit.core.library import LibrarySettings, ModelConfiguration, ModelLibrary
  from modelkit.core.model import AbstractModel, AsyncModel
  from modelkit.core.types import LibraryModelsType
label_desc: Use image node_id 1 to create a new ModelkitAPIRouter object from inherited base classes: fastapi with example: obj = ModelkitAPIRouter(settings, assetsmanager_settings, configuration, models, required_models)