Dmitry Beresnev commited on
Commit
4d85c26
·
1 Parent(s): c376717

add OpenAI compatibility for custom LLM server

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. supervisord.conf +1 -1
Dockerfile CHANGED
@@ -43,7 +43,7 @@ ENV OPENCLAW_ONBOARD_NONINTERACTIVE=0
43
  ENV OPENCLAW_CUSTOM_BASE_URL=https://researchengineering-agi.hf.space/v1
44
  ENV OPENCLAW_CUSTOM_MODEL_ID=deepseek-chat
45
  ENV OPENCLAW_CUSTOM_PROVIDER_ID=researchengineering-agi-hf-space
46
- ENV OPENCLAW_CUSTOM_COMPATIBILITY=anthropic
47
  ENV OPENCLAW_CUSTOM_API_KEY=
48
  ENV OPENCLAW_CUSTOM_API_KEY_OPTIONAL=1
49
  ENV OPENCLAW_CUSTOM_API_KEY_PLACEHOLDER=no-key
 
43
  ENV OPENCLAW_CUSTOM_BASE_URL=https://researchengineering-agi.hf.space/v1
44
  ENV OPENCLAW_CUSTOM_MODEL_ID=deepseek-chat
45
  ENV OPENCLAW_CUSTOM_PROVIDER_ID=researchengineering-agi-hf-space
46
+ ENV OPENCLAW_CUSTOM_COMPATIBILITY=openai
47
  ENV OPENCLAW_CUSTOM_API_KEY=
48
  ENV OPENCLAW_CUSTOM_API_KEY_OPTIONAL=1
49
  ENV OPENCLAW_CUSTOM_API_KEY_PLACEHOLDER=no-key
supervisord.conf CHANGED
@@ -5,7 +5,7 @@ pidfile=/tmp/supervisord.pid
5
  user=root
6
 
7
  [program:openclaw]
8
- command=/bin/sh -lc "GATEWAY_BIND=${OPENCLAW_GATEWAY_BIND:-lan}; AUTH_FILE_MAIN=/app/.openclaw/state/agents/main/agent/auth-profiles.json; API_KEY_RAW=${OPENCLAW_CUSTOM_API_KEY:-${CUSTOM_API_KEY:-}}; API_KEY=\"$API_KEY_RAW\"; if [ -z \"$API_KEY\" ] && [ \"${OPENCLAW_CUSTOM_API_KEY_OPTIONAL:-1}\" = \"1\" ]; then API_KEY=\"${OPENCLAW_CUSTOM_API_KEY_PLACEHOLDER:-no-key}\"; echo '[onboard] using placeholder custom API key'; fi; if [ \"${OPENCLAW_BOOTSTRAP_ONBOARD:-1}\" = \"1\" ] && [ ! -s \"$AUTH_FILE_MAIN\" ]; then if [ -n \"$API_KEY\" ]; then echo '[onboard] bootstrapping custom provider with API key'; openclaw onboard --non-interactive --mode local --auth-choice custom-api-key --custom-base-url \"${OPENCLAW_CUSTOM_BASE_URL}\" --custom-model-id \"${OPENCLAW_CUSTOM_MODEL_ID}\" --custom-provider-id \"${OPENCLAW_CUSTOM_PROVIDER_ID:-researchengineering-agi-hf-space}\" --custom-compatibility \"${OPENCLAW_CUSTOM_COMPATIBILITY:-anthropic}\" --custom-api-key \"$API_KEY\" --secret-input-mode plaintext --gateway-port 18789 --gateway-bind \"$GATEWAY_BIND\" --skip-skills --accept-risk || true; else echo '[onboard] skipped: no API key or placeholder'; fi; fi; python /app/scripts/bootstrap_gateway_token.py; exec openclaw gateway run --port 18789 --bind \"$GATEWAY_BIND\" --allow-unconfigured --dev"
9
  autorestart=true
10
  startsecs=5
11
  startretries=20
 
5
  user=root
6
 
7
  [program:openclaw]
8
+ command=/bin/sh -lc "GATEWAY_BIND=${OPENCLAW_GATEWAY_BIND:-lan}; AUTH_FILE_MAIN=/app/.openclaw/state/agents/main/agent/auth-profiles.json; ONBOARD_MARKER=/app/.openclaw/state/.onboard_signature; PROVIDER_ID=${OPENCLAW_CUSTOM_PROVIDER_ID:-researchengineering-agi-hf-space}; COMPAT=${OPENCLAW_CUSTOM_COMPATIBILITY:-openai}; DESIRED_SIG=${OPENCLAW_CUSTOM_BASE_URL}'|'${OPENCLAW_CUSTOM_MODEL_ID}'|'${PROVIDER_ID}'|'${COMPAT}; CURRENT_SIG=$(cat \"$ONBOARD_MARKER\" 2>/dev/null || true); API_KEY_RAW=${OPENCLAW_CUSTOM_API_KEY:-${CUSTOM_API_KEY:-}}; API_KEY=\"$API_KEY_RAW\"; if [ -z \"$API_KEY\" ] && [ \"${OPENCLAW_CUSTOM_API_KEY_OPTIONAL:-1}\" = \"1\" ]; then API_KEY=\"${OPENCLAW_CUSTOM_API_KEY_PLACEHOLDER:-no-key}\"; echo '[onboard] using placeholder custom API key'; fi; if [ \"${OPENCLAW_BOOTSTRAP_ONBOARD:-1}\" = \"1\" ] && { [ ! -s \"$AUTH_FILE_MAIN\" ] || [ \"$CURRENT_SIG\" != \"$DESIRED_SIG\" ]; }; then if [ -n \"$API_KEY\" ]; then echo \"[onboard] bootstrapping custom provider (sig=$DESIRED_SIG)\"; openclaw onboard --non-interactive --mode local --auth-choice custom-api-key --custom-base-url \"${OPENCLAW_CUSTOM_BASE_URL}\" --custom-model-id \"${OPENCLAW_CUSTOM_MODEL_ID}\" --custom-provider-id \"$PROVIDER_ID\" --custom-compatibility \"$COMPAT\" --custom-api-key \"$API_KEY\" --secret-input-mode plaintext --gateway-port 18789 --gateway-bind \"$GATEWAY_BIND\" --skip-skills --accept-risk || true; echo \"$DESIRED_SIG\" > \"$ONBOARD_MARKER\"; else echo '[onboard] skipped: no API key or placeholder'; fi; fi; python /app/scripts/bootstrap_gateway_token.py; exec openclaw gateway run --port 18789 --bind \"$GATEWAY_BIND\" --allow-unconfigured --dev"
9
  autorestart=true
10
  startsecs=5
11
  startretries=20