{{define "install"}}{{if not .Site}} {{end}}{{t "install.title"}} · llmgw {{template "sitestyle" .}} {{if not .Site}}{{end}}
llmgw

{{t "install.hero.eyebrow" .Recorded}}

{{th "install.hero.title"}}

{{t "install.hero.lede"}}

3{{t "install.hero.machines"}} 4{{t "install.hero.steps"}} {{t "install.hero.time_value"}}{{t "install.hero.time"}} 0{{t "install.hero.hidden"}}
  1. 0{{t "install.nav.before"}}
  2. 1{{t "install.nav.binary"}}
  3. 2{{t "install.nav.setup"}}
  4. 3{{t "install.nav.check"}}
  5. 4{{t "install.nav.use"}}
  6. →{{t "install.nav.next"}}

{{t "install.step" "0"}}

{{t "install.before.title"}}

{{t "install.before.intro"}}

{{t "install.req.machines"}}{{t "install.req.machines.text"}}
{{t "install.req.system"}}{{t "install.req.system.text"}}
{{t "install.req.size"}}{{t "install.req.size.text"}}
{{t "install.req.clock"}}{{t "install.req.clock.text"}}
{{t "install.req.network"}}{{th "install.req.network.text"}}
{{t "install.req.access"}}{{th "install.req.access.text"}}
{{t "install.req.names"}}{{t "install.req.names.text"}}
{{t "install.req.gpus"}}{{t "install.req.gpus.text"}}

{{th "install.req.memory_note"}}

{{t "install.before.commands"}}

grep PRETTY_NAME /etc/os-release; uname -m; nproc; free -h | grep Mem; df -h /
timedatectl | grep synchronized; curl -sI https://gitea.mynodes.xyz | head -1
ping -c1 <second machine>; ping -c1 <third machine>
sudo -v && echo "sudo works"
sudo hostnamectl set-hostname llm-1          # a name of its own, on each machine
{{template "tty" (.Cast "0-prereq")}}

{{t "install.step" "1"}}

{{t "install.binary.title"}}

{{t "install.binary.intro"}}

{{th "install.binary.text"}}

VERSION=$(curl -fsSL https://gitea.mynodes.xyz/api/v1/repos/ilker/llmgw/releases/latest \
  | grep -o '"tag_name":"[^"]*"' | cut -d'"' -f4)
U=https://gitea.mynodes.xyz/ilker/llmgw/releases/download/$VERSION
curl -fsSLO $U/llmgw-$VERSION-linux-amd64          # -linux-arm64 on ARM
curl -fsSL $U/checksums.txt | sha256sum -c --ignore-missing
sudo install -m0755 llmgw-$VERSION-linux-amd64 /usr/local/bin/llmgw
llmgw --version
{{template "tty" (.Cast "1-binary")}}

{{t "install.step" "2"}}

{{t "install.setup.title"}}

{{t "install.setup.intro"}}

{{t "install.setup.text"}}

sudo llmgw

{{t "install.setup.keys"}}

{{template "still" (.Shot "setup-start" "2.1")}}

{{th "install.sc1.text"}}

{{template "still" (.Shot "setup-choices" "2.2")}}

{{th "install.sc2.text"}}

{{template "still" (.Shot "setup-admin" "2.3")}}

{{th "install.sc3.text"}}

{{template "still" (.Shot "setup-machines" "2.4")}}

{{th "install.sc4.text"}}

{{template "still" (.Shot "setup-checks" "2.5")}}

{{th "install.sc5.text"}}

{{template "still" (.Shot "setup-plan" "2.6")}}

{{th "install.sc6.text"}}

{{template "still" (.Shot "setup-install" "2.7")}}

{{th "install.sc7.text"}}

{{template "still" (.Shot "setup-done" "2.8")}}

{{th "install.sc8.text"}}

{{t "install.setup.whole"}}

{{template "tty" (.Cast "2-setup")}}

{{t "install.setup.script.title"}}

{{t "install.setup.script.intro"}}

sudo --preserve-env=SSH_AUTH_SOCK llmgw server init \
    --admin you@example.com \
    --patroni <user>@<second machine> \
    --patroni <user>@<third machine> \
    --standbys

sudo llmgw server init --admin you@example.com       # one machine

{{t "install.step" "3"}}

{{t "install.check.title"}}

{{t "install.check.intro"}}

{{th "install.check.text"}}

sudo llmgw status
sudo llmgw                                       # the console
{{template "tty" (.Cast "3-check")}}
{{t
{{t "install.shot.login"}}
{{t
{{t "install.shot.admin"}}

{{t "install.step" "4"}}

{{t "install.use.title"}}

{{t "install.use.intro"}}

{{th "install.use.text"}}

export LLMGW_API_KEY=sk-llmgw-…                   # from the account page
curl http://<first machine>:8080/v1/chat/completions \
  -H "Authorization: Bearer $LLMGW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen-0.5b", "messages": [{"role": "user", "content": "hello"}]}'
{{t
{{t "install.shot.newkey"}}
{{t
{{t "install.shot.chat"}}
{{template "tty" (.Cast "4-request")}}

{{t "install.next.title"}}

{{t "install.next.intro"}}

{{t "install.next.nodes.title"}}

{{th "install.next.nodes.text"}}

{{t "install.next.models.title"}}

{{th "install.next.models.text"}}

{{t "install.next.people.title"}}

{{th "install.next.people.text"}}

{{t "install.next.https.title"}}

{{th "install.next.https.text" .AboutURL}}

{{t "install.trouble.title"}}

{{t "install.trouble.intro"}}

{{t "install.trouble.see"}}{{t "install.trouble.do"}}
{{th "install.trouble.starter.see"}}{{th "install.trouble.starter.do"}}
{{th "install.trouble.judge.see"}}{{th "install.trouble.judge.do"}}
{{th "install.trouble.ssh.see"}}{{th "install.trouble.ssh.do"}}
{{th "install.trouble.check.see"}}{{th "install.trouble.check.do"}}
{{th "install.trouble.node.see"}}{{th "install.trouble.node.do"}}
{{if not .Site}}{{end}}{{end}} {{define "tty"}}
ilker@llm-1 · {{.Cols}}×{{.Rows}}
{{.Poster}}
{{t (print "install.cast." .Name)}}
{{end}} {{define "still"}}
sudo llmgw · {{.Label}}
{{.Screen}}
{{end}}