mlboydaisuke/Nemotron-3-Nano-4B-CoreAI

Model

0

stars

14

commits

4

linked in READMEs

Sep 7, 2026

updated

apple-silicon
core-ai
coreai
coreai-aimodel
coreml
hybrid
ios
iphone-17-pro
m4-max
macos
mamba2
nemotron-h
nvidia-nemotron-3
on-device
ssm
tokens-per-second
Browse cluster: On-Device LLM Inference & Apple Silicon

README

Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta, 2026-06).

Nemotron-3-Nano-4B — Core AI

Nemotron-3 Nano 4B (hybrid Mamba-2 / Transformer, NVIDIA) running on Apple Core AI — measured 16.0 tok/s decode on iPhone 17 Pro and 85.2 tok/s on an M4 Max GPU, greedy output token-identical to fp32. Same-model llama.cpp / MLX numbers on the M4 Max (88.4 / 176.8 tok/s, 4-bit): apple-silicon-llm-bench, results/hybrid.

Decode-only (S=1) Core AI bundles for NVIDIA's Mamba2 + attention + MLP hybrid (42 blocks: 21 Mamba2 / 17 MLP / 4 GQA NoPE attention), int8 weights with an absmax int8 head. No custom Metal kernel — at S=1 the selective scan is a single recurrence step, so the graph is loop-free.

variantassetfor
gpu-pipelined/nemotron_3_nano_4b_decode_int8hu.aimodelMac (JIT specialization)
ios-h18p/nemotron_3_nano_4b_decode_int8hu.h18p.aimodelciPhone (AOT — a 4B graph cannot specialize on-device)

Use it

One line — run the kit's task op on this model (import CoreAIOps; no session, no model plumbing, downloads on first use):

let tldr = try await CoreAI.summarize(text, options: .model("nemotron-3-nano-4b"))

Every op, one shape — Cookbook.

▶️ Run it (source) — the ChatDemo runner (GUI + CLI, one app for every chat model in the catalog):

git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
# → Run, then pick "Nemotron-3-Nano 4B" in the model picker

# agents / headless (macOS):
cd coreai-kit/Examples/ChatDemo
swift run chat-cli --model nemotron-3-nano-4b --prompt "What can you do, offline?"

💻 Build with it — complete; the glue is kit API, copy-paste runs:

import CoreAIKit

let chat = try await ChatSession(catalog: "nemotron-3-nano-4b")
let reply = try await chat.respond(to: prompt)
// reply: the answer, generated fully on-device

The take-home is Examples/ChatDemo/Sources/QuickStart.swift — this exact code as one typed function, no UI; the CLI is an argument shell over it, and the GUI drives the same ChatSession across turns for its transcript. Multi-turn? Hold the ChatSession and call respond(to:) per turn — it keeps the conversation history; streamResponse(to:) yields tokens as they decode.

Integration checklist

  • SPM: https://github.com/john-rocky/coreai-kit → product CoreAIKit
  • Info.plist: none needed
  • Entitlements: iOS needs com.apple.developer.kernel.increased-memory-limit — a 4.3 GB bundle is past the default jetsam limit
  • First run downloads the model — 4.6 GB (Mac) / 4.6 GB (iPhone) — then it loads from the local cache (Application Support; progress via the downloadProgress callback)
  • Measure in Release — Debug is ~3× slower on per-token host work

Measured: 16.0 tok/s decode on an iPhone 17 Pro (cooled, AOT h18p, bandwidth-saturated) and 85.2 tok/s on an M4 Max GPU. Greedy output is token-identical to the fp32 transformers rollout on the probe prompts.

Requires COREAI_CHUNK_THRESHOLD=1 (S=1 bundle) and an engine that carries two extra fixed-shape states (the Mamba conv columns + SSM state) alongside the KV cache.

Port + recipe: coreai-model-zoo / nemotron-3-nano


More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.

Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.

Contributors

mlboydaisuke

14 commits

