Skip to content

hive: add apple-fm-worker (Apple on-device 3B as a WorkerBee) - #71

Open
adiled wants to merge 1 commit into
mainfrom
hive/apple-fm-worker
Open

adiled wants to merge 1 commit into
mainfrom
hive/apple-fm-worker

Conversation

@adiled

@adiled adiled commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Adds hives/apple-fm-worker/ — a sibling of ollama-worker that runs Apple's on-device 3B FoundationModel (via FoundationModels) as a local, network-free, key-free LLM.

What it does

  • Registers with humd over thrum and advertises model apple-3b-on-device, turning chi:"prompt" → chunk/finish — the same contract ollama-worker fulfills for a remote Ollama endpoint.
  • The Rust side (src/) mirrors ollama-worker but, instead of HTTP, it shells out to a small Swift bridge (bridge/gen) that wraps FoundationModels and streams NDJSON deltas.
  • Capability gate: on boot a gen --probe keeps the hive present-but-dormant when Apple Intelligence isn't available (off / asset not downloaded / unsupported region), mirroring how ollama-worker degrades when Ollama isn't running.

Lock-in is contained

The only Apple-specific code in the whole tree is bridge/gen.swift (+ probe.swift). No Apple symbols enter the Rust side; the bridge is #[cfg(target_os = "macos")]-gated, so non-mac builds of hum never reference it.

Verified in isolation (macOS 26, M5 Max 128GB)

  • gen --probe → {"event":"probe","available":true}
  • gen with a prompt → real on-device deltas + finish
  • Rust worker compiles, connects to a live humd, and hands its hello advertising apple-3b-on-device

Not yet

An end-to-end prompt routed through humd to the worker and back — that's the last gate before co-installation into the mac desktop bundle. Left as an isolated prototype for that reason.

A sibling of ollama-worker that runs Apple's on-device 3B FoundationModel
via FoundationModels — a local, network-free, key-free LLM. Registers with
humd over thrum, advertises model `apple-3b-on-device`, and turns
chi:"prompt" into chunk/finish tones.

The Rust side (src/) mirrors ollama-worker but, instead of HTTP to Ollama,
shells out to a small Swift bridge (bridge/gen) that wraps FoundationModels
and streams NDJSON deltas. The only Apple-specific code in the tree is
bridge/gen.swift (+ probe.swift); no Apple symbols enter the Rust side,
and the bridge is mac-gated. On boot a capability probe keeps the hive
present-but-dormant when Apple Intelligence isn't available.

Isolated prototype — verified in isolation on macOS 26 (M5 Max): probe
reports available, real on-device deltas stream, and the Rust worker
compiles + connects to a live humd advertising the model. Not yet
co-installed into the mac desktop bundle.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant