Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

2.6 KB
Raw Blame
# kwant on a server, everything in one command:  docker compose up -d
#   kwnt     the app, UI on 127.0.0.1:8799 (KWNT_HOST_PORT to change; put HTTPS in front: see README "VPS in 5 minutes")
#            The released image (ghcr.io/alexsergivan/kwnt; KWNT_VERSION=0.7.6 to pin one), built here only if it can't be pulled
#   laya     picks which bot answers (model baked into the image; built here on the first start)
#   browser  the bots' private Chromium, so VM mode works without the Docker socket (built here too)
# Upgrade:  docker compose pull kwnt && docker compose up -d
# AI CLIs in the image, or kwnt from this checkout:  KWNT_CLIS=claude,codex,grok docker compose up -d --build
# Check what's missing:  docker compose exec kwnt kwnt doctor
services:
  laya:
    build:
      context: docker
      dockerfile: laya.Dockerfile
      args:
        LAYA_MODELS: english
    image: kwnt-laya:0.4.8
    restart: unless-stopped

  browser:
    build:
      context: docker
      dockerfile: browser.Dockerfile
    restart: unless-stopped
    init: true
    read_only: true
    tmpfs:
      - /tmp:rw,nosuid,size=512m
    cap_drop: [ALL]
    security_opt: ["no-new-privileges:true"]
    mem_limit: 1536m
    pids_limit: 512
    # CDP is full control of the browser: reachable by kwnt on this network only, never published.
    expose: ["9222"]
    environment:
      # Optional: send the browser's traffic through a proxy (socks5://host:port or http://host:port).
      # See docs/browser-proxy.md. No credentials: Chromium cannot sign in to SOCKS.
      KWNT_BROWSER_PROXY: ${KWNT_BROWSER_PROXY:-}
      KWNT_BROWSER_PROXY_BYPASS: ${KWNT_BROWSER_PROXY_BYPASS:-}

  kwnt:
    build:
      context: .
      dockerfile: docker/kwnt.Dockerfile
      args:
        KWNT_CLIS: ${KWNT_CLIS:-}
    image: ghcr.io/alexsergivan/kwnt:${KWNT_VERSION:-latest}
    restart: unless-stopped
    ports:
      - "127.0.0.1:${KWNT_HOST_PORT:-8799}:8799"
    environment:
      LAYA_URL: http://laya:8000
      KWNT_LAYA_MANAGED: "0"
      KWNT_BROWSER_CDP_URL: http://browser:9222
      # same value as the browser service, so `kwnt doctor` can check the proxy
      KWNT_BROWSER_PROXY: ${KWNT_BROWSER_PROXY:-}
      KWNT_BROWSER_PROXY_BYPASS: ${KWNT_BROWSER_PROXY_BYPASS:-}
      # Your HTTPS address, e.g. https://kwant.example.com (comma list)
      KWNT_ALLOWED_ORIGINS: ${KWNT_ALLOWED_ORIGINS:-}
    volumes:
      - kwnt-data:/data
      # CLI sign-ins (~/.claude, ~/.codex, ~/.grok) survive rebuilds
      - kwnt-home:/home/kwnt
    depends_on:
      laya:
        condition: service_started
      browser:
        condition: service_started

volumes:
  kwnt-data:
  kwnt-home: