Skip to content
DollgirlMonsterPublic

About

LLM SSD/NVM streaming optimized for M1 Max

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

This fork: what differs from upstream

This is DollgirlMonster/emone, a private-use fork of Pummelchen/TinyTitan. emone was TinyTitan until 2026-11-20; TINYTITAN_* variables and ~/.tinytitan are no longer read. Everything below this section is upstream's README, with its names and commands changed to emone's. Its benchmarks were measured on upstream's 24 GB M3, not here. The fork's own changes:

Prefill for Qwen3.8-Flash-Next 125B-A6B 4-bit, tuned on an M1 Max (32-core GPU, 64 GB, model on an external Thunderbolt NVMe). On a 16,931-token prompt:

step prefill s tok/s output
upstream engine (fork point 0690c611, measured 2026-10-03) 474 36 reference
+ grouped-query QSA attention kernel 419-451 39 identical
+ PLE n-gram rows read concurrently 353-389 46 identical
+ 8,192-token chunks, parallel host key selection 297-301 57 identical
+ remaining scalar GEMMs and the shared expert on the MPP tensor ops 246-251 68 rounding
+ routed-expert tiles as grouped MPP GEMMs, run concurrently 213-215 79 rounding
+ QSA indexer and QSA attention on the simdgroup matrix units, 16,384-token chunks 156 108 rounding
+ 32,768-token chunks: this prompt in one chunk, no 547-token tail sweep (-7.0%) 141-151 115-120 identical
+ Gated-DeltaNet recurrence in 8-token WY chunks on the matrix units 141-149 117 rounding
+ QSA attention as masked dense flash tiles, key selection on the GPU 104 163 rounding
+ routed experts and dense projections on tiled QMMs, expert readahead 82.5 205 rounding
+ 64 x 64 QMM tiles 76.1 222 identical
+ router: 8 tokens per threadgroup 66.2 256 identical
+ QSA attention over packed 4-key blocks 61.4-62.9 269-276 rounding
+ PLE n-gram rows read 128 deep, repeated rows read once (9.4 s -> 2.1 s) 55.1-56.8 298-307 identical
+ shared-expert scalar gate in one dispatch per chunk, not one per token (7.0 s -> 1.5 s) 50.6 335 identical
+ router logits on the tiled QMM, then a top-k pass (82 ms -> ~5 ms per layer) 46.9-47.1 359-361 rounding
+ attention reads Q from a fragment-packed copy instead of holding it, K staged transposed (kernel 158 -> 118 ms) 43.7-44.2 383-387 identical
+ hyper-connection inject eight halves a thread (4.3 -> 2.0 ms per write, 96 writes) 43.4-43.5 389-390 identical

Speed against baseline so far (same M1 Max, same 16,931-token prompt):

baseline now speedup
Prefill, against the upstream engine (measured, back to back) 474.4 s 43.4 s 10.9x
Decode, 256 tokens, 12 GiB -> 16 GiB expert cache 5.06 tok/s 5.62 tok/s +11%

Before the last step, three reruns on a quiet machine (Time Machine off) measured 62.90, 62.53 and 76.62 s; the third had the same GPU span as the others, so its extra 14 s was host or drive interference. Those runs spent ~9.4 s before the GPU started: the PLE n-gram gather, 271K uncached 320-byte reads with only ~10 in flight. The drive gives ~18K reads/s at that depth and ~86K at 128 in flight, and the prompt repeats n-grams, so reading 128 deep and each row once cut it to 2.1 s with byte-identical output. Overlapping the gather with layer 0 was tried and measured worse (56.5-64.3 s): it competes with layer 0's expert reads on the same drive and hides at most ~1 s.

The other installed models (same M1 Max, the first 30,000 characters of the same prompt: 8,529 tokens, default chunking, 4-bit), before and after the same kernels plus causal flash attention for models without QSA:

model before now speedup
Qwen 3.6 35B-A3B 111.3 s 15.6 s 7.1x
Ornith 1.5 35B-A3B -- 15.9 s (same geometry as Qwen 3.6)
Qwen3.8 27B dense 644.0 s 92.6 s 7.0x

