Spaces:
Running
Running
Merge pull request #1 from anurag162008/codex/update-changelog-and-readme.md
Browse filesdocs: update README and CHANGELOG for multi-provider key rotator & runtime defaults
- CHANGELOG.md +19 -0
- README.md +63 -4
CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
| 2 |
|
| 3 |
All notable changes to this project will be documented in this file.
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
## [1.4.0] - 2026-04-25
|
| 6 |
|
| 7 |
### Added
|
|
|
|
| 2 |
|
| 3 |
All notable changes to this project will be documented in this file.
|
| 4 |
|
| 5 |
+
## [1.5.0] - 2026-05-10
|
| 6 |
+
|
| 7 |
+
### Added
|
| 8 |
+
|
| 9 |
+
- **Universal multi-provider API key rotation** β replaced the NVIDIA-only rotator with `multi-provider-key-rotator.cjs`, supporting round-robin key pools such as `ANTHROPIC_API_KEYS`, `OPENAI_API_KEYS`, `GEMINI_API_KEYS`, `OPENROUTER_API_KEYS`, `GROQ_API_KEYS`, `NVIDIA_API_KEYS`, and other provider-specific plural variables
|
| 10 |
+
- **Multi-provider setup documentation** β expanded `.env.example` and README guidance so users can keep one default `LLM_MODEL` while enabling extra providers with native provider key secrets
|
| 11 |
+
- **Runtime plugin controls** β documented `BROWSER_PLUGIN_MODE`, `ACP_PLUGIN_MODE`, OpenClaw log-level overrides, and `GATEWAY_VERBOSE` for advanced deployments
|
| 12 |
+
|
| 13 |
+
### Changed
|
| 14 |
+
|
| 15 |
+
- **Key rotation generalized** β HuggingClaw now preloads one provider-aware rotator that patches `fetch`, `http`, and `https` requests for all supported provider hostnames instead of only handling NVIDIA traffic
|
| 16 |
+
- **Startup defaults tuned for HF Spaces** β Spaces default to compact warning-level console logs and disabled browser/ACP plugins, while local runs keep friendlier auto/pretty defaults
|
| 17 |
+
- **Playwright dependency isolation** β browser support dependencies are installed in a sidecar `browser-deps` directory so the bundled OpenClaw app dependency tree is not mutated
|
| 18 |
+
|
| 19 |
+
### Fixed
|
| 20 |
+
|
| 21 |
+
- **Provider key fallback consistency** β provider-specific rotation pools now fall back to the singular provider key and then `LLM_API_KEY`, making single-key and multi-key setups behave consistently
|
| 22 |
+
- **Documentation drift** β README now matches the latest `.env.example`, Docker preload, and startup behavior for key rotation, multiple providers, and optional plugin controls
|
| 23 |
+
|
| 24 |
## [1.4.0] - 2026-04-25
|
| 25 |
|
| 26 |
### Added
|
README.md
CHANGED
|
@@ -36,16 +36,17 @@ secrets:
|
|
| 36 |
- [π₯ Video Tutorial](#-video-tutorial)
|
| 37 |
- [π Quick Start](#-quick-start)
|
| 38 |
- [π± Telegram Setup *(Optional)*](#-telegram-setup-optional)
|
| 39 |
-
- [π Cloudflare Proxy
|
| 40 |
- [π¬ WhatsApp Setup *(Optional)*](#-whatsapp-setup-optional)
|
| 41 |
- [πΎ Workspace Backup *(Optional)*](#-workspace-backup-optional)
|
| 42 |
- [π Webhooks *(Optional)*](#-webhooks-optional)
|
| 43 |
-
- [π Security & Advanced *(Optional)*](#-security-
|
| 44 |
- [π€ LLM Providers](#-llm-providers)
|
|
|
|
| 45 |
- [π» Local Development](#-local-development)
|
| 46 |
- [π CLI Access](#-cli-access)
|
| 47 |
- [ποΈ Architecture](#-architecture)
|
| 48 |
-
- [π Staying Alive](#-staying-alive)
|
| 49 |
- [π Troubleshooting](#-troubleshooting)
|
| 50 |
- [π Links](#-links)
|
| 51 |
- [π€ Contributing](#-contributing)
|
|
@@ -54,6 +55,8 @@ secrets:
|
|
| 54 |
## β¨ Features
|
| 55 |
|
| 56 |
- π **Any LLM:** Use Claude, OpenAI GPT, Google Gemini, Grok, DeepSeek, Qwen, and 40+ providers (set `LLM_API_KEY` and `LLM_MODEL` accordingly).
|
|
|
|
|
|
|
| 57 |
- β‘ **Zero Config:** Duplicate this Space and set **just three** secrets (LLM_API_KEY, LLM_MODEL, GATEWAY_TOKEN) β no other setup needed.
|
| 58 |
- π³ **Fast Builds:** Uses a pre-built OpenClaw Docker image to deploy in minutes.
|
| 59 |
- π **Cloudflare Outbound Proxy:** HuggingClaw can automatically provision a Cloudflare Worker proxy for blocked outbound traffic such as Telegram API requests.
|
|
@@ -225,6 +228,7 @@ Register a custom endpoint at startup without modifying the CLI.
|
|
| 225 |
| `LLM_MODEL` | Must match `{CUSTOM_PROVIDER_NAME}/{CUSTOM_MODEL_ID}` | **Required** |
|
| 226 |
| `CUSTOM_API_KEY` | Provider-specific key | `LLM_API_KEY` |
|
| 227 |
| `CUSTOM_CONTEXT_WINDOW` | Context limit | `128000` |
|
|
|
|
| 228 |
|
| 229 |
> [!TIP]
|
| 230 |
> `CUSTOM_PROVIDER_NAME` cannot override built-in providers (openai, anthropic, etc.).
|
|
@@ -238,6 +242,58 @@ CUSTOM_MODEL_ID=zai-org/GLM-5.1-FP8
|
|
| 238 |
LLM_MODEL=modal/zai-org/GLM-5.1-FP8
|
| 239 |
```
|
| 240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
## π» Local Development
|
| 242 |
|
| 243 |
```bash
|
|
@@ -284,6 +340,7 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
|
|
| 284 |
- **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
|
| 285 |
- **Sync Engine**: Python background process managing HF Dataset persistence.
|
| 286 |
- **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
|
|
|
|
| 287 |
|
| 288 |
**Startup sequence:**
|
| 289 |
|
|
@@ -298,7 +355,7 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
|
|
| 298 |
## π Troubleshooting
|
| 299 |
|
| 300 |
- **Missing secrets:** Ensure `LLM_API_KEY`, `LLM_MODEL`, and `GATEWAY_TOKEN` are set in your Space **Settings β Secrets**.
|
| 301 |
-
- **Telegram bot issues:** Verify your `TELEGRAM_BOT_TOKEN`.
|
| 302 |
- **Backup restore failing:** Make sure `HF_TOKEN` is valid and has write access to your HF account dataset. Set `HF_USERNAME` only if auto-detection is not available in your environment.
|
| 303 |
- **Space keeps sleeping:** Add `CLOUDFLARE_WORKERS_TOKEN` as a Space secret to enable automatic keep-awake monitoring via Cloudflare Workers.
|
| 304 |
- **Auth errors / proxy:** If you see reverse-proxy auth errors, add the logged IPs under `TRUSTED_PROXIES` (from logs `remote=x.x.x.x`).
|
|
@@ -306,6 +363,8 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
|
|
| 306 |
- **WhatsApp lost its session after restart:** Make sure `HF_TOKEN` is configured so the hidden session backup can be restored on boot.
|
| 307 |
- **UI blocked (CORS):** Set `ALLOWED_ORIGINS=https://your-space-name.hf.space`.
|
| 308 |
- **Version mismatches:** Pin a specific OpenClaw build with the `OPENCLAW_VERSION` Variable in HF Spaces, or `--build-arg OPENCLAW_VERSION=...` locally.
|
|
|
|
|
|
|
| 309 |
|
| 310 |
## π More Projects
|
| 311 |
|
|
|
|
| 36 |
- [π₯ Video Tutorial](#-video-tutorial)
|
| 37 |
- [π Quick Start](#-quick-start)
|
| 38 |
- [π± Telegram Setup *(Optional)*](#-telegram-setup-optional)
|
| 39 |
+
- [π Cloudflare Proxy](#-cloudflare-proxy-setup)
|
| 40 |
- [π¬ WhatsApp Setup *(Optional)*](#-whatsapp-setup-optional)
|
| 41 |
- [πΎ Workspace Backup *(Optional)*](#-workspace-backup-optional)
|
| 42 |
- [π Webhooks *(Optional)*](#-webhooks-optional)
|
| 43 |
+
- [π Security & Advanced *(Optional)*](#-security-advanced-optional)
|
| 44 |
- [π€ LLM Providers](#-llm-providers)
|
| 45 |
+
- [π API Key Rotation & Multi-Provider Mode](#-api-key-rotation-multi-provider-mode)
|
| 46 |
- [π» Local Development](#-local-development)
|
| 47 |
- [π CLI Access](#-cli-access)
|
| 48 |
- [ποΈ Architecture](#-architecture)
|
| 49 |
+
- [π Staying Alive](#-staying-alive-recommended-on-free-hf-spaces)
|
| 50 |
- [π Troubleshooting](#-troubleshooting)
|
| 51 |
- [π Links](#-links)
|
| 52 |
- [π€ Contributing](#-contributing)
|
|
|
|
| 55 |
## β¨ Features
|
| 56 |
|
| 57 |
- π **Any LLM:** Use Claude, OpenAI GPT, Google Gemini, Grok, DeepSeek, Qwen, and 40+ providers (set `LLM_API_KEY` and `LLM_MODEL` accordingly).
|
| 58 |
+
- π **API Key Rotation:** Add comma-separated `*_API_KEYS` pools for supported providers and HuggingClaw rotates keys round-robin per provider at runtime.
|
| 59 |
+
- π **Multi-Provider Mode:** Keep one default `LLM_MODEL`, then expose extra providers in OpenClaw by adding their native provider keys directly as secrets.
|
| 60 |
- β‘ **Zero Config:** Duplicate this Space and set **just three** secrets (LLM_API_KEY, LLM_MODEL, GATEWAY_TOKEN) β no other setup needed.
|
| 61 |
- π³ **Fast Builds:** Uses a pre-built OpenClaw Docker image to deploy in minutes.
|
| 62 |
- π **Cloudflare Outbound Proxy:** HuggingClaw can automatically provision a Cloudflare Worker proxy for blocked outbound traffic such as Telegram API requests.
|
|
|
|
| 228 |
| `LLM_MODEL` | Must match `{CUSTOM_PROVIDER_NAME}/{CUSTOM_MODEL_ID}` | **Required** |
|
| 229 |
| `CUSTOM_API_KEY` | Provider-specific key | `LLM_API_KEY` |
|
| 230 |
| `CUSTOM_CONTEXT_WINDOW` | Context limit | `128000` |
|
| 231 |
+
| `CUSTOM_MAX_TOKENS` | Max output tokens for the registered model | `500` |
|
| 232 |
|
| 233 |
> [!TIP]
|
| 234 |
> `CUSTOM_PROVIDER_NAME` cannot override built-in providers (openai, anthropic, etc.).
|
|
|
|
| 242 |
LLM_MODEL=modal/zai-org/GLM-5.1-FP8
|
| 243 |
```
|
| 244 |
|
| 245 |
+
## π API Key Rotation & Multi-Provider Mode
|
| 246 |
+
|
| 247 |
+
HuggingClaw now includes a universal key rotator that patches OpenClaw's outbound `fetch`, `http`, and `https` calls. For each supported provider, you can provide a comma-separated key pool and HuggingClaw will rotate through those keys independently on every matching provider request.
|
| 248 |
+
|
| 249 |
+
### Per-provider key pools
|
| 250 |
+
|
| 251 |
+
Use the plural environment variable for the provider you want to rotate:
|
| 252 |
+
|
| 253 |
+
```bash
|
| 254 |
+
LLM_MODEL=anthropic/claude-sonnet-4-5
|
| 255 |
+
LLM_API_KEY=sk-ant-default
|
| 256 |
+
ANTHROPIC_API_KEYS=sk-ant-key1,sk-ant-key2,sk-ant-key3
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
Key lookup order is:
|
| 260 |
+
|
| 261 |
+
1. Provider-specific plural pool, for example `ANTHROPIC_API_KEYS` or `OPENAI_API_KEYS`.
|
| 262 |
+
2. Provider-specific singular key, for example `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`.
|
| 263 |
+
3. `LLM_API_KEY` as the final fallback.
|
| 264 |
+
|
| 265 |
+
Common rotation variables include `ANTHROPIC_API_KEYS`, `OPENAI_API_KEYS`, `GEMINI_API_KEYS`, `DEEPSEEK_API_KEYS`, `OPENROUTER_API_KEYS`, `OPENCODE_API_KEYS`, `ZAI_API_KEYS`, `MOONSHOT_API_KEYS`, `MINIMAX_API_KEYS`, `MISTRAL_API_KEYS`, `XAI_API_KEYS`, `NVIDIA_API_KEYS`, `GROQ_API_KEYS`, `COHERE_API_KEYS`, `TOGETHER_API_KEYS`, `CEREBRAS_API_KEYS`, and `HUGGINGFACE_HUB_TOKENS`. See `.env.example` for the full commented list.
|
| 266 |
+
|
| 267 |
+
### Enable multiple providers at once
|
| 268 |
+
|
| 269 |
+
`LLM_MODEL` still controls the default model. To make additional providers available in the Control UI, add their native API-key secrets directly:
|
| 270 |
+
|
| 271 |
+
```bash
|
| 272 |
+
LLM_MODEL=anthropic/claude-sonnet-4-6
|
| 273 |
+
LLM_API_KEY=sk-ant-default
|
| 274 |
+
|
| 275 |
+
OPENAI_API_KEY=sk-openai-extra
|
| 276 |
+
OPENAI_API_KEYS=sk-openai-key1,sk-openai-key2
|
| 277 |
+
|
| 278 |
+
GROQ_API_KEY=gsk-extra
|
| 279 |
+
GROQ_API_KEYS=gsk-key1,gsk-key2,gsk-key3
|
| 280 |
+
```
|
| 281 |
+
|
| 282 |
+
This lets you keep a safe default model while switching to other configured providers from OpenClaw when needed.
|
| 283 |
+
|
| 284 |
+
### Runtime and plugin controls
|
| 285 |
+
|
| 286 |
+
For Hugging Face Spaces, HuggingClaw defaults to quieter logs and disables optional browser/ACP plugins unless explicitly enabled. For local runs, those plugins remain in auto mode. Advanced users can override the defaults with:
|
| 287 |
+
|
| 288 |
+
| Variable | Default on HF Spaces | Default locally | Description |
|
| 289 |
+
| :--- | :--- | :--- | :--- |
|
| 290 |
+
| `OPENCLAW_CONSOLE_LOG_LEVEL` | `warn` | `info` | Console log verbosity |
|
| 291 |
+
| `OPENCLAW_FILE_LOG_LEVEL` | `info` | `info` | Gateway log-file verbosity |
|
| 292 |
+
| `OPENCLAW_CONSOLE_LOG_STYLE` | `compact` | `pretty` | Console log formatting |
|
| 293 |
+
| `BROWSER_PLUGIN_MODE` | `disabled` | `auto` | Set `enabled`, `disabled`, or `auto` for managed Chromium/browser tools |
|
| 294 |
+
| `ACP_PLUGIN_MODE` | `disabled` | `auto` | Set `enabled`, `disabled`, or `auto` for the ACP plugin |
|
| 295 |
+
| `GATEWAY_VERBOSE` | `0` | `0` | Set to `1` to add OpenClaw gateway verbose logging |
|
| 296 |
+
|
| 297 |
## π» Local Development
|
| 298 |
|
| 299 |
```bash
|
|
|
|
| 340 |
- **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
|
| 341 |
- **Sync Engine**: Python background process managing HF Dataset persistence.
|
| 342 |
- **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
|
| 343 |
+
- **Key Rotator**: Node preload that rotates provider API keys without changing OpenClaw code.
|
| 344 |
|
| 345 |
**Startup sequence:**
|
| 346 |
|
|
|
|
| 355 |
## π Troubleshooting
|
| 356 |
|
| 357 |
- **Missing secrets:** Ensure `LLM_API_KEY`, `LLM_MODEL`, and `GATEWAY_TOKEN` are set in your Space **Settings β Secrets**.
|
| 358 |
+
- **Telegram bot issues:** Verify your `TELEGRAM_BOT_TOKEN`. Add `CLOUDFLARE_WORKERS_TOKEN` or `CLOUDFLARE_PROXY_URL` if outbound Telegram API calls are blocked.
|
| 359 |
- **Backup restore failing:** Make sure `HF_TOKEN` is valid and has write access to your HF account dataset. Set `HF_USERNAME` only if auto-detection is not available in your environment.
|
| 360 |
- **Space keeps sleeping:** Add `CLOUDFLARE_WORKERS_TOKEN` as a Space secret to enable automatic keep-awake monitoring via Cloudflare Workers.
|
| 361 |
- **Auth errors / proxy:** If you see reverse-proxy auth errors, add the logged IPs under `TRUSTED_PROXIES` (from logs `remote=x.x.x.x`).
|
|
|
|
| 363 |
- **WhatsApp lost its session after restart:** Make sure `HF_TOKEN` is configured so the hidden session backup can be restored on boot.
|
| 364 |
- **UI blocked (CORS):** Set `ALLOWED_ORIGINS=https://your-space-name.hf.space`.
|
| 365 |
- **Version mismatches:** Pin a specific OpenClaw build with the `OPENCLAW_VERSION` Variable in HF Spaces, or `--build-arg OPENCLAW_VERSION=...` locally.
|
| 366 |
+
- **Rotation is not using the expected key:** Make sure you set the plural provider pool (for example `OPENAI_API_KEYS`) as a Space secret, separated only by commas; the rotator falls back to the singular provider key and then `LLM_API_KEY`.
|
| 367 |
+
- **Browser/ACP tools are missing on HF Spaces:** Set `BROWSER_PLUGIN_MODE=enabled` or `ACP_PLUGIN_MODE=enabled` if you intentionally need those optional plugins.
|
| 368 |
|
| 369 |
## π More Projects
|
| 370 |
|