Skip to main content

Standalone Client Setup: helix-agent vs lightagent

Helix UI is the client you look at. The thing that actually reads files, runs commands, and calls models is the backend it connects to.

The desktop installer ships with a local backend, so a fresh install already works. Two situations fall outside that default:

  • The code and the compute live on a server, and you want to continue from a phone, another laptop, or a browser
  • Shell and LSP can move off your laptop, but model keys and chat history must stay with you

Helix covers these with two different artifacts. They are not two names for the same thing — get the distinction right before you install anything:

helix-agentlightagent
What it isA full backend: model calls, sessions, workspaces, and tools all run thereA remote data plane: tool execution only, no model credentials
Where it livesAn always-on server or dev boxThe machine that actually holds your code
Who connects to itAny Helix UI client (desktop / mobile / web)The desktop app, via its local backend
Name on the download page"Backend server""Remote code machine (Lightagent)"
Name inside the app"Remote" (described as a full AgentUI server)"Remote Machine"
Credential6-digit pairing code (server log / state file)No code from loopback; an 8-digit code otherwise (the client cannot submit it yet — see Option B §6)
Data directory~/.aiagent on the server~/.lightagent on the remote machine
Default port80809121

One sentence to remember: helix-agent moves all of Helix to a server; lightagent moves only the hands.


The three setups at a glance​

Bundled local setup (default)Helix UI + helix-agentHelix UI + lightagent
Where the UI runsThis computerAny deviceDesktop only (local backend required)
Model calls and API keysLocalServerLocal
Sessions, skills, memoryLocalServerLocal
Shell / files / LSP / CRGLocalServerThe remote machine
Backend still alive after you close the appNo (it exits with the app)Yes (standalone process)No (the local backend exits with the app)
Works on phone / webNoYesNo
Typical fitOne person, one machineAlways-on server, multi-device handoffCode stays remote, keys stay local

If you only ever use Helix on your own laptop, you can skip this page entirely — neither artifact below is required.


Choosing in 30 seconds​

  • You want the backend to stay up on a server (so you can keep working after you close the laptop), or to pick the same workspace up from a phone, tablet, or browser → helix-agent (Option A)
  • The code sits on a customer network, production box, or GPU server, while model keys and chat history must never leave your machine → lightagent (Option B)
  • Several machines should share one backend with one set of models and skills → helix-agent (Option A)

Symptoms of picking the wrong one: lightagent on a phone that cannot find the machine (it needs the desktop app plus its local backend), or an API key that ends up stored on the server with helix-agent (that is exactly what it is designed to do).


Option A: Helix UI + helix-agent (full backend)​

1. Prepare the server​

  • OS: Linux (x64 / ARM64), macOS 11+ (Intel / Apple Silicon), or Windows 10/11 (x64)
  • Prefer an always-on machine you can reach over SSH
  • On that machine: git; the language servers you need for symbol tools (gopls, pyright-langserver, typescript-language-server, rust-analyzer, clangd); for Office documents, the runtime is downloaded on demand (~39 MB, needs access to GitHub / PyPI)
  • On Linux, install the browser runtime libraries listed in the backend section of the download page if you plan to use web-fetch tools

2. Download and start​

Grab the right artifact from Download → Backend server, or:

# Linux x64 shown; swap the filename for your platform
mkdir -p ~/helix-server && cd ~/helix-server
curl -fLO https://helix.iqe.me/downloads/server/helix-agent-linux-amd64
chmod +x helix-agent-linux-amd64
./helix-agent-linux-amd64 --port 8080

If Gatekeeper blocks the macOS build:

xattr -d com.apple.quarantine helix-agent-macos-arm64
chmod +x helix-agent-macos-arm64

The startup banner prints the version, LAN IP, data directory, and API addresses (excerpt):

AgentBackend 1.6.5 服务启动于 0.0.0.0:8080
- 本机 IP: 10.0.1.23
- REST API: http://10.0.1.23:8080/api/sessions
- Data Dir: /home/you/.aiagent
前端请使用: http://10.0.1.23:8080

It listens on 0.0.0.0:8080 by default and stores data in ~/.aiagent (override with --data or AIAGENT_DATA_DIR). For anything long-lived, run it under a process manager (systemd, launchd, supervisor, or a container) — otherwise the process dies with your SSH session.

3. Confirm the service is alive​

curl http://127.0.0.1:8080/health
# {"status":"ok"}

From another machine, replace 127.0.0.1 with the server IP. If this fails, fix the firewall or security group first; pairing cannot help you here.

4. Get the pairing code​

On first start the backend generates a 6-digit pairing code valid for 24 hours. It lives in two places:

# On the server: read the state file (most reliable)
grep pairing_code ~/.aiagent/selfhost/selfhost_auth.json
# "pairing_code": "482913",

Alternatively, after the client has tried to connect once, the code appears in the server log:

[selfhost] pairing code requested for node n_xxx, code=482913, expires_at=1750000000
Connect once before you tail the log

