feat: add MLX backend for local Apple Silicon RL training#15
Open
alvin-chang wants to merge 3 commits intoaiming-lab:mainfrom
Open
feat: add MLX backend for local Apple Silicon RL training#15alvin-chang wants to merge 3 commits intoaiming-lab:mainfrom
alvin-chang wants to merge 3 commits intoaiming-lab:mainfrom
Conversation
- metaclaw/mlx_backend/: Tinker-compatible adapter package (ServiceClient, SamplingClient, LoraTrainingClient) backed by mlx and mlx-lm - metaclaw/sdk_backend.py: auto-detection falls through to MLX when no cloud credentials are set - metaclaw/api_server.py: guard run_llm when no llm_api_key configured; skip Tinker-specific sample_async kwargs for MLX - metaclaw/setup_wizard.py: add 'mlx' backend choice, skip API key prompts, validate mlx/mlx-lm install, default to HF MLX model ID - tests/: end-to-end smoke test + unit tests (16/16 passing)
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
ImKeTT
reviewed
Mar 16, 2026
Collaborator
|
Hi, @alvin-chang, thank you for contributing, the code looks generally good. Only minor changes are needed to be compatible with the style of the codebase :) |
Collaborator
|
Hi @alvin-chang, friendly ping here to make sure that you are still working on this PR |
Author
|
Let me remove those and resubmit the PR. |
Collaborator
|
Hi @alvin-chang are you still working on this PR? I saw there's one last comment remaining unresolved. Feel free to ping me once you finished all the changes |
Author
|
I thought I resolved all of them. Is it the METACLAW_RL_BACKEND? |
Collaborator
|
ah it's the INTEGRATION_NOTES.md. could you integrate it into a small section in readme? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Adds a local RL training backend using Apple MLX, so MetaClaw can run
the full train loop (inference → GRPO → weight update → hot-swap) on
Apple Silicon without any cloud API.
Changes (13 files, +1805 -39)
Testing
```bash
MLX_TEST_MODEL=mlx-community/Qwen2.5-1.5B-Instruct-4bit python3 tests/smoke_mlx_proxy.py
```
16/16 passing: auto-detection → model load → proxy startup → chat completions
with logprobs → sample collection → forward/backward + optim → hot-swap → post-swap inference."