Download start.sh from AZILS/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/AZILS/openclaw/resolve/main/start.sh
- Command line
-
hf download hf://spaces/AZILS/openclaw/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/AZILS/openclaw/resolve/main/start.sh
1.34 kB
| set -e | |
| mkdir -p /root/.openclaw/sessions | |
| # 阶段 3: 执行启动前恢复 | |
| python3 /usr/local/bin/sync.py restore 2>/dev/null || true | |
| # 处理地址逻辑 | |
| CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g") | |
| # 阶段 2: 生成网关与模型配置(NVIDIA 版) | |
| cat > /root/.openclaw/openclaw.json <<EOF | |
| { | |
| "models": { | |
| "providers": { | |
| "nvidia": { | |
| "baseUrl": "$CLEAN_BASE", | |
| "apiKey": "$OPENAI_API_KEY", | |
| "api": "openai-completions", | |
| "models": [{ | |
| "id": "$MODEL", | |
| "name": "Kimi K2.5", | |
| "contextWindow": 256000 | |
| }] | |
| } | |
| } | |
| }, | |
| "agents": { | |
| "defaults": { | |
| "model": { | |
| "primary": "nvidia/$MODEL" | |
| } | |
| } | |
| }, | |
| "gateway": { | |
| "mode": "local", | |
| "bind": "lan", | |
| "port": $PORT, | |
| "trustedProxies": ["0.0.0.0/0", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"], | |
| "auth": { | |
| "mode": "token", | |
| "token": "$OPENCLAW_GATEWAY_TOKEN" | |
| }, | |
| "remote": { | |
| "token": "$OPENCLAW_GATEWAY_TOKEN" | |
| }, | |
| "controlUi": { | |
| "allowInsecureAuth": true, | |
| "dangerouslyAllowHostHeaderOriginFallback": true, | |
| "dangerouslyDisableDeviceAuth": true | |
| } | |
| } | |
| } | |
| EOF | |
| # 启动OpenClaw | |
| exec openclaw gateway run --port $PORT |