The code is written to the log when the client probes the pairing status. If you stare at the log before any client touches the server, you will see nothing — either read the state file, or click "connect" in the app first.

5. Pair from the client​

Desktop, mobile, and the web app share one flow:

  1. Open the Workspace Switchboard, click Add Workspace, and choose Remote
  2. Address: http://<server-ip>:8080 — a domain or a stable IP, not something that expires tomorrow
  3. Pair: paste the 6-digit code from step 4 when prompted
  4. Directory: browse and pick the project folder in the same dialog, then create

To register the machine first and add a project later: in the session list, open the "+" menu on a workspace group → Connect a new machine → Remote. That opens the standalone Connect machine page (address → pair → done).

Once paired, the client stores a long-lived credential and the code is never needed again. A backend issues exactly one credential:

  • Moving to another device works if you were signed in to a Helix account when pairing (the credential can be restored from the account)
  • Otherwise (local-only pairing) or if the credential is lost, stop the backend, delete ~/.aiagent/selfhost/selfhost_auth.json, and start it again. A new node and a new code are generated, and every existing client is invalidated

6. Configure a model (you are editing the server)​

Models, keys, and defaults belong to the backend. After connecting, open Settings → LLM Configuration, add a provider, and set a default model — this writes to the server's ~/.aiagent/config.yaml.

You can also stop the service and edit that file directly (field reference: API & configuration), then restart:

providers:
- id: deepseek
name: DeepSeek
type: openai
api_key: sk-...
base_url: https://api.deepseek.com
enabled: true
models:
- id: deepseek-chat
name: DeepSeek Chat
context_window: 65536
supports_tools: true

defaults:
provider: deepseek
model: deepseek-chat

7. Create the first workspace and verify​

Step 5 already does pairing, directory selection, and workspace creation in one dialog. If you only registered the machine back then, return to the switchboard and choose Add Workspace → Remote to pick a directory on that server.

Then prove it actually works, rather than merely connecting:

  1. Start a session and ask it to read a file from the repo and summarize it
  2. Ask it to run a command (for example git status) and confirm the tool panel shows real output
  3. Close the app, connect from a phone or browser, and confirm the same session is still there

8. From now on, the server owns these​

  • Chat history: stored under ~/.aiagent/workspaces/<workspace-id>/ on the server, not on your laptop
  • Background jobs: survive client disconnects; reconnect and collect the result
  • Upgrades: the desktop settings can trigger an upgrade for the connected backend (download, verify, replace, restart), or you can drop in a new binary and restart
  • Backups: backing up ~/.aiagent (config.yaml, workspaces/, selfhost/) is enough

9. Security notes​

Never expose an unpaired backend on port 8080

The pairing endpoint is public, and a guessed 6-digit code hands over the full tool surface of that machine (read/write files, run commands). Pair over a private network or an SSH tunnel; if the port must face the internet, put an HTTPS reverse proxy and access control in front of it, or pre-provision a one-time AIAGENT_BOOTSTRAP_SECRET (see API & configuration).

Recommended order:

# Run locally: borrow the server's 8080 onto your loopback
ssh -L 8080:127.0.0.1:8080 user@your-server

Pair against http://127.0.0.1:8080 first, verify, and only then decide whether to expose the port. Note that pairing binds an address plus a credential: if you pair through a tunnel address and later switch to a public address, the client may treat it as a new machine and ask for a code again. Starting with the address you intend to keep saves a reset.

One browser constraint: the web app is served over HTTPS, and connecting to an http:// backend is blocked as mixed content. Put an HTTPS reverse proxy in front of the backend, or use the desktop and mobile apps, which are unaffected.


Option B: Helix UI + lightagent (remote code machine)​

1. Check that it fits​

lightagent provides the tool execution surface only: shell, file read/write, LSP symbols, code graph, and the Office runtime. It never touches models and never stores chat history.

That means:

  • Model calls, sessions, skills, and memory stay in the Helix backend on your own machine
  • You need the desktop app (macOS / Windows), because binding and routing happen in the local backend
  • Mobile and web cannot use this mode — they have no local backend

2. Install​

On the remote machine (no root needed):

curl -fsSL https://helix.iqe.me/downloads/lightagent/install.sh | sh

Installs to ~/.local/bin/lightagent. Register it as a user-level service:

curl -fsSL https://helix.iqe.me/downloads/lightagent/install.sh | sh -s -- --service

Then run the self-check; it prints the exact fix command for anything missing:

lightagent doctor

lightagent listens on 127.0.0.1:9121 by default. Keep it that way and open a tunnel on your own machine:

ssh -L 9121:127.0.0.1:9121 user@your-remote-host

Leave that terminal open. Nothing has to be opened on the firewall, nothing is exposed to the internet, and because requests arrive from loopback, no pairing code is required.

4. Bind it and create a workspace in Helix UI​

