HiramKHackenbacker commited on
Commit
8ad3ca0
Β·
verified Β·
1 Parent(s): 4156344

model card: standard structure, measured facts, verified license declarations

Browse files
Files changed (1) hide show
  1. README.md +164 -76
README.md CHANGED
@@ -3,6 +3,7 @@ license: other
3
  license_name: lfm1.0
4
  license_link: https://huggingface.co/LiquidAI/LFM2.5-2.6B/blob/main/LICENSE
5
  base_model: LiquidAI/LFM2.5-2.6B
 
6
  library_name: coreai
7
  pipeline_tag: text-generation
8
  tags:
@@ -10,6 +11,7 @@ tags:
10
  - aimodel
11
  - apple-silicon
12
  - on-device
 
13
  - quantized
14
  - int8
15
  - lfm2.5
@@ -18,43 +20,17 @@ tags:
18
  # LFM2.5-2.6B β€” Core AI (.aimodel)
19
 
20
  `LiquidAI/LFM2.5-2.6B` converted to Core AI `.aimodel` bundles for Apple silicon by
21
- [visible-cx](https://huggingface.co/visible-cx). These are derivative artifacts: Liquid
22
- AI's weights re-expressed as a Core AI graph with int8 block-32 symmetric weight
23
- quantization and a two-entrypoint (decode + chunked-prefill) function map. They load
24
- through Core AI on macOS and are not usable by PyTorch, GGUF or MLX.
 
 
25
 
26
- Of the dense LFM2.5 bundles published here, this is the strongest on guided
27
- structured-output work and the only one qualified for long context: **3/3 verbatim needle
28
- recall at 14,566 tokens, sustaining 32 tok/s for under half a gigabyte of in-process
29
- footprint.**
30
-
31
- ## Provenance
32
-
33
- | | |
34
- |---|---|
35
- | Base checkpoint | `LiquidAI/LFM2.5-2.6B` |
36
- | Recipe | `export_lfm2_multifunction.py int8hu --head-sym --chunk 64` |
37
- | Toolchain base | `apple/coreai-models` @ `b1cb71b8522d99408059fa0b98b8742171bcb0b8` + the [coreai-model-zoo](https://github.com/john-rocky/coreai-model-zoo) python overlay |
38
- | Toolchain | `coreai-torch 0.4.1`, `coreai-core 1.0.0b2`, `coreai-opt 0.2.1`, `torch 2.9.0` |
39
- | Producer fingerprint | `coreai-core 1.0.0b2` on every inner `<name>.aimodel/metadata.json` |
40
- | Weight format | int8, per-K-block-32, symmetric; symmetric head (`--head-sym`) |
41
- | Vocab | 128,000 |
42
- | Export functions | `main` (S=1 decode) + `prefill` (S=64 chunked prefill), `function_map: {"main": ["main", "prefill"]}`, weights deduplicated across entrypoints |
43
-
44
- `mf64` in the bundle name means multifunction with a 64-wide prefill; the prefill function
45
- costs well under a megabyte.
46
-
47
- **Chat template.** LFM2.5-2.6B is an always-thinking model. The template shipped in every
48
- bundle here **terminates the reasoning block in the generation prompt**:
49
-
50
- ```jinja
51
- {{- "<|im_start|>assistant\n<think></think>\n" -}}
52
- ```
53
-
54
- An unterminated block (`…assistant\n<think>`) causes the model to spend the entire
55
- generation budget inside `<think>`, which a host routes to a reasoning channel and never to
56
- the response β€” 684–919 tokens per item, with no visible output. If you rebuild from the
57
- recipe, apply the same termination.
58
 
59
  ## Contents
60
 
@@ -71,37 +47,69 @@ Each folder holds `<name>.aimodel/` (`main.mlirb` β‰ˆ 3.64 GB, `main.hash`, asse
71
  **The three folders hold the same weights and the same graph** β€” function signatures, state
72
  descriptors and peak export RSS are identical at 4096, 8192 and 16384. `--max-ctx` changes
73
  exactly one thing: `language.max_context_length` in the bundle manifest. The small byte
74
- differences between folders are conversion nondeterminism, not content. Pick the folder
75
- whose manifest integer matches the window you intend to run.
76
 
77
  **Stop token:** `eos_token = "<|im_end|>"` in all three folders. Clean self-stop on every
78
  measured sample.
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  ## Requirements
81
 
82
  - **Apple silicon Mac**, Core AI runtime.
83
  - **Engine contract: 2 inputs.** `input_ids`, `position_ids` β†’ logits. No static inputs, no
84
- per-step mask. Runs on both the pipelined engine and the sequential (logits-capable)
85
- engine, which is what makes grammar-constrained decoding available.
86
  - **States:** `keyCache` / `valueCache` `Float16, 8 Γ— 1 Γ— 8 Γ— ? Γ— 64` plus
87
- `convState Float16, 22 Γ— 1 Γ— 2048 Γ— 2`. The sequence dim is dynamic, so the runtime
88
- resolves a `GrowingKVCache` (initial capacity 256, doubling) rather than allocating the
89
- manifest maximum up front. `convState` is fixed-size and does not scale with context.
90
  - **KV cost: 16,384 bytes per token of context** (fp16) β€” 67 MB at 4096, 134 MB at 8192,
91
- 268 MB at 16384.
92
- - **Memory envelope, 16 GB Mac** (Metal `recommendedMaxWorkingSetSize` β‰ˆ 10.7 GB):
93
- weights 3.64 GB resident, so KV is not the binding constraint at any context this bundle
94
- declares. Measured max RSS **6.71 GB** on guided decoding and 7.30 GB at 15k context;
95
- peak in-process footprint 0.48 GB and 0.46 GB respectively β€” essentially flat in context.
96
- **Minimum practical machine memory: 16 GB**, at any declared context including 16384.
97
  - The bundle manifest declares `runtime_env COREAI_CHUNK_THRESHOLD=1`.
98
 
99
- ## Performance
 
 
 
 
100
 
101
- Measured on a **16 GB Apple silicon Mac (M2 Pro, macOS 27 beta)**: 10-sample harness,
102
- guided JSON-constrained decoding against a fixed schema, greedy, sequential engine,
103
- `reset()` between samples, 128-token cap. Load excluded from `s/row`; sample 1 excluded as
104
- a cache-warm outlier.
105
 
106
  | | |
107
  |---|---|
@@ -115,9 +123,29 @@ a cache-warm outlier.
115
  | Peak footprint | 0.48 GB |
116
  | Max RSS | 6.71 GB |
117
 
118
- For scale on the same machine and harness: LFM2.5-350M runs 0.84/0.55 s/row and
119
- LFM2.5-1.2B 1.89/1.37 s/row. The 2.6B is β‰ˆ2Γ— the 1.2B, which is what its parameter count
120
- predicts, and it produces the most specific free-text fields of the three.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  ### Long context
123
 
@@ -131,8 +159,8 @@ verbatim, including the date.
131
  | needle 8k | 7,813 | 13.78 s | 35.8 tok/s | 15.4 s | 0.34 GB |
132
  | needle 15k | 14,566 | 27.42 s | **32.2 tok/s** | 29.1 s | 0.46 GB |
133
 
134
- Free-form generation from a fixed prompt at three depths, 900-token cap (the model
135
- self-stopped inside it every time):
136
 
137
  | depth | prompt tokens | TTFT | decode | generated | wall | peak footprint |
138
  |---|---|---|---|---|---|---|
@@ -140,31 +168,91 @@ self-stopped inside it every time):
140
  | 8k | 7,673 | 14.84 s | 36.6 tok/s | 715 | **36.0 s** | 0.47 GB |
141
  | 12k | 11,643 | 22.24 s | **32.9 tok/s** | 743 | **44.4 s** | 0.46 GB |
142
 
143
- **Decode barely moves with depth.** 40.0 tok/s at 2.3k β†’ 35.3 at 3.2k β†’ 36.6 at 7.7k β†’
144
- 32.9 at 11.6k: an 18% decay across a 5Γ— context increase. It sustains 32–33 tok/s at
145
- 11.6–14.5k tokens with under half a gigabyte of in-process footprint. High context costs
146
- prefill time and almost nothing else β€” TTFT scales cleanly (4.8 β†’ 6.9 β†’ 14.8 β†’ 22.2 β†’
147
- 27.4 s) while footprint stays flat. The KV term is `GrowingKVCache`-dynamic and small at
148
- this size (16 KB/token β†’ 268 MB at 16384).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
  ## Status
151
 
152
  | Artifact | Status |
153
  |---|---|
154
- | `gpu-pipelined/…_mf64` (ctx 4096) | **SHIP** β€” measured: 10/10 guided parse and enum-clean, 3.66/3.06 s/row, 38.1–40.0 tok/s. |
155
  | `ctx8192/…_mf64` | **QUALIFIED AT DEPTH** β€” same weights and graph; measured: 3/3 verbatim needle recall at 7,813 tokens, 36.6 tok/s at 8k, 0.47 GB peak footprint. |
156
- | `ctx16384/…_mf64` | **QUALIFIED AT DEPTH** β€” 3/3 verbatim needle recall at 14,566 tokens at 32.2 tok/s, 0.46 GB peak footprint, 7.30 GB max RSS. Recommended for long-context work. |
157
 
158
- No oracle or PSNR gate has been run against a PyTorch reference. Qualification is
159
- behavioural (parse rate, enum conformance, content sanity, clean stop, needle recall), not
160
- a numerics gate.
161
 
162
  ## License
163
 
164
- `LiquidAI/LFM2.5-2.6B` is released under the **LFM Open License v1.0** (`lfm1.0`). These
165
- bundles are a derivative of that checkpoint and the same licence and its obligations travel
166
- with them β€” see the
167
  [upstream licence](https://huggingface.co/LiquidAI/LFM2.5-2.6B/blob/main/LICENSE). Anyone
168
- redistributing these files should redistribute the licence with them and comply with its
169
- terms. Nothing here relicenses Liquid AI's weights; the contribution is the conversion
170
- recipe and the qualification evidence.
 
3
  license_name: lfm1.0
4
  license_link: https://huggingface.co/LiquidAI/LFM2.5-2.6B/blob/main/LICENSE
5
  base_model: LiquidAI/LFM2.5-2.6B
6
+ base_model_relation: quantized
7
  library_name: coreai
8
  pipeline_tag: text-generation
9
  tags:
 
11
  - aimodel
12
  - apple-silicon
13
  - on-device
14
+ - coreai-kit
15
  - quantized
16
  - int8
17
  - lfm2.5
 
20
  # LFM2.5-2.6B β€” Core AI (.aimodel)
21
 
22
  `LiquidAI/LFM2.5-2.6B` converted to Core AI `.aimodel` bundles for Apple silicon by
23
+ [visible-cx](https://huggingface.co/visible-cx). These are derivative artifacts: Liquid AI's
24
+ weights re-expressed as a Core AI graph with int8 block-32 symmetric weight quantization and a
25
+ two-entrypoint (decode + chunked-prefill) function map. They load through Core AI on macOS and
26
+ are not usable by PyTorch, GGUF or MLX. This is the model the
27
+ [Visible](https://visible.cx) app routes **enrichment** to β€” per-item labelling and tagging,
28
+ where comprehension on argumentative text matters and a few seconds per item is acceptable.
29
 
30
+ Of the dense LFM2.5 bundles published here, this is the strongest on guided structured-output
31
+ work, the only one qualified for long context, and **the best-grounded local model this project
32
+ has measured**: 3/3 verbatim needle recall at 14,566 tokens, and zero invented attributors on
33
+ the real graph.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  ## Contents
36
 
 
47
  **The three folders hold the same weights and the same graph** β€” function signatures, state
48
  descriptors and peak export RSS are identical at 4096, 8192 and 16384. `--max-ctx` changes
49
  exactly one thing: `language.max_context_length` in the bundle manifest. The small byte
50
+ differences between folders are conversion nondeterminism, not content. Pick the folder whose
51
+ manifest integer matches the window you intend to run.
52
 
53
  **Stop token:** `eos_token = "<|im_end|>"` in all three folders. Clean self-stop on every
54
  measured sample.
55
 
56
+ **Chat template.** LFM2.5-2.6B is an always-thinking model. The template shipped in every
57
+ bundle here **terminates the reasoning block in the generation prompt**:
58
+
59
+ ```jinja
60
+ {{- "<|im_start|>assistant\n<think></think>\n" -}}
61
+ ```
62
+
63
+ An unterminated block (`…assistant\n<think>`) causes the model to spend the entire generation
64
+ budget inside `<think>`, which a host routes to a reasoning channel and never to the response β€”
65
+ 684–919 tokens per item, with no visible output. If you rebuild from the recipe, apply the same
66
+ termination.
67
+
68
+ ## Provenance
69
+
70
+ | | |
71
+ |---|---|
72
+ | Base checkpoint | `LiquidAI/LFM2.5-2.6B` |
73
+ | Recipe | `export_lfm2_multifunction.py int8hu --head-sym --chunk 64` |
74
+ | Toolchain base | `apple/coreai-models` @ `b1cb71b8522d99408059fa0b98b8742171bcb0b8` + the [coreai-model-zoo](https://github.com/john-rocky/coreai-model-zoo) python overlay |
75
+ | Toolchain | `coreai-torch 0.4.1`, `coreai-core 1.0.0b2`, `coreai-opt 0.2.1`, `torch 2.9.0` |
76
+ | Producer fingerprint | `coreai-core 1.0.0b2` on every inner `<name>.aimodel/metadata.json` |
77
+ | Weight format | int8, per-K-block-32, symmetric; symmetric head (`--head-sym`) |
78
+ | Vocab | 128,000 |
79
+ | Export functions | `main` (S=1 decode) + `prefill` (S=64 chunked prefill), `function_map: {"main": ["main", "prefill"]}`, weights deduplicated across entrypoints |
80
+
81
+ `mf64` in the bundle name means multifunction with a 64-wide prefill; the prefill function
82
+ costs well under a megabyte.
83
+
84
+ The symmetric head is not incidental. Measured on the sibling 8B bundle in this org, an
85
+ **affine** head makes the compiler materialise two dequantised fp16 transposes of the whole
86
+ `vocab Γ— hidden` matrix β€” a gigabyte of graph constant that is never read. A symmetric
87
+ dequantize is a scale multiply the GPU delegate folds into the matmul.
88
+
89
  ## Requirements
90
 
91
  - **Apple silicon Mac**, Core AI runtime.
92
  - **Engine contract: 2 inputs.** `input_ids`, `position_ids` β†’ logits. No static inputs, no
93
+ per-step mask. Runs on both the pipelined engine and the sequential (logits-capable) engine,
94
+ which is what makes grammar-constrained decoding available.
95
  - **States:** `keyCache` / `valueCache` `Float16, 8 Γ— 1 Γ— 8 Γ— ? Γ— 64` plus
96
+ `convState Float16, 22 Γ— 1 Γ— 2048 Γ— 2`. The sequence dim is dynamic, so the runtime resolves
97
+ a `GrowingKVCache` (initial capacity 256, doubling) rather than allocating the manifest
98
+ maximum up front. `convState` is fixed-size and does not scale with context.
99
  - **KV cost: 16,384 bytes per token of context** (fp16) β€” 67 MB at 4096, 134 MB at 8192,
100
+ 268 MB at 16384. KV is not the binding constraint at any context this bundle declares.
101
+ - **Minimum practical machine memory: 16 GB**, at any declared context including 16384.
 
 
 
 
102
  - The bundle manifest declares `runtime_env COREAI_CHUNK_THRESHOLD=1`.
103
 
104
+ ## Measurements
105
+
106
+ Measured on a **16 GB Apple silicon Mac (M2 Pro, macOS 27 beta)**.
107
+
108
+ ### Guided structured output
109
 
110
+ 10-sample harness, guided JSON-constrained decoding against a fixed schema, greedy, sequential
111
+ engine, `reset()` between samples, 128-token cap. Load excluded from `s/row`; sample 1 excluded
112
+ as a cache-warm outlier.
 
113
 
114
  | | |
115
  |---|---|
 
123
  | Peak footprint | 0.48 GB |
124
  | Max RSS | 6.71 GB |
125
 
126
+ For scale on the same machine and harness: LFM2.5-350M runs 0.84/0.55 s/row and LFM2.5-1.2B
127
+ 1.89/1.37 s/row. The 2.6B is β‰ˆ2Γ— the 1.2B, which is what its parameter count predicts, and it
128
+ produces the most specific free-text fields of the three.
129
+
130
+ ### Memory, measured rather than inferred
131
+
132
+ `Max RSS` is a resident set, and a resident set counts clean mapped pages the kernel can drop
133
+ for free β€” so it is not what the machine has to give up. Measured with an external watchdog
134
+ sampling wired memory, on the bundle the app pins:
135
+
136
+ | | GiB |
137
+ |---|---:|
138
+ | bundle on disk | 3.404 |
139
+ | **compiled blob** | **4.185** |
140
+ | graph constant | 0.797 |
141
+ | blob Γ· bundle | 1.23Γ— |
142
+ | **wired, completed trace (3 legs)** | **4.300** |
143
+ | forecast (`blob Γ— 1.106`) | 4.628 |
144
+ | **requirement** (peak + 1.25 GiB in-flight floor) | **6.03** |
145
+
146
+ **This is the only completed trace this project has that checks the plateau law against a run
147
+ that finished**, and the law reads **7.6% high** β€” i.e. conservative, on the safe side. Wired Γ·
148
+ blob for this bundle is **0.96**.
149
 
150
  ### Long context
151
 
 
159
  | needle 8k | 7,813 | 13.78 s | 35.8 tok/s | 15.4 s | 0.34 GB |
160
  | needle 15k | 14,566 | 27.42 s | **32.2 tok/s** | 29.1 s | 0.46 GB |
161
 
162
+ Free-form generation from a fixed prompt at three depths, 900-token cap (the model self-stopped
163
+ inside it every time):
164
 
165
  | depth | prompt tokens | TTFT | decode | generated | wall | peak footprint |
166
  |---|---|---|---|---|---|---|
 
168
  | 8k | 7,673 | 14.84 s | 36.6 tok/s | 715 | **36.0 s** | 0.47 GB |
169
  | 12k | 11,643 | 22.24 s | **32.9 tok/s** | 743 | **44.4 s** | 0.46 GB |
170
 
171
+ **Decode barely moves with depth** β€” 40.0 tok/s at 2.3k β†’ 32.9 at 11.6k, an 18% decay across a
172
+ 5Γ— context increase β€” while peak footprint stays flat. High context costs prefill time and
173
+ almost nothing else.
174
+
175
+ ### Grounding
176
+
177
+ Three real report questions on a real knowledge graph, full scorer, watchdog attached:
178
+
179
+ | question | prompt tokens | generated | tok/s | inversion | invented attributor | unsupported spans | narration | 3rd-person refs | JSON |
180
+ |---|---:|---:|---:|---|---|---|---|---|---|
181
+ | `reputationalRisks` | 5,306 | 228 | 38.4 | **0** | **0** | 0/0 | 0% | 0 | ok |
182
+ | `headline` | 3,096 | 26 | 39.1 | **0** | **0** | 0/0 | 0% | 0 | ok |
183
+ | `profileSummary` | 4,444 | 140 | 38.0 | **0** | **0** | 0/0 | 0% | 0 | ok |
184
+
185
+ **Zero invented attributors on the real graph** β€” the defect the prompt recipe was built to
186
+ kill, and the one a synthetic corpus could not produce. One scorer flag was hand-adjudicated
187
+ and dismissed as a false positive: the "motive bait" list fired on the model *quoting* the
188
+ subject's own words verbatim from the evidence window, and attributing a statement is not
189
+ asserting an inner state.
190
+
191
+ Across a wider comparison this bundle holds the **highest report quotation validity of any
192
+ local model measured here β€” 67–83% real quotations**, against 0–29% for the smaller dense LFMs,
193
+ and it is the only local model that declines to answer rather than inventing one.
194
+
195
+ ## Usage
196
+
197
+ Swift Package Manager, via [CoreAIKit](https://github.com/john-rocky/coreai-kit) β€” a community
198
+ package, not affiliated with Apple, requiring macOS 27 beta:
199
+
200
+ ```swift
201
+ .package(url: "https://github.com/john-rocky/coreai-kit", branch: "main")
202
+ // target dependency: .product(name: "CoreAIKit", package: "coreai-kit")
203
+ ```
204
+
205
+ `ModelID` addresses a bundle as **repo + path + revision**, where `path` is the subtree in this
206
+ repo holding one complete bundle (`metadata.json` + `*.aimodel/` + `tokenizer/`). It downloads
207
+ from the Hub on first use and is cached afterwards:
208
+
209
+ ```swift
210
+ import CoreAIKit
211
+
212
+ let model = ModelID(
213
+ "visible-cx/LFM2.5-2.6B-CoreAI",
214
+ path: "ctx16384/gpu-pipelined/lfm2_5_2_6b_decode_int8hu_block32_sym_mf64")
215
+
216
+ var config = ChatSession.Configuration()
217
+ config.engineVariant = .sequential // required for guided / grammar-constrained decoding
218
+ config.temperature = nil // greedy
219
+
220
+ let chat = try await ChatSession(model: model, configuration: config)
221
+ for try await event in chat.streamResponse(to: "…") {
222
+ if case .response(let delta) = event { print(delta, terminator: "") }
223
+ }
224
+ ```
225
+
226
+ Pass `revision:` a Hub commit hash to pin an immutable bundle. `ChatSession(bundleAt:)` loads a
227
+ bundle directory already on disk. Leave `COREAI_CHUNK_THRESHOLD` alone β€” the manifest sets it.
228
+
229
+ ## Integrity
230
+
231
+ Core AI `.aimodel` bundles are **not byte-reproducible**: the exporter is not deterministic
232
+ even against itself, and two runs of the same command on the same host differ by a few dozen
233
+ bytes. Verify by digesting the exact published bytes rather than by rebuilding. Every bundle
234
+ carries `main.hash`, the raw 32 bytes of `sha256(main.mlirb)`, so a downloaded bundle can be
235
+ checked against itself; on the Hub the same value is recoverable from the LFS oid without
236
+ fetching the file.
237
 
238
  ## Status
239
 
240
  | Artifact | Status |
241
  |---|---|
242
+ | `gpu-pipelined/…_mf64` (ctx 4096) | **SHIP** β€” measured: 10/10 guided parse and enum-clean, 3.66/3.06 s/row, 38.1–40.0 tok/s, requirement 6.03 GiB from a completed wired trace. |
243
  | `ctx8192/…_mf64` | **QUALIFIED AT DEPTH** β€” same weights and graph; measured: 3/3 verbatim needle recall at 7,813 tokens, 36.6 tok/s at 8k, 0.47 GB peak footprint. |
244
+ | `ctx16384/…_mf64` | **QUALIFIED AT DEPTH** β€” 3/3 verbatim needle recall at 14,566 tokens at 32.2 tok/s, 0.46 GB peak footprint, plus the 3/3-clean real-graph grounding leg above. Recommended for long-context work. |
245
 
246
+ No oracle or PSNR gate has been run against a PyTorch reference. Qualification is behavioural
247
+ (parse rate, enum conformance, grounding scoring, clean stop, needle recall) plus the memory
248
+ instrumentation, not a numerics gate.
249
 
250
  ## License
251
 
252
+ `LiquidAI/LFM2.5-2.6B` is released under the **LFM Open License v1.0** (`lfm1.0`), and upstream
253
+ declares it as `license: other` + `license_name: lfm1.0`. These bundles are a derivative of that
254
+ checkpoint and the same licence and its obligations travel with them β€” see the
255
  [upstream licence](https://huggingface.co/LiquidAI/LFM2.5-2.6B/blob/main/LICENSE). Anyone
256
+ redistributing these files should redistribute the licence with them and comply with its terms.
257
+ Nothing here relicenses Liquid AI's weights; the contribution is the conversion recipe and the
258
+ qualification evidence.