{
  "gateway": {
    "mode": "local",
    "bind": "lan",
    "port": 18789,
    "trustedProxies": [
      "127.0.0.1",
      "::1",
      "172.16.0.0/12",
      "10.0.0.0/8",
      "192.168.0.0/16",
      "100.64.0.0/10",
      "host.containers.internal"
    ],
    "controlUi": {
      "dangerouslyDisableDeviceAuth": false,
      "allowInsecureAuth": false,
      "allowedOrigins": [
        "https://{{ groups['all'][0] }}:18789",
        "https://{{ target_hostname }}:18789",
        "https://localhost:18789",
        "http://localhost:18789",
        "http://127.0.0.1:18789",
        "https://127.0.0.1:18789"
      ]
    },
    "auth": {
      "mode": "token",
      "token": "{{ openclaw_token }}"
    }
  },
  "browser": {
    "enabled": true,
    "defaultProfile": "openclaw",
    "headless": true,
    "noSandbox": true,
    "executablePath": "{{ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' if target_type == 'macmini' else '/usr/bin/chromium-browser' }}",
    "profiles": {
      "openclaw": {
        "cdpPort": 18800,
        "color": "#FF6B00"
      }
    }
  },
  "discovery": {
    "mdns": { "mode": "off" }
  },
  "models": {
    "providers": {
      "{{ llm_provider }}": {
        "baseUrl": "{{ 'http://localhost:4000' if target_type == 'macmini' else 'http://litellm:4000' }}",
        "apiKey": "{{ litellm_key }}",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "{{ llm_model }}",
            "name": "{{ llm_model }}",
            "reasoning": false,
{% if llm_provider == 'anthropic' %}
            "input": ["text", "image"],
            "contextWindow": 200000,
{% elif llm_provider == 'openai' %}
            "input": ["text", "image"],
            "contextWindow": 128000,
{% elif llm_provider == 'groq' %}
            "input": ["text"],
            "contextWindow": 131072,
{% else %}
            "input": ["text"],
            "contextWindow": 32768,
{% endif %}
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "channels": {
{% if telegram_bot_token | default('') != '' %}
    "telegram": { "botToken": "{{ telegram_bot_token }}", "dmPolicy": "allowlist", "allowFrom": [{% if telegram_users | default('') != '' %}{% for uid in telegram_users.split(',') %}"{{ uid | trim }}"{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}], "groupPolicy": "disabled" }
{% endif %}
  },
  "plugins": {
    "entries": {
{% if telegram_bot_token | default('') != '' %}
      "telegram": { "enabled": true },
{% endif %}
      "device-pair": { "enabled": false },
      "phone-control": { "enabled": false },
      "talk-voice": { "enabled": false }
    }
  },
  "skills": {
    "entries": {}
  },
  "tools": {
    "exec": {
      "security": "allowlist",
      "ask": "off"
    }
  },
  "commands": {
    "native": "auto",
    "nativeSkills": false,
    "restart": true
  },
  "agents": {
    "defaults": {
      "heartbeat": { "every": "5m" },
      "memorySearch": { "enabled": false },
      "model": {
        "primary": "{{ llm_provider }}/{{ llm_model }}"
      }
    },
    "list": [
      {
        "id": "jobhunt",
        "name": "JobCoach",
        "skills": {{ skills_allowlist.split(',') | map('trim') | list | to_json if skills_allowlist | default('') != '' else '[]' }}
      }
    ]
  }
}
