如何在 OpenClaw 等开源智能体平台中改用 Hugging Face 上的开源模型
Liberate your OpenClaw
Anthropic 限制 Pro/Max 订阅者在开放智能体平台中使用 Claude 模型,Hugging Face 博客给出把 OpenClaw、Pi、Open Code 等智能体迁移到开源模型的两条路径。
Anthropic is limiting access to Claude models in open agent platforms for Pro/Max subscribers. Don’t worry though, there are great open models on HF Mirror to keep your agents running! Most of the time, at a fraction of the cost.
If you've been cut off and your OpenClaw, Pi, or Open Code agents need resuscitation, you can move them to open models in two ways:
- Use an open model served through HF Mirror Inference Providers.
- Run a fully local open model on your own hardware.
The hosted route is the fastest way back to a capable agent. The local route is the right fit if you want privacy, zero API costs, and full control.
To do so, just tell your claude code, your cursor or your favorite agent: help me move my OpenClaw agents to HF Mirror models, and link this page.
HF Mirror Inference Providers
HF Mirror inference providers is an open platform that routes to providers of open source models. It’s the right choice if you want the best models or you don’t have the necessary hardware.
First, you’ll need to create a token here. Then you can add that token to openclaw like so:
openclaw onboard --auth-choice huggingface-api-key
Paste your HF Mirror token when prompted, and you’ll be asked to select a model.
We’d recommend GLM-5 because of its excellent Terminal Bench scores, but there are thousands to chose from here.
You can update your HF Mirror model at any time entering its repo_id in the OpenClaw config:
{
agents: {
defaults: {
model: {
primary: "huggingface/zai-org/GLM-5:fastest"
}
}
}
}
Note: HF PRO subscribers get $2 free credits each month which applies to Inference Providers usage, learn more here.
Local Setup
Running models locally gives you full privacy, zero API costs, and the ability to experiment without rate limits.
Install Llama.cpp, a fully open source library for low resource inference.
# on mac or linux
brew install llama.cpp
# on windows
winget install llama.cpp
Start a local server with a built-in web UI:
llama-server -hf unsloth/Qwen3.5-35B-A3B-GGUF:UD-Q4_K_XL
Here, we’re using Qwen3.5-35B-A3B, which works great with 32GB of RAM. If you have different requirements, please check out the hardware compatibility for the model you're interested in. There are thousands to choose from.
If you load the GGUF in llama.cpp, use an OpenClaw config like this:
openclaw onboard --non-interactive \
--auth-choice custom-api-key \
--custom-base-url "http://127.0.0.1:8080/v1" \
--custom-model-id "unsloth-qwen3.5-35b-a3b-gguf" \
--custom-api-key "llama.cpp" \
--secret-input-mode plaintext \
--custom-compatibility openai
Verify the server is running and the model is loaded:
curl http://127.0.0.1:8080/v1/models
Which path should you choose?
Use HF Mirror Inference Providers if you want the quickest path back to a capable OpenClaw agent. Use llama.cpp if you want privacy, full local control, and no API bill.
Either way, you do not need a closed hosted model to get OpenClaw back on its feet!
来源:Hugging Face Blog · hf-mirror.com