microsoft/autogen · error · ValueError

No transformer found for model family '{model_family}'

Error message

No transformer found for model family '{model_family}'

What it means

Thrown by the message-transformation registry when no transformer is registered for the resolved model family. After optionally re-resolving the family from the model name (for unknown/non-enumerated families), the registry looks up MESSAGE_TRANSFORMERS[api][model_family] and, finding nothing, raises as a defensive invariant — under normal operation a default should always exist.

Source

Thrown at python/packages/autogen-ext/src/autogen_ext/models/openai/_transformation/registry.py:128

    This is a thin wrapper around `MESSAGE_TRANSFORMERS.get(...)`, but serves as
    an abstraction layer to allow future enhancements such as:

    - Providing fallback transformers for unknown model families
    - Injecting mock transformers during testing
    - Adding logging, metrics, or versioning later

    Keeping this as a function (instead of direct dict access) improves long-term flexibility.
    """

    if model_family not in set(get_args(ModelFamily.ANY)) or model_family == ModelFamily.UNKNOWN:
        # fallback to finding the best matching model family
        model_family = _find_model_family(api, model)

    transformer = MESSAGE_TRANSFORMERS.get(api, {}).get(model_family, {})

    if not transformer:
        # Just in case, we should never reach here
        raise ValueError(f"No transformer found for model family '{model_family}'")

    return transformer

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Upgrade autogen-ext to a version where the model family has a registered transformer
  2. If invoking the registry directly, use the documented api identifiers (e.g. 'chat') and a supported ModelFamily
  3. For custom model families, register a transformer in MESSAGE_TRANSFORMERS or map your model to a supported family via model_info['family']

Example fix

# before
model_info = {"family": "my-custom-family", ...}  # no transformer registered

# after
model_info = {"family": ModelFamily.UNKNOWN, ...}  # falls back to default transformer resolution
Defensive patterns

Strategy: validation

Validate before calling

from autogen_ext.models.openai._transformation.registry import MESSAGE_TRANSFORMERS

family = model_info.get("family")
if family not in {f for fams in MESSAGE_TRANSFORMERS.values() for f in fams}:
    model_info["family"] = ModelFamily.UNKNOWN  # use default resolution

Type guard

def has_transformer(api: str, family) -> bool:
    return family in MESSAGE_TRANSFORMERS.get(api, {})

Try / catch

try:
    result = await client.create(messages)
except ValueError as e:
    if "No transformer found" in str(e):
        raise RuntimeError(f"unsupported model family {family!r}; update autogen-ext") from e
    raise

Prevention

When it happens

Trigger: Calling with an api value that has no transformer map for any family, or a ModelFamily value that resolves (or is passed) to a family with no registered transformer for that API. Realistically only reachable if the registry maps are extended/incomplete or an unexpected api string is supplied by custom client code.

Common situations: Custom code calling the transformation registry directly with a nonstandard api identifier; version skew where a new ModelFamily member was added to the enum but not to MESSAGE_TRANSFORMERS; monkey-patched or trimmed registries in downstream forks.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/6961045757d7b09b. Report an issue: GitHub.