INNER CODE UNIT · Python
create_handler_from_config
cubist38/mlx-openai-server · app/server.py:226
def create_handler_from_config(model_cfg: ModelEntryConfig) -> Any:
"""Instantiate the correct handler for a single model entry.
This factory function mirrors the type-based dispatch in
``create_lifespan`` but works with the per-model
``ModelEntryConfig`` dataclass used in YAML configs.
Parameters
----------
model_cfg : ModelEntryConfig
Configuration for a single model.
Returns
-------
Any
An initialized (but not yet queue-started) handler instance.
Raises