From the desktop app:

  1. Workspace Switchboard → Add Workspace → choose Remote Machine
  2. Click the + to the right of the machine dropdown (tooltip: Add machine), enter a machine name and the Base URL http://127.0.0.1:9121 → Bind (no pairing code here)
  3. Select the machine you just bound → Browse the remote directory → name the workspace → Create
  4. Optional: fill in a local directory to keep the same workspace switchable back to local execution

5. Verify​

  • Run a command inside the remote workspace (pwd, git status) and confirm the output comes from the remote host
  • Call a symbol tool such as find_symbol on a function; if it fails, run lightagent doctor on the remote machine
  • Open settings and look at the model list — it is still your local configuration, which confirms the models did not move

6. Direct connection and its limits (optional)​

lightagent can also listen on all interfaces:

lightagent --host 0.0.0.0 --port 9121

It prints an 8-digit pairing code (also written to ~/.lightagent/pairing.txt) for non-loopback pairing requests. There is a catch: the desktop client can only complete loopback binding today. The binding dialog has just "name" and "Base URL", the bind request is sent with an empty code, and — when the machine is unbound, the pairing endpoint is open, and no rate limit is hit — a non-loopback request fails with invalid pairing code. An already-bound machine is stopped earlier by the status check (already bound), and rate limiting answers 429.

So the only working manual path today is an SSH port forward (loopback needs no code).

lightagent init --credential-stdin exists for automated installs: it pre-provisions a credential on the remote and closes the pairing endpoint, but the control plane must receive the same credential at the same time (managed deployment). It is not a manual way to supply the missing code.

If you must expose the port anyway

--host 0.0.0.0 means anyone who can reach the port can attempt pairing. Use a security group, firewall, or ufw to limit source IPs. Behind TCP-level proxies such as nginx stream, haproxy, frp, or cloudflared, the source address becomes 127.0.0.1 with no forwarding headers, so the loopback exemption would be bypassable from the internet — you must add --require-pairing in that case (and once you do, the client can no longer bind either; only a managed deployment with a pre-provisioned credential is left).

7. Unbind and upgrade​

lightagent reset-pairing   # unbind and generate a new pairing code (no restart needed)
lightagent upgrade # check and install a new version; keeps lightagent.old for rollback
lightagent service status # inspect the user-level service

Unbinding the machine in Helix UI (Remote Machine → Unbind) removes it from the local backend. Remote workspaces bound to it lose their execution target — tool calls report a missing machine. Bind a machine again to recover, or delete those workspaces.

A workspace carried over from an older release may still count as “referenced”, in which case the unbind returns 409 (remote agent is referenced by N workspace(s)): delete that workspace first, then unbind.


The two options can coexist​

One desktop app can hold a local workspace, a remote workspace on a helix-agent server, and a remote code machine bound through lightagent at the same time. Switching workspaces switches the execution target; nothing bleeds across.

A common combination: desktop + lightagent for day-to-day coding (keys stay local), with helix-agent on a server for long-running jobs and multi-device handoff (phone or browser can check progress).


Troubleshooting matrix​

Symptom (match the text in the client error)Likely causeFix
helix-agent: even /health failsPort blocked, process down, or not listening on 0.0.0.0Read the startup banner; check firewall and security group
helix-agent: keeps asking for a code, log shows nothingNo status probe has happened yetClick connect once, or read selfhost/selfhost_auth.json
helix-agent: "This server is paired but credentials are missing" or "...credentials cannot be recovered from cloud"This backend already issued a credential to another deviceRestore via the same account, or delete selfhost_auth.json and restart
helix-agent: requests fail with 401 invalid credentialClient credential is stale (reset, or a different address)Re-pair and stick to one address
Web app cannot reach a self-hosted backendHTTPS page calling http:// is blocked as mixed contentTerminate HTTPS in front of the backend, or use the desktop/mobile app
Self-hosted server unreachable over cellularNo publicly reachable addressSSH tunnel, private network, or a gateway as described in Self-hosting and remote access
lightagent: error contains already bound to another client or already paired (409)This machine is already bound — to another computer, or to a managed deployment that pre-provisioned a credentialManual setup: run lightagent reset-pairing on the remote host and bind again. Managed deployment: do not reset (it wipes the provisioned credential and reopens the pairing endpoint); contact the operator
lightagent: error contains invalid pairing codeNo valid pairing code was sent (the client sends none for cross-machine binding)Use an SSH tunnel (loopback needs no code); if the host sets --require-pairing, the tunnel fails too — see §6
lightagent: error contains too many pairing attemptsPairing attempts are rate limited (10 per IP per minute)Wait a minute and retry
lightagent: tool calls in a bound workspace fail (invalid credential, or a 502 from the proxy layer)The stored credential no longer matches the remote host (reset or reinstall)Unbind the machine → reset-pairing on the host → bind again
lightagent: read-file works but find_symbol errorsLanguage server missing on the remote hostlightagent doctor, install what it lists
lightagent: file endpoints return 404Remote lightagent is too oldlightagent upgrade, then restart
lightagent: binding fails on mobile or webThis mode needs a local backend, which those clients do not haveUse the desktop app, or switch mobile to a helix-agent server

Next steps​