AI Card Bao DASH.AICARDBAO.COM
Home / 开源 / Local AI App
AI TOOL / #12962

Local AI App

Local AI applications: Launch local models from registry configurations, monitor their operation status, and activate encoding agents.

Introduction

Start a local model with one click, watch it run, and open your coding agent on it.

Local AI is three small pieces:

  • A registry of recipes (local-ai-registry): for each GPU, which models run on it and the exact docker run that starts each one.
  • A server (server/): reads the registry, starts engines (in Docker, or as a pinned program on Apple silicon), and reports what the machine is doing.
  • An app (web/): one page the server serves. A narrow window (under 640 px) shows the panel, a wide one the desktop layout. The panel is always exactly as wide as its window. In the desktop app's own window, which takes the panel's shape, it is shown at up to one and a half times its size; in any other window (a browser's, a tiled Omarchy web app's) it is drawn at its real size. Electron (electron/) and the Omarchy web app are just windows onto that page.

There is no gateway. Each engine serves its own OpenAI-compatible API on its own port, and agents talk to it directly.

There is also an iPhone app in ios/: it talks to the models your machines are running, and runs LFM3-1.7B on the phone itself. It is built and checked on its own; see ios/README.md.

Run it

Downloads are at local.sybilsolutions.ai/download. On a Mac, open the DMG and drag Local AI to Applications. It is signed with a Developer ID and notarized by Apple, and brings its own Node.js. On Windows, run the installer: it installs for you alone (no administrator needed) and brings its own Node.js too; it is not signed yet, so Windows asks before it runs. On Linux, one line installs the newest release (and, run again, updates it):

curl -fsSL https://local.sybilsolutions.ai/install.sh | bash

That line downloads the release, checks it against its published checksum and runs the install.sh inside it. From a copy of this repository:

./install.sh                # a user service that keeps the server running, and an app-menu entry
node server/index.js        # or just the server: open http://127.0.0.1:18700
npm install && npm start    # or the same page in an Electron window, from source

Run from source on a Mac, the Dock and the first word of the menu bar say Electron, because that is the name of the program npm start runs. The installed app is Local AI everywhere.

The server needs Node 20 or newer (the Mac app and install.sh bring it). Starting models also needs Docker and an NVIDIA GPU that nvidia-smi can see (on Windows, Docker Desktop, which hands the GPUs to engines through WSL 2), or on Linux an Intel Arc card that lspci lists, or a Mac with Apple silicon and Python 3.11 or newer (no Docker). On Linux the user who runs it must be allowed to use Docker (in the docker group); where they are not, the app says so. The server itself has no dependencies. install.sh is for Linux; on a Mac, use the app.

A page opened in a browser asks for the machine's key once (the app's own window, and the app-menu entry the installer adds, are handed it: on Omarchy the entry is an app window of its own, on any other Linux desktop it opens the page in your browser). The key is under Settings › API endpoints, and in ~/.local-ai/config.json.

A machine that already runs Local AI installs it on another Linux machine on your tailnet: under Machines, choose Set up. It signs in over SSH and sends the app's files over that connection, so the other machine never has to reach this one; where it can't sign in, it shows the one-line command instead. The installer brings its own Node.js when the machine has none.

SettingDefault
LOCAL_AI_HOST127.0.0.1Address the server and engines bind to. Leave it unset to get loopback plus, when Tailscale is up, this machine's tailnet address.
LOCAL_AI_SHAREon0 stops the app from also answering on the tailnet address when LOCAL_AI_HOST is unset.
LOCAL_AI_PORT18700The app. Engines take the next 99 ports.
LOCAL_AI_HOME~/.local-aiConfig, your recipes, usage, events.
LOCAL_AI_MODELS~/.local-ai/modelsDownloaded weights. A recipe that asks for the Hugging Face cache layout uses HF_HOME/hub instead. Several folders, separated by :, mean: download to the first, and look in the others for weights you already have (see below).
LOCAL_AI_REGISTRYthe registry's dist/catalog.jsonWhere recipes come from.
LOCAL_AI_DISCOVERon0 shows only the models this app started, and stops it looking for ones started elsewhere.
LOCAL_AI_TERMINALthe first one installednone opens no terminal: Open always gives the command to paste (a machine nobody sits at).