mlboydaisuke/Nemotron-3-Nano-4B-CoreAI

Model

0

stars

14

commits

4

linked in READMEs

Sep 7, 2026

updated

apple-silicon
core-ai
coreai
coreai-aimodel
coreml
hybrid
ios
iphone-17-pro
m4-max
macos
mamba2
nemotron-h
nvidia-nemotron-3
on-device
ssm
tokens-per-second
Browse cluster: On-Device LLM Inference & Apple Silicon

README

Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta, 2026-06).

Nemotron-3-Nano-4B — Core AI

Nemotron-3 Nano 4B (hybrid Mamba-2 / Transformer, NVIDIA) running on Apple Core AI — measured 16.0 tok/s decode on iPhone 17 Pro and 85.2 tok/s on an M4 Max GPU, greedy output token-identical to fp32. Same-model llama.cpp / MLX numbers on the M4 Max (88.4 / 176.8 tok/s, 4-bit): apple-silicon-llm-bench, results/hybrid.

Decode-only (S=1) Core AI bundles for NVIDIA's Mamba2 + attention + MLP hybrid (42 blocks: 21 Mamba2 / 17 MLP / 4 GQA NoPE attention), int8 weights with an absmax int8 head. No custom Metal kernel — at S=1 the selective scan is a single recurrence step, so the graph is loop-free.

variantassetfor
gpu-pipelined/nemotron_3_nano_4b_decode_int8hu.aimodelMac (JIT specialization)
ios-h18p/nemotron_3_nano_4b_decode_int8hu.h18p.aimodelciPhone (AOT — a 4B graph cannot specialize on-device)

Use it

One line — run the kit's task op on this model (import CoreAIOps; no session, no model plumbing, downloads on first use):

let tldr = try await CoreAI.summarize(text, options: .model("nemotron-3-nano-4b"))

Every op, one shape — Cookbook.

▶️ Run it (source) — the ChatDemo runner (GUI + CLI, one app for every chat model in the catalog):

git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
# → Run, then pick "Nemotron-3-Nano 4B" in the model picker

# agents / headless (macOS):
cd coreai-kit/Examples/ChatDemo
swift run chat-cli --model nemotron-3-nano-4b --prompt "What can you do, offline?"

💻 Build with it — complete; the glue is kit API, copy-paste runs:

import CoreAIKit

let chat = try await ChatSession(catalog: "nemotron-3-nano-4b")
let reply = try await chat.respond(to: prompt)
// reply: the answer, generated fully on-device

The take-home is Examples/ChatDemo/Sources/QuickStart.swift — this exact code as one typed function, no UI; the CLI is an argument shell over it, and the GUI drives the same ChatSession across turns for its transcript. Multi-turn? Hold the ChatSession and call respond(to:) per turn — it keeps the conversation history; streamResponse(to:) yields tokens as they decode.

Integration checklist

  • SPM: https://github.com/john-rocky/coreai-kit → product CoreAIKit
  • Info.plist: none needed
  • Entitlements: iOS needs com.apple.developer.kernel.increased-memory-limit — a 4.3 GB bundle is past the default jetsam limit
  • First run downloads the model — 4.6 GB (Mac) / 4.6 GB (iPhone) — then it loads from the local cache (Application Support; progress via the downloadProgress callback)
  • Measure in Release — Debug is ~3× slower on per-token host work

Measured: 16.0 tok/s decode on an iPhone 17 Pro (cooled, AOT h18p, bandwidth-saturated) and 85.2 tok/s on an M4 Max GPU. Greedy output is token-identical to the fp32 transformers rollout on the probe prompts.

Requires COREAI_CHUNK_THRESHOLD=1 (S=1 bundle) and an engine that carries two extra fixed-shape states (the Mamba conv columns + SSM state) alongside the KV cache.

Port + recipe: coreai-model-zoo / nemotron-3-nano


More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.

Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.

Contributors

mlboydaisuke

14 commits