Skip to content

feat(local-llm): optional Atomic Chat Core engine, hidden behind an opt-in - #623

Merged
sosidudku1 merged 18 commits into
mainfrom
feat/atomic-core-engine
Oct 13, 2026
Merged

sosidudku1 merged 18 commits into
mainfrom
feat/atomic-core-engine

Conversation

@plombeer31

@plombeer31 plombeer31 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Adds Atomic Chat Core as an optional inference engine next to llama.cpp, for the terminal app and the runtime the desktop app uses.

What

  • Core install, version and checksum gate (Core 0.11.2, protocol 2), authenticated local daemon, model sessions, Stop that cancels pending starts.
  • Engine and model are separate controls for Local mode and for each Fusion role.
  • The engine choice is hidden by default. It appears only with ATOMIC_AGENT_EXPERIMENTAL_ATOMIC_CORE=1, or when the saved config already selects atomic-core, until Windows and Linux are validated. atomic-agent models engine status reports choiceEnabled. Existing installs stay on llama.cpp with no prompt, download or new network call.

Changes on top of the original draft

  • Merged current main: feat(local-models): speedy model switcher patch #621's model operation queue now owns start, stop and select ordering ("newer pick wins"); the engine and the queue signal reach chat and embedding starts.
  • llama.cpp users never touch the cross-process Core lock on stop, and Stop during another process's Core load is refused instead of reporting a stop that did nothing.
  • A queued message drained during a composer route change goes back to the head of the queue instead of overwriting the draft.
  • Stop cancels an engine choice still queued behind the load it stops; cancelled starts and embedding pairings no longer report a false failure.
  • Choosing an engine waits behind a loading model instead of cancelling it.

How it was verified

Merged together with #627 on current main: npm run build, lint, imports:check, docs:check, typecheck:tests, test:ci (1,135 files, 13,716 tests passed) and smoke:e2e all pass. Not yet validated: Windows and Linux native Core execution, which is why the choice stays hidden.

Desktop companion: #624.

Use the authenticated Core control API for backend acquisition and model ownership while preserving native inference endpoints. Keep engine changes explicit, verify release downloads, and carry cancellation and update status through the terminal interface.
@plombeer31 plombeer31 added pre-alfa atomic chat core Pre-alfa Atomic Chat Core integration baseline Baseline implementation for review and testing not ready for release Incomplete validation; exclude from releases labels Oct 8, 2026
Brings in #621 (queued local model switching), #625 (modelMode, config
v75) and #618 (compaction).

Conflict resolution:
- local-models-orchestrator: #621's ModelOperationQueue now owns
  serialization and supersession of starts, stops and selections, so the
  branch's startGeneration counter is dropped. setActive keeps #621's
  queued request; the Core engine and its signal are passed through to the
  chat and embedding starts. Core loads are still tracked so Stop and
  shutdown can cancel a non-replacing embedding start the queue would not
  abort; the queue signal and the Stop signal are combined. stopGeneration
  and captureStopGuard stay for composer route changes. chooseEngine runs
  through the queue so an engine change supersedes a waiting start.
- daemon-lifecycle: keep both engine and healthTimeoutMs/signal options.
- models start: runLocalModelsStart takes { interactive, signal }.

The engine setting is an additive optional field defaulting to
llama-server, so no config migration is needed after v75.
…h no Core session

stopDaemon and stopEmbeddingDaemon ask Core first on every stop. That took
the cross-process engine lock and created the core folder even for users
who never chose Atomic Chat, so a busy or stale lock could make a plain
llama-server stop throw.
A model start resumes the message queue (#621). When that start belonged
to a composer engine or Fusion seat change, the drained message was moved
into the editor, replacing any draft, and the rest of the queue stalled.
It now returns to the head of the queue, and the queue resumes once the
route change ends.
Stop aborted Core loads with its own controller before the queue aborted
the start operation, so the start saw an unexpected error and reported
"start failed" for a load the operator had just cancelled. The queue now
aborts the start first and the remaining Core loads are cancelled after.
Shutdown follows the same order.
…lling it

The merge queued chooseEngine as a replacing operation, which aborted a
model that was loading. Engine selection promises never to stop a model,
so it now queues without replacing; the running check then refuses the
change with the usual "Stop local models" message.
…s in progress

The no-record fast path let Stop report success while another process was
still loading a Core model, whose record is written only when the load
finishes. The lock is now skipped only with no core folder at all, or with
no record and no operation lock files.
The choice waits in the queue without replacing the load, so Stop's abort
never reached it and the engine was saved after the stopped load. The
choice now checks the Stop guard before it runs and again before saving.
Stop cancels a Core embedding load that the queue does not own, and the
abort was reported as "embedding daemon failed". A start cancelled by
Stop, shutdown or a newer operation now ends quietly.
ATOMIC_AGENT_EXPERIMENTAL_ATOMIC_CORE=1, or a config that already selects
atomic-core, enables the choice. Frontends use this one helper.
Until Windows and Linux are validated, Local mode is back to the backend
and model controls, the Fusion engine lists offer only Local llama, and
choosing atomic-core from the TUI is refused with how to opt in. The
choice returns with ATOMIC_AGENT_EXPERIMENTAL_ATOMIC_CORE=1 or when the
config already selects atomic-core. The refresh snapshot carries the
flag as backend.atomicCoreChoice.
Desktop reads it to decide whether to offer Atomic Chat. The engine
command itself stays available without the opt-in.
@sosidudku1 sosidudku1 changed the title pre-alfa atomic chat core: runtime and TUI baseline — not ready for release feat(local-llm): optional Atomic Chat Core engine, hidden behind an opt-in Oct 12, 2026
@sosidudku1
sosidudku1 marked this pull request as ready for review October 12, 2026 11:43
@sosidudku1
sosidudku1 merged commit 1e0eaa9 into main Oct 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baseline Baseline implementation for review and testing not ready for release Incomplete validation; exclude from releases pre-alfa atomic chat core Pre-alfa Atomic Chat Core integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants