Skip to content

Commit 4ea31c1

Browse files
authored
Merge pull request #3253 from EmreCelenli/docs/mlx-compatibility
docs: document mlx-lm backend for Apple Silicon and known gotchas
2 parents 4e0cba7 + 3ae9225 commit 4ea31c1

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

docs/local-openai-compatible-providers.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ export OPENAI_API_KEY="local-dev-token"
9797
claw --model "Qwen/Qwen2.5-Coder-7B-Instruct" prompt "Reply exactly HELLO_WORLD_123"
9898
```
9999

100+
## mlx-lm (Apple Silicon)
101+
102+
On Apple Silicon, [mlx-lm](https://github.com/ml-explore/mlx-lm) gives meaningfully faster inference than llama.cpp-based backends for models under roughly 14B parameters.
103+
104+
Install and start the server:
105+
106+
```bash
107+
pipx install mlx-lm
108+
mlx_lm.server --model mlx-community/Qwen2.5-Coder-7B-Instruct-4bit --port 8080
109+
```
110+
111+
Then route Claw to it:
112+
113+
```bash
114+
export OPENAI_BASE_URL="http://127.0.0.1:8080/v1"
115+
export OPENAI_API_KEY="local-dev-token"
116+
claw --model "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit" prompt "Reply exactly HELLO_WORLD_123"
117+
```
118+
119+
mlx-lm serves models under their full Hugging Face repo ID. Use the exact `id` field from `curl $OPENAI_BASE_URL/models` for `--model`. A bare name like `qwen2.5-coder-7b-instruct` will fail model resolution before the request ever reaches the server.
120+
100121
## Local skills install from disk
101122

102123
Skills are discovered from Claw skill roots such as `.claw/skills/` in a workspace and `~/.claw/skills/` for user-level installs. Legacy `.codex/skills/` roots may also be scanned for compatibility, but new local Claw projects should prefer `.claw/skills/`.
@@ -149,3 +170,5 @@ Offline install checklist:
149170
| Plain prompt works but tools fail | Confirm the model/server supports OpenAI-compatible tool calls and response shapes. |
150171
| Skill says installed but `/skills <name>` fails | Check `/skills list` for the discovered name and source; verify provider credentials separately with `claw doctor`. |
151172
| A local docs/log file contains secrets | Redact it before using `@path` file context or attaching it to an issue. |
173+
| `404 Repository Not Found` from huggingface.co when running `claw` | The `--model` value isn't a full Hugging Face repo ID. Use the exact `id` field from `curl $OPENAI_BASE_URL/models`, not a bare model name. |
174+
| mlx-lm output includes a trailing `<|im_end|>`, or generation runs long | Unfixed mlx-lm bug ([#973](https://github.com/ml-explore/mlx-lm/issues/973), closed without a merge). Set `eos_token_id` in the cached `generation_config.json` (or `config.json`) to the real end-of-turn token. |

0 commit comments

Comments
 (0)