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).

Mirror of mlboydaisuke/Youtu-LLM-2B-CoreAI β€” the canonical repo (CoreAI Model Zoo). Updates land there first.

Youtu-LLM-2B β€” Apple Core AI (.aimodel)

Youtu-LLM-2B (Tencent) converted to Apple Core AI for iOS 27 / macOS 27 (beta) β€” the zoo's first Multi-head Latent Attention (MLA) model that runs on iPhone, and its first dense MLA (GLM-4.7-Flash brought MLA to the zoo but as a 30B Mac-only MoE).

Youtu-LLM-2B is a dense DeepSeek-V2/V3-style MLA decoder: 1.96B params, 32 layers, kv_lora_rank 512 Β· q_lora_rank 1536 Β· qk_nope 128 + decoupled qk_rope 64 (head_dim 192) Β· v_head_dim 128 Β· interleaved RoPE ΞΈ=1.6e6 Β· dense SwiGLU FFN (6144) Β· 128K context Β· weight-tied head Β· Llama-3 tokenizer. It has a reasoning ("thinking") mode (<think>…</think>) and native agentic/tool-use ability.

The MLA decode caches only the compressed latent ([512] + [64] rope key per token, 2Γ—[288] halves) instead of a full per-head K/V, and folds the KV up-projection into the query lift / value readout β€” a tiny KV cache that a custom absorbed-MLA flash-decode Metal kernel attends. Rides Apple's coreai-pipelined GPU engine via the decode-only loop-free export (async encode, on-GPU argmax sampling, on-device KV growth).

surface (int8 ship bundle) prefill (S=1) decode numerics
M4 Max (release llm-runner, greedy) 95.9 102.8 tok/s 16/16 top-1 = HF fp32 oracle
iPhone 17 Pro (PipelinedBench p=128 g=256; in-app warm ~24) 20.5 ~19 tok/s 16/16 Β· device ≑ Mac ≑ HF

Numerics: the authored Core AI model is token-exact to the fp32 HF reference (naive + absorbed forms, prefill cosine 1.000002, greedy 0 flips), and the int8 bundle running on the real GPU engine reproduces the oracle byte-for-byte, 16/16 on both prompts, on Mac and on the iPhone 17 Pro β€” the zoo ship gate.

Use it

CoreAIKit (SPM) β€” one line, on-device:

import CoreAIKit

let chat = try await ChatSession(catalog: "youtu-llm-2b")
let reply = try await chat.respond(to: "What can you do, offline?")
// downloads this repo once, then runs fully on-device; the <think> reasoning
// arrives as .thinking events, reply.content is the final answer

Or the ChatDemo runner (GUI + swift run chat-cli --model youtu-llm-2b), or the zoo's CoreAIChat app (pick Youtu-LLM 2B). 2B (β‰₯2 GB) bundles need the host app's com.apple.developer.kernel.increased-memory-limit entitlement.

Engine contract (decode-only static-[1,1] graph): set COREAI_CHUNK_THRESHOLD=1 before engine creation (prefill runs as pipelined S=1 steps); don't call engine.warmup() (it warms query length 256) β€” a 1-token generate after load is the warmup. Chat template: <|begin_of_text|><|User|>…<|Assistant|> (thinking mode on β†’ <think>…</think> then the answer).

Contents

  • gpu-pipelined/youtu_llm_2b_decode_absorbed_msdpa/ β€” the int8 per-block-32 (body + head) decode bundle with the absorbed-MLA flash-decode Metal kernel: metadata.json, the .aimodel (LanguageBundle), and the tokenizer. ~2.2 GB.
  • config.json β€” the source model config (for reference).

Conversion code and the full engineering notes live in the model zoo (conversion/export_youtu_decode_pipelined.py, models/macos/youtu.py + youtu_absorbed.py; the absorbed-MLA cache + flash-decode kernel are shared with GLM-4.7-Flash).

License

Weights follow Tencent's youtu-llm license (see license_link) β€” commercial use and redistribution of derivatives permitted with attribution; ⚠️ the license states Youtu-LLM is NOT intended for use within the European Union. The Core AI conversion adds no restrictions.

Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for coreai-community/Youtu-LLM-2B-CoreAI

Quantized
(16)
this model