Each passed the paired surprisal A/B on its own weights (docs/m1-prefill-spike.md, spikes 19-20).

The 32K chunk took prefill from 154.7-159.9 s to 140.7-151.2 s (-7.0%) with byte-identical output and no change to decode. The 16 GiB cache (128 slots, up from 96) costs 4 GiB more resident memory (peak 21.5 GiB, no swap) and does not change prefill or output; it is capped at a third of RAM, so a Mac under 48 GB keeps the smaller cache. Decode had no measured upstream baseline on this machine, so its gain is stated against the previous default only.

The steps that change rounding passed a paired surprisal test against the switch-free engine: +0.011 nats per token over 512 teacher-forced tokens, t = +0.92, which is no measurable change. The full record is docs/m1-prefill-spike.md.

  • Where the settings live. The two QSA matrix-unit kernels are on by default, and only Qwen3.8 uses QSA. The MPP switches and the 32K chunk are set in Qwen3.8 4-bit's ModelProfile row, so no other model's output changes. EMONE_PREFILL_MPP_WIDE, EMONE_PREFILL_ROUTED_MPP, EMONE_QSA_SCORE_MMA and EMONE_PREFILL_QSA_MMA (each 0 or 1) override them. The profile's chunk is lowered to what a YaRN context allows.

  • Prefill chunks of 8,192, 16,384 and 32,768 tokens are allowed. Each chunk streams nearly the whole routed-expert corpus, so the number of chunks is the cost. A 32,768-token chunk fits a context up to 131,072 tokens; a larger context caps the profile's chunk back to 16,384.

  • tools/serve.sh <install> is a one-line launcher for an install anywhere, including an external drive. It loads the model on the first request, releases it after 15 idle minutes, and keeps the prefix cache on disk.

  • Server additions. Token-prefix frontier checkpoints restore the deepest cached prefix after a system-prompt edit. --prompt-cache-memory-ttl-seconds releases idle RAM snapshots, and GET /v1/prefill-progress reports prefill progress.

  • Menu bar status item. EmoneServer puts a network icon in the menu bar when it runs in a desktop session: the network unlit while it is idle, a new random path each step while it generates, and nothing once it exits. Its menu can show tok/s and memory beside the icon, and Quit stops the server as Ctrl-C does. --no-menu-bar turns it off; over SSH or under launchd it is not shown. GET /v1/status reports the same numbers over HTTP.

  • Measurement tools. tools/m1_spike.sh builds, tests and runs interleaved A/B prefill arms, reporting GPU work in gigacycles. EmoneCLI --score and tools/prefill_surprisal_ab.sh run the paired surprisal test for any prefill numerics change.

  • EmoneCLI --live-trace: a live view of decode, off by default. On a terminal (stdout is a TTY, TERM is not dumb, at least 78 columns and about 31 rows) it draws, in place and below your scrollback, the expert grid of the layer being computed, the router's picks, a one-line ribbon of the token's layers coloured by misses, the last two lines of generated text, and a four-line tail of stderr where error, warn and fail lines print red. When the run ends the last frame stays on screen and the full text and the held stderr are printed after it. Anywhere else the flag is ignored with a one-line note and nothing is drawn. The terminal size is read once, at the start.

    Each grid cell has two layers. The background is heat: how often the expert was picked recently (a decaying count, half-life 24 tokens, on a log scale), dim to warm. The foreground is the current token's pick: a green block in the middle of the cell for a cache hit, a solid red block for an SSD read. Colour depth follows COLORTERM and TERM (24-bit, 256 or 16 colours); NO_COLOR keeps the view, draws heat as block heights and picks as plain glyphs. A pick adopted from the predictive prefetch ring counts as a hit, as in the engine's own hit statistics.

    The grid follows the model: up to 256 experts is 16 columns of two-character cells (256 is 16 x 16), 257 to 512 is 32 columns of one-character cells (Qwen3.8's 512 is 32 x 16), and more than 512 bins consecutive experts into the same 32 x 16 cells. The pick list follows the model's top-k. A dense model has no routed experts, so it gets the output and log only, as does a terminal too short for the grid.

    It changes nothing the model computes. The decode hook copies the layer's top-k ids and the cache plan's miss positions, which decode has already read back, into a lock-free ring, and a separate thread draws about 20 frames a second from it, so the view is a sampled picture of the latest token. A full ring drops new events rather than slowing decode. Heat and the shading of experts believed cached (a mirror inferred from those events, least recently picked leaving first, not the engine's slot table) exist only in the renderer and are never read by routing, caching, prefetch or anything else in the engine; treat them as estimates. Build with -Xswiftc -DEMONE_NO_EXPERT_TRACE to remove the hook entirely, for an A/B against a build without it.


✨ NVMAI is now TinyTitan ! ✨

1

emone

Stars Views (14d) Last Commit Contact

emone is the fastest SSD streamer for AI models on a Mac.

What is new in each release lives in the Changelog.


✨ Full DeepSeek Harness Support with Plugins:
emone now is a first class member of DeepSeek Harness - including a Qwen 3.8 plugin with specific optimizations for emone. Awesome: You can also manage dsh workspaces and sessions which are distributed over many Mac's in your LAN/Tailscale network using our dsh plugin "dsh-lan-manager" and the manager cli.


✨ New Research Project:
TinyTitan Datacenter - Run large MOE LLM models on a distributed cluster of Mac Mini/Studio's while keeping them on SSD/NVMe for near linear scale of decode tok/s.

Benchmarks

Peak decode on a base 8-core M3 MacBook Pro with 24 GB. NA means the CPU engine does not serve that model: the MoE families stream their experts on the GPU + ANE path, and only the dense Qwen 3.5 models run on either engine.

Model Quantization GPU CPU
Qwen 3.5 2B (dense) 4-bit 53.73 tok/s 15.42 tok/s
Qwen 3.5 2B (dense) 8-bit 32.77 tok/s 15.83 tok/s
Qwen 3.5 4B (dense) 4-bit 26.18 tok/s 7.71 tok/s
Qwen-AgentWorld 35B-A3B 4-bit 21.74 tok/s NA
Ornith 1.5 35B-A3B 4-bit 21.65 tok/s NA
Qwen 3.6 35B-A3B 4-bit 21.41 tok/s NA
KAT-Coder-V2.5-Dev 35B-A3B 4-bit 17.86 tok/s NA
Qwen 3.5 4B (dense) 8-bit 16.14 tok/s 7.04 tok/s
Qwen 3.5 9B (dense) 4-bit 14.93 tok/s 4.07 tok/s
Qwen 3.6 35B-A3B 8-bit 12.37 tok/s NA
Qwen-AgentWorld 35B-A3B 8-bit 12.28 tok/s NA
Ornith 1.5 35B-A3B 8-bit 11.93 tok/s NA
Qwen 3.5 9B (dense) 8-bit 8.90 tok/s 4.51 tok/s
KAT-Coder-V2.5-Dev 35B-A3B 8-bit 6.91 tok/s NA
Qwen3.8-Flash-Next 125B-A6B 4-bit 5.46 tok/s NA
Qwen3.8-Flash-Next 125B-A6B 8-bit 2.10 tok/s NA

Supported LLMs

Every model installs at 4-bit and 8-bit:

  • Qwen3.8-Flash-Next 125B-A6B
  • KAT-Coder-V2.5-Dev 35B-A3B
  • Qwen-AgentWorld 35B-A3B
  • Ornith 1.5 35B-A3B
  • Qwen 3.6 35B-A3B
  • Qwen 3.5 9B
  • Qwen 3.5 4B
  • Qwen 3.5 2B
  • Qwen 3.5 0.8B — a side model for session titles and one-word answers, not a chat model (8-bit verified; 4-bit installs but is untested)

Usage

Already installed? These three commands cover what most people want, and the wiki Cookbook has a copy-paste recipe for each task — the API, a coding client, JSON output, memory, long context, the CPU engine — with the output you should expect.

tools/install_models.sh                                         # what is installed
.build/release/EmoneCLI --model models/qwen3.5_2B_4Bit \
  --prompt "The capital of France is" --max-new 32 --temperature 0
tools/server_launcher.sh --client codex --model qwen38 --bits 4   # API + Codex

Generated text goes to stdout; the timing footer goes to stderr, so a pipeline sees only the answer. Nothing installed yet? Start with Getting Started.

  • Easiest install: one command checks the Mac, downloads emone's prebuilt arm64 binaries, optionally downloads a model, and leaves a emone command that starts the server — then offers to start it, so you finish with a base URL to point a client at. Safe to re-run; a second run updates what is already installed instead of fetching it twice.
    bash -c "$(curl -fsSL https://raw.githubusercontent.com/Pummelchen/TinyTitan/main/tools/install_emone.sh)"
    Use that form, not curl … | bash. A pipe makes the script's stdin the pipe, so it cannot ask anything and takes the default at every step — including the model download and the browser window. bash -c "$(curl …)" downloads the script first and runs it with your terminal still on stdin, so the questions work. From a clone or an unzipped download, bash tools/install_emone.sh does the same and never needs chmod +x, and --help lists its flags. Nothing needs Homebrew, Xcode, git or Node, and no Python is needed to install or to start the server: the engine arrives built for arm64. Only the model converters use Python, and for the models the repacker streams itself the installer prints the command that needs none.
  • A chat window, if you want one: the installer can also set up emone's own DeepSeek Harness — a local page in your browser with a prompt box, already pointed at the model you installed. --web does it in one step, or answer yes when the installer asks. It opens with ~/.local/bin/emone-web (or tools/server_launcher.sh --web). It is installed under ~/.emone, pinned to a tested DeepSeek Harness version, and kept isolated from any DeepSeek Harness you run yourself, so our copy and yours never share a config, a session or a port; see tools/dsh_local.sh. This is a client in the browser, not a bundled app — the engine and its server remain the product.
  • OpenAI-compatible server: A loopback Chat Completions and Responses API for starting emone and connecting supported coding clients.
  • One server, one port, one launcher: tools/server_launcher.sh starts the API on its own, or starts it and opens one of the supported clients — Codex, Claude Code, Qwen Code, OpenCode or the Zed editor — wiring that client's provider config to the model the server advertises. It asks what to launch from one list of every installed model and quantization (GPU and CPU), the thinking level that model supports, and an optional RAM target for the server process (any whole GB from 4 up — the interactive question offers 4, 8, 16 or 32; anything over 30% of the Mac's physical memory is warned about in red and used anyway, and the default is the install's own measured profile, which the runtime holds to a third of physical memory). It serves on 127.0.0.1:8080 by default — the launcher asks for the port, and --port or EMONE_PORT sets it — and every other installed model stays available by name through the API; the server switches on demand, keeping one model resident at a time.
tools/server_launcher.sh                                       # interactive
tools/server_launcher.sh --client codex --model ornith --bits 4  # server + Codex
tools/server_launcher.sh --client zed --model qwen38 --bits 4 --ram 8
  • Persistent agent memory (optional): With EMONE_MEMORY=1 the model gets memory that outlives a conversation, scoped per repository, with six memory tools the engine answers itself. It runs inside the server process, so there is no database to install and nothing to start. Off by default; see docs/agent-memory.md.
  • Three client protocols on one server: OpenAI Chat Completions, the OpenAI Responses API (stored responses, previous_response_id, the full event grammar) and the Anthropic Messages API (/v1/messages, count_tokens, streaming), so Codex, Claude Code and the OpenAI and Anthropic SDKs all talk to the same model; see docs/server-api.md.
  • Enforced structured output: a request may ask for JSON — response_format on Chat Completions, text.format on the Responses API, output_config.format on Messages — and the server compiles the schema into a byte-level grammar that masks the sampler on both engines, so the model can only emit a document the schema allows rather than being asked nicely for one. The supported schema subset is small and explicit, and everything outside it is refused by name; see docs/structured-output.md.
  • Tested coding CLIs: The launch workflow supports Codex, Claude Code, Qwen Code, OpenCode and the Zed editor against the local server; the coder benchmark scores the four that can be prompted (Claude Code through a loopback Anthropic shim) and checks every client's wiring without a model (--round clients); DeepSeek Harness reaches the server through its own llm-pi-ai provider route, which tools/dsh_route.sh generates from the installed models (and plugins/dsh-emone keeps current inside the harness, adding a compaction backend that does not think) — see Connect a client.
  • CLI and tools: emone also provides direct CLI generation, streaming responses, and client-authorized function-tool calls.

Core Benefits

  • emone streams LLM's faster than any other similar project.
  • Run large MOE AI models on low RAM Apple Silicon Macs by keeping the AI model on SSD/NVMe.
  • A 125B model on 8 GB of RAM. emone streams experts straight from SSD, so model size is bounded by your disk space, not your memory.
  • You set the RAM budget. emone stays inside it. Give it 4 GB or 8 GB — it holds the line, so your Mac stays responsive while the model runs.
  • Apple Neural Engine acceleration for prompt processing - 2.3× faster than the GPU cores.
  • Our own Metal kernels, our own engine. Purpose-built for Apple silicon and engineered to use your Mac at the physical limit.
  • No MLX. No GGUF. emone ships its own high-speed model format and a converter that builds it straight from the original weights.

Special Features

  • Bounded expert RAM: The resident expert cache is sized per family from the model's own expert stride and clamped to a third of physical memory, so a smaller Mac is not handed a budget tuned on a larger one. --ram names a target for the whole server process, not the cache: the runtime subtracts the weight file and a measured ~0.5 GB runtime reserve, then steps down the slot ladder to the largest cache that fits, so an 8 GB target lands at about a 4 GB cache (32 slots) on the 125B install. It is wired, so it cannot be paged out and everything else the Mac is running has to fit beside it: the launcher recommends 30% of physical memory and warns in red above it — swapping, a less stable system and slower tokens — but a larger target is your call and is passed on. The target covers the resident weights, the runtime floor and the cache for a short request; a long context's KV grows on top of it.
  • Long context: Native RoPE supports up to 262K tokens, while optional YaRN extends the context to 512K or 1M tokens.
  • Compressed KV cache: Live attention state can use 16-bit, 8-bit, or 4-bit storage independently of the installed model quantization.
  • Thinking mode: Ornith and Qwen support truthful Off/On reasoning control; their chat templates do not define Low, Medium, or High effort levels.
  • MTP off by default: Native speculative decoding remains experimental and disabled because measured Ornith runs showed no speed benefit and it currently requires greedy decoding, native RoPE, and prompt-cache reuse off.

Performance Improvements

  • Tiled Top-K sampling: Production sampling (Top-K 1–64) runs a three-stage tiled GPU reduction, cutting per-token sampling cost from 15.5 ms to 1.4 ms with a token-for-token identical stream — the main source of the v4.6 decode gain.
  • ANE prefill: EMONE_PREFILL_ANE=on runs full-attention prefill blocks on the Neural Engine from a one-time exported Core ML sidecar, roughly halving long-prompt time to first token; short prompts and decode are untouched.
  • Follow-up cache: Exact live and multi-prefix prompt-state reuse avoids repeating compatible prefill work across conversation turns.
  • Concise mode: An optional terse system prompt reduces generated text for workloads that benefit from it; standard responses are the default because they generalized more reliably in the coding/tooling qualification.
  • Fast alias: The chat-only -fast model alias strips coding-agent boilerplate before prefill for quicker direct answers, while the base alias preserves tools and agent loops.

Core Links

Credits

emone is a focused fork of drumih/turbo-fieldfare, whose bounded-memory runtime, installer, CLI and local server this project builds on. The Qwen 3.6 integration was created by NeelM0906 in upstream PR #29. Concise mode is derived from the Nail-Qwen3.6-35B-A3B chat template by peculiar-ragdoll.

License

Apache License 2.0 — see LICENSE and NOTICE. Copyright (c) 2026 André Borchert.

Contact

Questions, bug reports and suggestions are always welcome. You can contact André Borchert by email at 0xa0b1@gmail.com.

About

LLM SSD/NVM streaming optimized for M1 Max

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages