INNER CODE UNIT · Python
_model_entry_extras
cubist38/mlx-openai-server · app/main.py:136
def _model_entry_extras(m: ModelEntryConfig) -> list[tuple[str, object]]:
"""Return non-default per-model settings worth surfacing in the banner.
Only fields that differ from their dataclass default are included —
this keeps the banner quiet for minimal configs and lights up every
knob that was actually touched (parsers, tool choice, LoRA, draft
model, KV quant, on-demand, etc.).
"""
extras: list[tuple[str, object]] = []
if m.served_model_name and m.served_model_name != m.model_path:
extras.append(("served_model_name", m.served_model_name))
if m.context_length is not None:
extras.append(("context_length", m.context_length))
if m.enable_auto_tool_choice:
extras.append(("auto_tool_choice", True))
if m.tool_call_parser:
extras.append(("tool_call_parser", m.tool_call_parser))