---
title: "The PR you would have opened yourself"
description: "mlx-lm contributors can use a Skill and a separate test harness to port language models from transformers, with the goal of making new architectures available shortly after their upstream implementations land. The work addresses rising agent-generated pull-request volume and the difficulty of preserving implicit codebase conventions, user contracts, and performance-sensitive behavior that agents may not understand. Given a conversion prompt, the Skill sets up environments, finds model variants and checkpoints, reads transformers modeling code, writes an MLX implementation, and iterates through tests including dtype checks, generation examples, numerical comparisons, and per-layer comparisons. The resulting pull requests disclose agent assistance and include detailed verification data, while contributors remain responsible for reviewing and accepting the results. Current limitations include shared-utility refactors, vision-language models, quantized uploads, and thinking-specific tests."
---

# The PR you would have opened yourself

[Hugging Face](https://yomu.fyi/company/hugging-face) · Pedro Cuenca, Awni Hannun · Apr 16, 2026

**Type:** Announcement

## Summary

mlx-lm contributors can use a Skill and a separate test harness to port language models from transformers, with the goal of making new architectures available shortly after their upstream implementations land. The work addresses rising agent-generated pull-request volume and the difficulty of preserving implicit codebase conventions, user contracts, and performance-sensitive behavior that agents may not understand. Given a conversion prompt, the Skill sets up environments, finds model variants and checkpoints, reads transformers modeling code, writes an MLX implementation, and iterates through tests including dtype checks, generation examples, numerical comparisons, and per-layer comparisons. The resulting pull requests disclose agent assistance and include detailed verification data, while contributors remain responsible for reviewing and accepting the results. Current limitations include shared-utility refactors, vision-language models, quantized uploads, and thinking-specific tests.

## Context

Code agents have increased pull-request volume, while maintainers still need to evaluate design direction, implicit contracts, side effects, bugs, and performance. The work focuses on mlx-lm because its model ports commonly follow transformers implementations, which provide a source of truth and naturally limit the conversion task.

## Approach / What changed

A Skill guides an agent through porting transformers models to mlx-lm: it creates a virtual environment, discovers model variants, downloads checkpoints, reads modeling code, implements the MLX version, and runs iterative checks. It verifies details such as RoPE configurations and dtype metadata, performs numerical and per-layer comparisons, and generates a manifest for a separate non-agentic test harness. Pull requests disclose agent assistance and include architectural, generation, dtype, and comparison reports.

## Takeaways

- The Skill compares MLX and transformers implementations at the per-layer level to help locate numerical divergence, alongside generation examples and dtype verification.
- The separate test harness is designed to provide reproducible verification without relying on an LLM’s judgments or susceptibility to hallucination and complacency.
- The current workflow supports LLMs in mlx-lm but does not yet cover VLMs, shared-utility refactors, quantized model uploads, or thinking-specific validation.

**Tags:** [LLMs](https://yomu.fyi/topic/llm), [Machine Learning](https://yomu.fyi/topic/machine-learning), [Open Source](https://yomu.fyi/topic/open-source), [Testing](https://yomu.fyi/topic/testing)

- Source: [Hugging Face](https://huggingface.co/blog/transformers-to-mlx)
- Source URL: https://huggingface.co/blog/transformers-to-mlx
- Ingested by Yomu: 2026-08-29T01:47:53.906Z

[Read original post](https://huggingface.co/blog/transformers-to-mlx)
