Views
No views yet
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).google/timesfm-2.5-200m-transformers
(Apache-2.0, 200M) converted to Apple Core AI .aimodel — the
zoo's first time-series forecasting
foundation model. A decoder-only patched transformer: feed it any univariate series, get a
128-step point + 10-quantile forecast, entirely on device.GraphModel.timesfm_2p5_200m_ctx2048_fp16.aimodel — the transformer graph (fp16, ~463 MB). Fixed context
2048 (64 patches); shorter series are front-padded + masked by the host, so one bundle
covers every context length ≤ 2048.
Inputs tok_in[1,64,64], cos/sin[1,64,80], attn_bias[1,1,64,64] →
outputs proj_point[1,64,1280], proj_q[1,64,10240].host/ — the Python host-DSP reference (timesfm_core.py, host_forecast.py): patching,
two-level RevIN (global + per-patch causal Welford), flip-invariance (2 graph calls on ±input),
continuous-quantile head, denormalization, positivity clamp. This is the exact spec the Swift
Forecaster follows.TimesFm2_5ModelForPrediction fp32 oracle)KitForecaster, AOT h18p): device forecast == Mac to 3 decimals
(Δ ≤ 0.001, fp16 GPU rounding).1import numpy as np, torch, coreai.runtime as rt, asyncio
2from host_forecast import forecast # host/host_forecast.py
3from timesfm_core import EngineCore # thin engine adapter (see host/)
4
5CFG = dict(patch=32, horizon=128, hidden=1280, layers=20, heads=16,
6 head_dim=80, inter=1280, q=9, oql=1024, eps=1e-6)
7model = asyncio.run(rt.AIModel.load("timesfm_2p5_200m_ctx2048_fp16.aimodel",
8 rt.SpecializationOptions.from_preferred_compute_unit_kind(
9 rt.ComputeUnitKind.gpu())))
10core = EngineCore(model.load_function("main"), torch.float16)
11series = torch.tensor(my_1d_series, dtype=torch.float32) # any length ≤ 2048
12mean_pred, full_pred = forecast(core, series, ctx_len=2048, cfg=CFG) # (128,), (128,10)1let forecaster = try await KitForecaster(catalog: "timesfm-2.5-200m")
2let out = try await forecaster.forecast(series) // [Float] → point + quantiles
3// out.mean (128-step), out.quantiles (128 × 10)