# DisPatch: One PIN-Locked Chat App for Every AI Provider You Run URL: https://www.laserlloyd.com/projects/dispatch-multi-provider/ Published: 2026-11-29 Description: One self-hosted chat app for local models, hosted AI providers and OpenClaw agents, with PIN sign-in, per-profile permissions and agent approvals. Reuse: free for personal use — full policy at https://www.laserlloyd.com/llms.txt Many people who run local AI end up with several backends. There is a model server on a GPU machine, one or two hosted providers for long context or a second opinion, and perhaps an agent runtime such as OpenClaw that can run commands on the host. Each backend comes with its own interface, its own keys and its own idea of who is allowed in. DisPatch puts all of them behind one web app on your network. Every person signs in to their own profile with a PIN, and the server decides what each profile may reach. This article is for the person who runs that setup. It covers the providers DisPatch can talk to, the security model in detail, a reference setup, and what the app does not protect against. For the general tour and the install steps, read DisPatch: The Self-Hosted Chat Hub first. Every screenshot comes from a test install of the public code (main, version 4.3.0) with an invented small studio: Alex is the Owner, Priya is a User and Guest is a Basic profile. The GPU server in the pictures is a stand-in that answers like an OpenAI-compatible server. The test install ran in a network namespace with loopback only, so the hosted providers were configured with fake keys and could not be reached. The agent bot talks to the repo's own test gateway, and the approval prompt comes from DisPatch's scripted test agent. None of it is our own data. The lock screen shows the profile list. There is no shared profile that opens without a PIN. Each profile opens with its own PIN. TL;DR Providers: thirteen connection types: any OpenAI-compatible server, StudioForge, LM Studio, Ollama, OpenAI, Anthropic, DeepSeek, xAI, MiniMax, OpenRouter, Groq, Mistral and Together AI. Agent bots run on OpenClaw, and agent tasks can also run on the Claude Agent backend or on command-line programs the Owner approves. One bot, one backend: each bot is bound to a connection and an AI model, or to an agent. A bot can have a fallback chain, for example a hosted AI model first and the GPU server second. Access: three profile types (Admin, User, Basic), a PIN or password per profile, and per-profile switches. Agents are off for everyone but Admins until an Admin switches them on, and OpenClaw chat bots belong to the Owner alone. Checked on a test install: an unsigned visitor gets "Sign in to continue". A User without the agent switch gets 403 from every agent route. Five wrong PINs in a row start a wait. A script without the machine key gets 401. Not covered: no second factor yet, no built-in TLS, no spending limits per person, and the database is not encrypted on disk. Providers: one app, several backends A connection is one AI service: an address, an optional key and the AI models it serves. Settings → AI & Connections lists them. Test asks the server for its list of AI models and shows the answer time. The code knows thirteen connection types: On your own hardware: any OpenAI-compatible server (vLLM, llama.cpp, LiteLLM, TabbyAPI and others), StudioForge, LM Studio and Ollama. For the last three, Find servers looks for them on this computer, and on the home network if you tick the box. Hosted: OpenAI, Anthropic, DeepSeek, xAI, MiniMax, OpenRouter, Groq, Mistral and Together AI. Anthropic is not wrapped in an OpenAI-compatible layer: DisPatch calls Anthropic's own API. One limit comes with that: the Anthropic path takes no tools, so a bot on Anthropic does not use the live lookups (web search, weather and the rest). Every other type uses the OpenAI chat format. Three connections: the GPU server (tested), Anthropic and OpenRouter. A saved key shows only as "Key saved". A bot is bound to a connection and an AI model A bot (DisPatch also says character) is what people talk to. Its backend is either direct (a connection and an AI model) or agent (an agent runtime). In the bot's Details, under How it answers, you pick the connection and type or pick the AI model. To use a different AI model for the same job, you change the bot, or you make a second bot. A connection that a bot still uses cannot be deleted. In practice you make one bot per backend and name it for what it is. The test studio has four: Local 27B: the GPU server, for drafts, code review and client text. Hosted fast: OpenRouter, with the GPU server as fallback. Claude: Anthropic, for second opinions. Ops agent: OpenClaw on the DisPatch computer. The Owner's bots. Direct bots answer through a connection; the agent bot runs OpenClaw. A bot's Details: the connection and the AI model it uses. Agent bots and agent tasks DisPatch has two ways to use an agent, and the difference matters for access control. Agent bots are chat bots whose replies come from an agent runtime. OpenClaw is not a connection type and does not appear under Connections. You make an agent bot in Settings → Characters with New bot, and choose an agent as its answering engine. In version 4.3.0 that runtime is OpenClaw: the openclaw command on the DisPatch computer, or its gateway with DISPATCH_GATEWAY_WS=1 (default address ws://127.0.0.1:18789). The OpenClaw backend must run on the same computer as DisPatch. An agent bot runs with OpenClaw's own configuration and tools. Agent tasks are jobs you assign from a chat. An Admin defines an agent (Settings → AI & Connections → Agents) with a backend, an AI model, instructions, allowed tools, limits and an approval policy, and publishes it to the profiles that may use it. The backends are OpenClaw, Claude Agent (the Anthropic agent SDK, with an Anthropic Console key or a cloud provider's credentials), and command-line programs the Owner chooses. A fourth backend, Claude Managed Agents, is off by default and has not been tested against the live service. The Ops agent bot in a chat. On the test install, OpenClaw's side was the repo's test gateway. Fallbacks A direct bot keeps an ordered list of providers in config.yaml. The first entry is the primary, and the next ones are fallbacks. If a provider fails before the first word of the reply (bad key, server not reachable, an HTTP error, or a reply that is only reasoning), DisPatch tries the next one. If a provider fails in the middle of a reply, the turn ends with an error, so one reply never mixes two AI models. Separately, a 429, 502, 503 or 504 before any text is retried once. The settings screen sets one provider per bot. For a chain, add entries to the bot's advisor: block in config.yaml. DisPatch reads the file again when it changes. This is the chain we gave Hosted fast: advisor: providers: - provider: openrouter base_url: https://openrouter.ai/api/v1 model: fast-chat connection: openrouter - provider: custom base_url: http://127.0.0.1:1234/v1 model: qwen3-27b-instruct connection: gpu On the test install OpenRouter could not be reached, so the GPU server answered. The line under the reply names the AI model that wrote it: Hosted fast fell back to the GPU server. The AI model under the reply shows which backend answered. When a provider fails With no fallback, a failed provider gives a red error in the chat that names the cause, with a Retry button. The error is not saved in the history. The docs list the common causes: a server that is not running, a wrong address, a rejected key, an AI model the account does not have, and an Anthropic refusal. A real failure on the test install: Anthropic could not be reached. Where the keys are stored On a standard install, connection keys go to agents/secrets.json in the data folder, an owner-only file (mode 0600 on Linux and macOS, an owner-only access list on Windows). That file is plain JSON. It is not encrypted. On our test install both fake keys landed in that file. DisPatch can use the operating system's keyring instead, but only when the Python keyring package is installed in DisPatch's environment and finds a working keyring. The standard install does not include that package; you add it yourself. DISPATCH_SECRET_STORE=file or keyring forces one of the two. A key is never shown again in the app: the card says "Key saved". The Owner can also give a connection the name of an environment variable on the host instead of a pasted key. The security model The goal for this kind of setup is plain: people on your network can use the AI models you give them, and nobody but you can reach the agent that acts on your computer. Every rule below is checked by the server on each request and each WebSocket message. The browser does not decide anything. Every route in the code declares exactly one requirement, and a route without one is refused. A test in the repo checks that list. Profiles and what each may do AdminUserBasic Chat, voice chat, attach filesyesyesyes Household botsall, and manages themthe ones an Admin gives (default all)only the ones an Admin gives Own bots, copy household botsyesyesno Choose a bot's connectionyesfrom the connections an Admin allowsno Image generation, voice cloningyesyesoff, switchable File Servereverythingupload; list and download own filesupload only Agent tasks, approve agent actionsyesoff, switchableoff, switchable People, connections, keys, backups, audit logyesnevernever The first Admin is the Owner. The Owner cannot be demoted, turned off or deleted, so the install cannot lock itself out. Since 4.3, anything that runs a program on the host, reads its files or hands out a secret the host holds needs the Owner, even when another Admin exists. Examples: the agents' shell and file tools, command-line programs for agents, settings that name a program or file on the host, a connection key read from an environment variable, and showing the backup recovery key again. A second Admin gets 403 host_owner_only. Chats are private to the profile that wrote them. An Admin cannot open another profile's chats in the app. PINs, passwords and the lock screen Any profile can have a PIN. A PIN has at least four characters, and the screen asks for digits. Only Admins have a password (at least eight characters). PINs and passwords are stored as argon2id hashes. The Owner's PIN is a PBKDF2 hash in security.yaml. What a device sees before anyone signs in is the lock target, in Settings → People & Access → Default profile: A default profile (the fresh-install setting). A new install creates a User profile called DisPatch with no PIN. Any device that reaches the port and has not signed in uses that profile. It can chat with that profile's bots and see that profile's chats. It can never run agents or clone voices: those permissions cannot take effect on the lock target. No default: show the sign-in screen (lock_target: profile_list). A device that has not signed in gets the profile tiles and nothing else. For a network with housemates or guests, choose the sign-in screen. Then remove the DisPatch profile or give it a PIN. On our test install, with the sign-in screen chosen, the PIN-less DisPatch profile could still be opened from its tile without a PIN, and it chatted with Atlas on the GPU server. A tile without a PIN is open to anyone who can see the lock screen. Wrong PINs and passwords are throttled in three layers: Per device and profile: after 5 failures, a wait of 5 seconds that doubles with each failure, up to 320 seconds. Per network address: after 15 failures, the same waits. IPv6 addresses count per /64. The whole install: after 60 failures in 10 minutes, a wait of 30 seconds that doubles, up to 32 minutes. At the top step, only remembered devices and the DisPatch computer itself are checked; everyone else gets 429. On the test install, the sixth wrong PIN for Guest got 429 "Too many tries. Wait 5 seconds, then try again.", and the right PIN during the wait got 429 as well. The counters are kept in memory: a restart clears them, and there is no permanent lockout. If the Owner forgets the PIN, the recovery code works on the lock screen. DisPatch writes it to RECOVERY-CODE.txt in the data folder when the Owner's PIN is set: keep a copy off the machine. The recovery code removes the PIN, or, with other profiles present and no Owner password, it replaces the PIN with a new one typed together with the code. The code does nothing for a lost password. If the Owner's password and PIN are both lost, run uv run python -m app admin reset in the backend folder on the host, or put an empty file named RESET_LOGIN in the data folder before the next start. What an unsigned visitor can reach With the sign-in screen as the lock target, a request without a session gets 401 signin_required ("Sign in to continue."). We checked /api/characters, /api/threads and /api/connections on the test install: all three answered 401. The WebSocket closes with code 1008. The few public routes include the liveness check /api/health and what the lock screen needs: GET /api/auth/status lists each profile's display name, role, picture and which credential it takes, never a hash or a session. If the names should not be visible on your network, put the app behind your reverse proxy's own sign-in. Before the first Admin exists, DisPatch answers only the computer it runs on. Other devices get 403 setup_required and need the one-time setup token from the server log. Per-profile switches Settings → People & Access → Edit on a profile shows What this profile can do, one switch per permission. The ones that matter most for this setup: Agent bots and tasks (dispatch_agents). Off for Users and Basic profiles until an Admin switches it on, and switching it on asks for a confirmation. The screen warns: "Agent bots can run commands on the DisPatch computer, including reading anyone's chats." Without it, every agent route answers 403, listing included. Approve agent actions (approve_agent_actions). Off by default for the same profiles. Choose a bot's connection or agent and Connections this profile's bots may use. These decide which accounts a User's own bots can spend. There are no spending limits per person, so a User with "Every household connection" can make a bot on your metered hosted provider. Pick Only these to keep a profile on the GPU server. Upload to the File Server and List and download own files. Live lookups. See the note below. Priya, a User: agents off, four household bots, and the choice of connections her own bots may use. Agent chat bots go further than the switch. An OpenClaw agent bot always belongs to the Owner. It cannot be a household bot, and no other profile can chat with it, whatever its switches say. The data check at every start (invariant I3) reports an agent bot that belongs to anyone else. So the only way for another person to use an agent is an agent task that you publish to them and a profile with the switch on. Here is what Priya sees. The Ops agent is not on her bar, the Tools menu has no Tasks page, and an @release-helper mention is plain text that goes to the bot she is chatting with. From the API, her request to /api/tasks got 403 permission_denied, naming dispatch_agents, and her list of bots had no Ops agent in it. Priya's view: no agent bot, no Tasks, and an agent mention is only text. Note on Live lookups. In the public 4.3 code, the per-profile Live lookups switch is stored and shown, but the server does not read it. The fix is on the development branch and is listed in the changelog under "Unreleased", with no version number yet. Until a release includes it, use the Lookups switch on each bot (Settings → Characters), which the server does check. Who sees which bot Older versions had an audience setting on each bot. It is gone: the API refuses it with 422, and an old value is kept but not read. Access now comes from two things. A bot is either household (managed by Admins) or personal (private to one profile). An Admin gives a household bot to profiles, in the bot's Who can use it or in each profile's Household bots list, and each of those profiles gets its own copy. A bot a profile may not use answers like a bot that does not exist, and the live updates over the WebSocket leave it out too. Agent actions and approvals An agent task starts from a chat: type @agent-name and the instruction, or use Assign task in the chat menu. Nothing runs until you press Assign. The dialog names the agent and its backend, and says that the agent runs on the DisPatch computer and asks before it changes anything. Assigning a task. Nothing runs before Assign. Before a tool that changes things, the agent stops and shows an approval card in the chat: Allow once, Allow for this task, or Deny. A shell, file writes and anything that sends, posts, deletes or creates always ask, and a destructive tool offers "once" only. An unanswered approval counts as No after 30 minutes. Default limits per task are 2 US dollars and 60 turns, and 10 US dollars per agent per day; the cost is an estimate. The approval card. This task ran on DisPatch's scripted test agent, so no command ran anywhere. One limit matters a lot if you run OpenClaw: the OpenClaw backend has no DisPatch approval cards. An OpenClaw agent bot or task uses OpenClaw's own tools and OpenClaw's own approval settings. DisPatch decides who may reach it; OpenClaw decides what it may do. Approval cards come only from the backends that support them: Claude Agent and Claude Managed Agents. Command-line agents have none either. Sessions and requests Cookies: the session and device cookies are HttpOnly and SameSite=Strict, and Secure when the request came over TLS. Cross-site requests: a request that changes something must come from the same site (Origin equal to Host, and Sec-Fetch-Site not cross-site), or it gets 403 csrf_origin. The WebSocket handshake refuses another Origin too. Address check: DisPatch compares the Host name with the names it answers to, which blocks DNS-rebinding pages. The default is log; set host_check: enforce once Settings → System → Network shows no unknown names you use. Idle sign-out: per profile type in Sign-in rules. On our install: 10 minutes for Admins, 1 hour for Users, 30 minutes for Basic profiles. Remembered devices: off unless you choose a number of days in Remember signed-in devices. The machine API key Scripts, crons and agents that post into DisPatch use the install's API key, sent as X-API-Key or Authorization: Bearer. It is in Settings → People & Access → Access for programs. Every Admin sees whether a key exists; only the Owner can make or replace it, and it is shown once. A key can be narrowed to a set of scopes. The key is stored as plain text in security.yaml (mode 0600). Trust programs on this computer (machine_loopback_trust) lets programs on the DisPatch computer skip the key. A fresh 4.3 install has it off. An install upgraded from an older version keeps its old setting, which can be on: check it. A wrong key is refused even from the DisPatch computer. Access for programs: a key is set, and programs on this computer are not trusted without it. We posted a status line to the Ops agent's daily chat three times on the test install (the test install used another port): curl -X POST http://127.0.0.1:8765/api/inject \ -H 'Content-Type: application/json' \ -H "X-API-Key: $DISPATCH_API_KEY" \ -d '{"bot_id": "opsagent", "content": "Nightly backup finished: 4.2 GB in 6 minutes.", "metadata": {"notice": {"level": "ok"}}}' # no key: HTTP 401 {"error":{"code":"invalid_api_key", ...}} # wrong key: HTTP 401 {"error":{"code":"invalid_api_key", ...}} # right key: HTTP 200 {"thread_id":"daily-opsagent-2026-11-29", ...} The File Server The File Server is a drop box on the DisPatch computer, separate from chat attachments. Admins can do everything. Users upload, and list and download only their own files. Basic profiles upload only. A machine with the key may list file details and upload, with a shared limit of 200 MB a day. The File Server never reads other files on the host. The activity and audit log Settings → People & Access → Activity & audit has counts per day and a list of Admin actions. It records sign-ins and failed sign-ins, recovery, credential changes, profiles, bots, connections, backups, agent tasks and every approval or denial. It stores ids and counts, never what was said. Only profiles with view_activity (Admins) can read it. The audit log shows the denied Bash approval from the task above. Encrypted backups and recovery An encrypted backup (.dpbk) holds chats, bots, settings and, if you tick the box, pictures and files. It uses AES-256-GCM, with the key made from your passphrase by scrypt. If you leave the passphrase empty, DisPatch makes a recovery key, shows it once, and keeps it for scheduled backups. Without the passphrase or the recovery key, nobody can open the backup, you included. Scheduled encrypted backups are off until you switch them on in Settings → System. DisPatch also keeps automatic copies of the database, which are not encrypted. Backup settings. Turn on scheduled encrypted backups. The data check GET /api/health/invariants checks thirteen data rules (I1 to I13) and reports ids and counts only. DisPatch also runs it at every start. It needs an Admin or a machine key with the machine:health scope; Priya got 403. On the test install all thirteen counts were 0. What it does not protect against The host computer is the trust boundary. Anyone with a shell or read access to the data folder can read everything. The database is not encrypted on disk, the keys file is plain JSON, and the machine key is plain text in security.yaml. Use full-disk encryption if you need protection at rest. Agents. An agent with shell access can read every profile's chats. The permissions decide who can start an agent, not what the agent can reach on the host. No TLS of its own. The docs say: "DisPatch never speaks TLS itself." and "TLS terminates on hardware you own." On plain http, anyone on the network path can read the traffic. The internet. The docs say: "Do not expose port 8765 to the internet directly. Port-forward 443 to a reverse proxy that terminates TLS, never 8765 to the app." If the app is reachable from the internet, use the sign-in screen as the lock target or your proxy's own sign-in. No second factor. TOTP and passkeys are on the roadmap, not built. No spending limits per person. Anyone who can use a bot can spend the account behind it. Set limits in the provider's own dashboard, and keep metered connections away from profiles that do not need them. Throttle counters reset on restart, and the waits are short. A PIN of four digits is a convenience lock for a trusted network, not a defence against a determined attacker on the same network. Picture addresses. A chat picture is protected by an address nobody can guess, not by an owner check. Anyone who has the address can fetch it. A reference setup A setup that matches the brief "PIN-locked, my agents stay mine": DisPatch and OpenClaw on one computer. DisPatch binds 127.0.0.1 by default (DISPATCH_HOST, port DISPATCH_PORT=8765). Keep the OpenClaw gateway on loopback too, so only the DisPatch computer can reach it. Set DISPATCH_GATEWAY_WS=1, or put openclaw on DisPatch's PATH. The model server on the GPU machine. Add it as an OpenAI-compatible, StudioForge, LM Studio or Ollama connection with its network address, and press Test. One hosted provider as fallback. Add it with its key, and give the bots that need it a provider chain in config.yaml. The people. You are the Owner, with a password and a PIN. Each other person is a User or Basic profile with a PIN. Leave Agent bots and tasks and Approve agent actions off for them, give them only the household bots they need, and set Connections this profile's bots may use to Only these. The lock screen. Default profile: No default: show the sign-in screen. Remove the DisPatch profile, or make the sign-in screen the default first and then give that profile a PIN. The key and the log. Make a machine key for your scripts, keep Trust programs on this computer off, and look at Activity & audit now and then. Backups. Turn on scheduled encrypted backups, and keep the recovery key and RECOVERY-CODE.txt off the machine. Remote access. Use a private overlay network (WireGuard, Tailscale or ZeroTier) or a reverse proxy with a real certificate, as the repo's docs/remote-access.md describes. When DisPatch must answer on the network, bind wider only behind something that terminates TLS. Tailscale Serve and a proxy on the same computer need no extra settings; a proxy on another address goes in trusted_proxies in security.yaml. The settings for steps 4 to 6 are in security.yaml in the data folder: lock_target, machine_loopback_trust, machine_scopes, remember_device_days, trusted_proxies, allowed_hosts and host_check. The People & Access screen writes the same values. Day to day Threads per job. Each bot keeps its own chats, so a project can have its own chat with Local 27B and another with Claude. Search finds old chats. Changing the AI model. The AI model name sits at the top right of a chat and under each reply. To move a bot to another AI model, change it in the bot's Details. Every chat with that bot uses the new AI model from the next message. Status from scripts. A cron job or a monitor posts a one-line notice with /api/inject, as in the example above. "notify": true also sends a push notification to the phones that turned notifications on. Files and pictures. Attach files in a chat, drop larger ones on the File Server, and make pictures in Image Studio or in a chat with a bot that has Pictures on. For children. The same install can give a child a Basic profile with only the friendly bots you choose, its own PIN, and no agents. DisPatch ships a ready-made pack of animal characters (Animal Friends) for that. See the overview and DisPatch 3.0: family profiles and a setup wizard. Other notes What we did not test. We did not call any real hosted provider or a real OpenClaw gateway for this article: the hosted connections had fake keys and no network, and the agent side was the repo's test gateway and scripted test agent. We did not test the Claude Agent backend, OIDC sign-in, remote access through an overlay network, or a restore from an encrypted backup. Versions. Everything here is from the public main branch at version 4.3.0, checked on 2026-11-29. Related: DisPatch: The Self-Hosted Chat Hub · DisPatch: a self-hosted chat app for local AI agents · DisPatch 3.0: family profiles and a setup wizard · DisPatch on GitHub