How it works

flowchart LR
  registry[(local-ai-registry)] -->|catalog.json, hourly| server
  subgraph machine[Your machine]
    app[web app] |GET /api/state, long-polled
one request per button| server[server :18700]
    server -->|docker run / stop / ps / logs| engine[engine :18701…]
    server -->|/metrics every 2 s, /v1/models every 10 s| engine
    agent[coding agent] -->|OpenAI or Anthropic API| engine
  end
  server |its /api/state, long-polled
/api/devices/n/* proxied, with that machine's key| other[Local AI on another machine]
  • One snapshot. Every two seconds the server looks at the GPUs, its engines and its containers. The result is one JSON snapshot. The app long-polls it and redraws; nothing else is pushed, and the app keeps no state of its own about the machine.
  • What a look costs. Looking every two seconds must cost next to nothing, because the machine is there to run models. So nothing is started that can be left running, and nothing is asked twice:
  • nvidia-smi is started once and left printing every two seconds (gpus.js); started afresh for each reading it was most of the CPU the app used. On Apple silicon, memory is read every six seconds.
  • A working engine gets one request a look: its counters (/metrics), which also show it is up. Its model list is asked for every fifth look, or at once when the counters stop answering.
  • Docker is asked what it is running every fifth look, and on every look while a container is on its way up or down or has stopped answering. On Apple silicon, where no run is a container, it is not asked at all.
  • A port that answered and is not a model is not asked again for five minutes.
  • The snapshot is written out once per change, and compressed once per change for other machines (a seventh of the size). A request that changes nothing (any GET) does not rebuild it.
  • A connected machine is followed the way its own page follows it: one long-polled request it answers when something changes, so a change there shows here at once and an idle machine costs one request every 20 s.
  • The page's files are kept in memory, compressed, and sent again only when they changed (ETag); its scripts are named in the page's head so they are fetched side by side.
  • The page draws when the machine changes and does nothing in between: there is no animation loop, and no redraw while its window is hidden.
  • A connection is kept for five minutes after its last request. A press on a connected machine's page then costs one trip to that machine, not the two or more it takes to open a connection first.
  • A model card is kept for a day, and a model that has none is not asked about again for ten minutes.
  • A speed measurement and the first test question put no limit on the answer's length; the engine ends them itself.
  • Everything the registry has for your cards is listed. The Models screen is in sections, one per setup the registry knows for the machine's cards, largest first: several cards in this machine (4 × RTX PRO 6000 Blackwell (one machine)), one card, and several machines of the card working together (2 × DGX Spark GB10). In each, what the machine can start comes first; a recipe the app will not start is listed after them with the reason in place of its details (it spans several machines, uses a Docker option the app does not pass, needs more memory than the machine has, and so on). Nothing is left out without a word. On a machine with several cards the three picks come from the largest setup in the machine that has a model it can start. A recipe that says how much free memory it needs beside the GPUs (needs.host_ram_gb) is listed when the machine has that much memory at all, and is started only when that much is free at that moment (MemAvailable on Linux); otherwise the start is refused with both numbers, since an engine started short of memory loads for minutes and is then killed. A speed from the registry's older acceptance test (a legacy proof) is not a measurement to rank by: it does not make a model the fast pick over one whose speed was measured, and is shown on the model's page as from an older test. The model shown first, before you choose or start one, is the registry's recommended one for that setup. A recipe's setup is its source's notes (what it was measured on, what it needs); they are shown on its page and stop nothing. Its typed resources (a memory limit, memory it may lock) are passed to Docker.
  • Weights you already have. A model's weights can be hundreds of gigabytes, and you may have them already. Name the folder that holds them after the download folder in LOCAL_AI_MODELS (~/.local-ai/models:/mnt/llm_models). A folder in it named like the repo (DeepSeek-V4.1-Flash-1017) is used where it is, read-only, once every file the recipe needs has been checked against Hugging Face's list for the pinned commit: its size, and its checksum (SHA-256 for a large file, git's own for a small one), on threads of their own. What passed is noted in found.json, so the check is made once. A folder that differs is left alone and the weights are downloaded as usual; the failed start says which file differed. Until it has been checked, such a recipe already says Run, not Download.
  • Intel Arc. On Linux, lspci names the Arc cards and says how large each one's memory is, and the card's render node is found under /dev/dri/by-path (gpus.js). A card that shows at least 4 GB is a card of its own (an Arc Pro B70 shows 32 GB); one that shows less is part of the processor and its memory is the machine's RAM (an Arc B390). An Intel card runs only recipes the registry has for that card: nothing is borrowed from an NVIDIA card of similar size. Its engine is given the card as a device (--device /dev/dri/renderD128, not --gpus), and a folder with a link to that card alone in place of /dev/dri/by-path, because Intel's libraries open every card they find a link to. The driver does not say how much of a card's memory is in use, so a card counts as taken when a container of another program was given it (the Omarchy plugin's engine, for one); Docker is asked that every ten seconds, only on machines with such a card.
  • Omarchy. On a machine that runs Omarchy, the app tells Omarchy's own Agents panel what it is running (omarchy.js): it writes ~/.local/state/omarchy/agents/usage/local-ai.json, a record of the kind that panel draws a section for, with the running models as its plan line and no token counts, and removes it when nothing runs. Omarchy counts self-hosted work itself, from each agent's sessions, by the provider id a session ran under; so when Pi, Oh My Pi, T3 Code or OpenCode is opened from here, the ids Local AI opened it under are added to ~/.config/omarchy/agents/local.json, the list Omarchy reads for exactly that. Nothing else of Omarchy's is touched, and on a machine without those folders nothing is written. The bar panel is a plugin of its own (sero.local-ai), which draws from this app's /api/state.
  • Docker is the record. A run is a container labelled local-ai=1 with its recipe, port and GPUs in labels. Restart the server and it adopts whatever is still running.
  • Apple silicon. The chip is one GPU whose memory is the unified RAM, and it only runs recipes made for exactly that chip (backend: metal). Such a recipe is kind: host: a command that is Python and the recipe's own script (never -c, -m or another file), pip packages each pinned with ==, the script in config with a sha256 that must match, and weights pinned to a commit. Because it runs as you rather than in a container, the app shows what it will run and waits for Allow the first time, and again whenever the recipe changes. The engine is given a short environment (PATH, HOME, the locale, what the recipe sets), not the app's. Each recipe's packages get their own venv in envs/, shared by recipes that pin the same ones and deleted after 30 unused days. The engine runs in `runs/

/ on an inner port (the app's port + 100 and up); the server listens on the run's own port in front of it and counts the tokens each answer reports (meter.js), since such engines have no /metrics. The engine outlives the app like a container does: hosts.json` remembers it, and a restarted app adopts it again only if the process still runs in that folder and started when it did. Quitting the app closes the front port until the app is back.

  • Models it didn't start. Every 30 seconds it asks each listening port above 1024, over loopback, for /v1/models. Whatever answers with one model, or with several and engine counters on /metrics (vLLM, SGLang, llama.cpp), is shown as running too, with its stats and its address, and is never stopped. A proxy that lists several models and has no engine counters (a gateway to cloud APIs) is not. The same model id on several ports (an engine and a proxy in front of it) is shown once.
  • A model is counted on the machine it runs on. A port on this machine that only passes requests on to a model on a connected machine (an SSH tunnel, a forwarder) answers exactly like that model, counters and all. It is that machine's model: it is not shown as running here, and its tokens are not this machine's usage. Each machine puts in its snapshot when each of its engines started (born), so the same engine reached through a port here is recognised without asking the other machine anything; anything it was counted for before that is taken back. Usage shows one machine's own tokens, and says whose. The one total across machines is under "All machines" on the Usage page, labelled as added up, machine by machine.
  • Which screen. The app shows the first screen its rules match for the snapshot (resolve() in web/state.js): can't connect, needs a key, Docker off, no GPU, downloading, starting, running, failed, and so on. Settings, Models and the rest are ordinary screens opened on top.
  • Your machines. Machines signed in to your Tailscale account trust each other: one click connects them, and the page opens on any of them without typing the key. Anything else needs the key.

Files

server/
  index.js      HTTP: the route table, who holds the key, settings, start()
  snapshot.js   the snapshot: built on a change, long-polled, compressed for other machines; what agents can be pointed at
  static.js     the page's files: kept in memory, compressed, sent again only when changed
  engine.js     runs: start, stop, logs, and the look every two seconds
  runs.js       the runs themselves and what the others share: status, changes, failures, free GPUs
  health.js     whether an engine answers, its first reply, its APIs, when to measure it
  containers.js a run as a Docker container: launch, stop, logs, adopt what is already running
  hosts.js      a run as a program on this machine (Apple silicon): venv, launch, stop, adopt
  discovery.js  models started elsewhere on this machine, found by asking listening ports
  docker.js     the one `docker run` a recipe becomes, and which of its options are allowed
  gpus.js       the GPUs: nvidia-smi left running, the Apple chip, a GPU that shares the system's memory
  weights.js    Hugging Face downloads and the mounts that put them in a container
  meter.js      the front port of a host run: passes requests to the engine and counts their tokens
  usage.js      tokens served, from each engine's own counters; who is calling
  recipes.js    the registry catalog, your own recipes, the three picks per GPU, model cards
  speed.js      measured tokens per second and load times
  agents.js     coding agents: find, open on a model, install, update
  shell.js      the person's own shell: its PATH, running a command in it, launch scripts
  terminals.js  the terminals installed here and opening one on a script
  pi.js         Pi and Oh My Pi: the extension that registers each running model as a provider
  apps.js       desktop apps that are opened, not run in a terminal: T3 Code, DeepSeek Harness
  dsh.js        DeepSeek Harness: writes the running models into its settings, as text
  machines.js   connected machines (each followed by long-poll), your Tailscale machines, key-less pairing, installing on one
  update.js     the app updating itself from the repo it was cloned from
  util.js       paths, config, events, running commands
web/
  index.html    the page shell
  style.css     every style, in named sections
  app.js        starts the page: listens for presses and typing, follows the snapshot, redraws
  state.js      the snapshot, what the page remembers, and resolve()
  screens.js    every screen, as an arrangement of components
  desktop.js    the wide layout: top bar, Home, pages
  view.js       draws a screen into the page and fits the window to it
  actions.js    what buttons do (ACTS) and what screens fetch (LOAD)
  html.js       the `html` tag every piece of markup is written with; it escapes what is put into it
  markdown.js   a model card's Markdown as the app's own few tags
  format.js     how numbers, sizes and times are written
  art.js        the picture behind everything and the Background setting
  components/   the reusable pieces: icons, controls (buttons, switches, fields), layout (bars, rows, tables),
                home (title, stats, GPUs), models, agents, usage
electron/main.js   a window onto the page; starts the server if none is running; fits the window to the panel when the page shows it (preload.cjs)
electron/          also the Mac build's entitlements and before-pack.cjs, which puts a readable copy of the app in the bundle for installing on other machines
install.sh         user service + Omarchy web app
ios/               the iPhone app (Swift); its own README
tests/             e2e.mjs (the real desktop app, driven through its window), integration.mjs (the real server against
                   stand-in engines, Docker and a second machine), screens.mjs (every screen drawn), fuzz.mjs (hostile
                   input), and stand-ins/ (an engine, a Docker and an nvidia-smi that answer like real ones)
scripts/           release-mac.sh (the signed, notarized DMG), release-win.sh (the Windows installer), publish.sh (puts
                   a version where anyone can download it), get.sh (the one-line installer the website gives for Linux)

Interfaces

HTTP API

Every route is one line in ROUTES in server/index.js. All of them need Authorization: Bearer except the last four. Errors are { "error": "…" } with a 4xx or 5xx status.

<
Visits:3 Updated:2026-12-02 AI tools

Related