Skip to content

Conversation

@CalBlanco
Copy link

@CalBlanco CalBlanco commented Oct 18, 2025

Bug Fix:

Problem Description

The _call() function inside of langchain_community/llms/mlx_pipeline.py was creating a variable called formatter from the pipeline_kwargs argument. This variable was then being passed as a kwarg to mlx_lm.generate.

mlx_lm.generate does not take in a formatter argument and this was leading to failures in the generate call downstream.

Integration tests

I did not change any of these however I noticed these all failed due to the issue mentioned above (at least on my machine with all dependencies installed).

Unit Test

I have created a single unit test: tests/unit_tests/llms/test_mlx_pipeline_no_formatter_kwarg.py which utilizes the demo code as listed here

Fix

Simply removed the formatter variable from being created in the _call() function of the MLXPipeline class

Also removed the passing of the formatter variable from the generate() call at the end of the _call() function.

Misc Media

I found it interesting that the given integration tests for the module were also not passing so I thought I would include a reference photo / I know the main requirement is via unit testing.

  1. Integration test failures do to same bug
image
  1. Integration tests passing post fix
image

Aside

This is my first contribution to an open source project. So any feedback about my methodology, formatting, and documentation is super welcome. Thank you :)

…expected keyword argument "formatter"' error from MLXPipeline class
…ubsequent generate() call on lines 158 and 175 respectively.
@CalBlanco
Copy link
Author

Yo cuties ;) is there any way we can make this happen? Or any extra information I can provide to help in that?

@mdrxy mdrxy added the llms label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants