@mlx-node/lm 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stream.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Gemma4Model as Gemma4ModelNative, Lfm2Model as Lfm2ModelNative, Qwen3Model as Qwen3ModelNative, Qwen35Model as Qwen35ModelNative, Qwen35MoeModel as Qwen35MoeModelNative } from '@mlx-node/core';
2
- import type { ChatConfig, ChatMessage, ChatStreamChunk, ChatStreamHandle, PerformanceMetrics, ToolCallResult } from '@mlx-node/core';
1
+ import { Gemma4Model as Gemma4ModelNative, Lfm2Model as Lfm2ModelNative, Qwen3Model as Qwen3ModelNative, Qwen35Model as Qwen35ModelNative, Qwen35MoeModel as Qwen35MoeModelNative } from "@mlx-node/core";
2
+ import type { ChatStreamChunk, ChatStreamHandle, PerformanceMetrics, ToolCallResult } from "@mlx-node/core";
3
+ import type { SessionCapableModel } from "./chat-session.js";
3
4
  export interface ChatStreamDelta {
4
5
  text: string;
5
6
  done: false;
@@ -11,13 +12,58 @@ export interface ChatStreamFinal {
11
12
  finishReason: string;
12
13
  toolCalls: ToolCallResult[];
13
14
  thinking: string | null;
15
+ /** Effective `enable_thinking` value passed to the model chat template. */
16
+ thinkingEnabled: boolean;
14
17
  numTokens: number;
15
18
  promptTokens: number;
16
19
  reasoningTokens: number;
17
20
  rawText: string;
21
+ /**
22
+ * Native token-aware reasoning-redacted raw output. ChatSession uses this
23
+ * when it captures full reasoning internally for deterministic replay while
24
+ * keeping `includeReasoning: false` private to the caller.
25
+ */
26
+ publicRawText?: string;
27
+ /**
28
+ * Whether terminal `text` is the complete parsed assistant content.
29
+ * Gemma emits visible content exclusively as deltas and sets false.
30
+ */
31
+ textAuthoritative?: boolean;
32
+ /**
33
+ * Number of prompt tokens served from the reused KV-cache prefix on
34
+ * this turn. Mirrors the `cachedTokens` field on the non-streaming
35
+ * `ChatResult` so session-aware streaming consumers can observe
36
+ * prefix-cache reuse without round-tripping to the non-streaming
37
+ * path.
38
+ *
39
+ * The native `ChatStreamChunk` surfaces `cachedTokens` on the
40
+ * terminal (`done == true`) chunk for every streaming entry point
41
+ * (Qwen3, Qwen3.5 Dense / MoE, LFM2, Gemma4, QianfanOCR) — start-path
42
+ * chunks carry the matched prefix length from
43
+ * `verify_cache_prefix_direct`, delta-path chunks carry the reused
44
+ * prior-history length. Non-terminal deltas carry `None` /
45
+ * `undefined` (only the terminal chunk is authoritative).
46
+ *
47
+ * This field remains OPTIONAL because the bridge-level mock tests
48
+ * (and any future in-process driver that constructs its own
49
+ * `ChatStreamChunk`) may legitimately omit it. Consumers SHOULD
50
+ * treat `undefined` distinctly from `0` (e.g. skip emitting
51
+ * `X-Cached-Tokens` rather than reporting `0`); a numeric value is
52
+ * always authoritative.
53
+ */
54
+ cachedTokens?: number;
18
55
  performance?: PerformanceMetrics;
19
56
  }
20
57
  export type ChatStreamEvent = ChatStreamDelta | ChatStreamFinal;
58
+ type TemplateContentOrder = "textThenMedia" | "imagesThenText";
59
+ interface TemplateContentPolicy {
60
+ order: TemplateContentOrder;
61
+ /**
62
+ * When sanitized text already contains this model-owned placeholder, keep
63
+ * the message structured but do not synthesize additional image parts.
64
+ */
65
+ existingImagePlaceholder?: string;
66
+ }
21
67
  /**
22
68
  * Shared AsyncGenerator adapter for callback-based native streaming methods.
23
69
  *
@@ -57,128 +103,195 @@ export type ChatStreamEvent = ChatStreamDelta | ChatStreamFinal;
57
103
  */
58
104
  export declare function _runChatStream(startCall: (callback: (err: Error | null, chunk: ChatStreamChunk) => void) => Promise<ChatStreamHandle>, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
59
105
  /**
60
- * Qwen3.5 dense model with AsyncGenerator-based session streaming.
106
+ * The three callback-based session-streaming methods every native chat
107
+ * class carries on its prototype (and, structurally, on its instances).
108
+ * Used both as the native `prototype` shape and as the constructed
109
+ * instance type so `InstanceType<NativeStreamingCtor>` resolves to the
110
+ * full native instance surface (`generate`, `saveModel`,
111
+ * `numParameters`, `hasMtpWeights`, …) — see {@link NativeStreamingCtor}.
61
112
  *
62
- * Streaming is driven through the session API — `chatStreamSessionStart`,
63
- * `chatStreamSessionContinue`, and `chatStreamSessionContinueTool` below —
64
- * which adapt the callback-based native methods to
65
- * `AsyncGenerator<ChatStreamEvent>` so the wrapper structurally satisfies
66
- * `SessionCapableModel` and can be passed to `ChatSession<Qwen35Model>`.
113
+ * @internal Native callback streaming surface consumed by
114
+ * {@link makeStreamingModel}.
67
115
  */
68
- export declare class Qwen35Model extends Qwen35ModelNative {
69
- static load(modelPath: string): Promise<Qwen35Model>;
116
+ export interface NativeStreamingInstance {
117
+ chatStreamSessionStart: (...args: never[]) => Promise<ChatStreamHandle>;
118
+ chatStreamSessionContinue: (...args: never[]) => Promise<ChatStreamHandle>;
119
+ chatStreamSessionContinueTool: (...args: never[]) => Promise<ChatStreamHandle>;
120
+ }
121
+ /**
122
+ * Minimal structural shape of a native chat model constructor that the
123
+ * factory needs: a real `new (...)` signature (so `InstanceType<C>`
124
+ * resolves to the native instance surface and the factory return type
125
+ * can preserve `generate`/`saveModel`/`numParameters`/… on the public
126
+ * subclass), a `static load(path)`, and the three callback-based
127
+ * session-streaming methods on its prototype. The native NAPI classes
128
+ * (`Qwen35ModelNative` etc.) all satisfy this — the concrete generic
129
+ * `C` passed at each call site carries the full per-family instance
130
+ * type, which `InstanceType<C>` recovers.
131
+ */
132
+ interface NativeStreamingCtor {
133
+ new (...args: never[]): NativeStreamingInstance;
134
+ load(modelPath: string): Promise<object>;
135
+ prototype: NativeStreamingInstance;
136
+ }
137
+ /** Tuning knobs for {@link makeStreamingModel}. */
138
+ interface StreamingModelOptions {
70
139
  /**
71
- * Streaming variant of {@link Qwen35Model#chatSessionStart}.
72
- *
73
- * Resets the KV caches, runs the jinja chat template, prefills on
74
- * top of the fresh caches, and streams the decoded reply token-by-
75
- * token. Stops on `<|im_end|>` so the cached history ends on a
76
- * clean ChatML boundary that subsequent `chatStreamSessionContinue`
77
- * deltas can append to. Text-only.
78
- *
79
- * The optional `signal` parameter wires an AbortSignal into the
80
- * `_runChatStream` adapter's fast-abort path. Callers that need
81
- * client-disconnect-aware cancellation (e.g. HTTP endpoints) pass
82
- * one here and the native decode winds down at the next safepoint.
140
+ * When `true`, `static load` records the on-disk model path so the
141
+ * generated subclass can serve `applyChatTemplate` from a lazily
142
+ * constructed tokenizer (see {@link applyChatTemplateFromModelPath}).
143
+ * When `false` (QianfanOCR) the path is not recorded and
144
+ * `applyChatTemplate` is omitted.
83
145
  */
84
- chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
146
+ recordModelPath: boolean;
85
147
  /**
86
- * Streaming variant of {@link Qwen35Model#chatSessionContinue}.
87
- *
88
- * Builds a raw ChatML delta on top of the live session caches,
89
- * tokenizes it, prefills the delta, and streams the decoded reply.
90
- * Requires a live session started via `chatSessionStart` or
91
- * `chatStreamSessionStart`. Stops on `<|im_end|>`.
92
- *
93
- * `images` is the native opt-in guard parameter — callers that
94
- * attach a new image set must restart the session via
95
- * `chatStreamSessionStart` with the full history. The high-level
96
- * `ChatSession` wrapper handles that routing; callers that drive
97
- * the wrapper directly should pass `null` for text-only continues.
148
+ * Whether to attach an `applyChatTemplate` method. Defaults to
149
+ * `recordModelPath` because the method can only work when a path was
150
+ * recorded. Qwen3 (first-gen) records its path but keeps its native
151
+ * tokenizer-backed implementation; pass `applyTemplate: false` to suppress
152
+ * only the factory's path-backed replacement.
98
153
  */
99
- chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
154
+ applyTemplate?: boolean;
100
155
  /**
101
- * Streaming variant of {@link Qwen35Model#chatSessionContinueTool}.
102
- *
103
- * Builds a ChatML `<tool_response>` delta on top of the live
104
- * session caches and streams the decoded assistant reply. Requires
105
- * a live session started via `chatSessionStart` /
106
- * `chatStreamSessionStart`.
156
+ * Model-specific ordering for structured multimodal content parts. The
157
+ * tokenizer applies this policy after sanitization while the checkpoint
158
+ * Jinja template continues to own all role and wire-format tokens.
159
+ */
160
+ templateContentPolicy?: TemplateContentPolicy;
161
+ /**
162
+ * Preserve the native raw assistant bytes in session history. LFM2's
163
+ * checkpoint template consumes reasoning inside `message.content` and does
164
+ * not read the structured `reasoning_content` field used by Qwen/Gemma.
107
165
  */
108
- chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
166
+ replayAssistantRawText?: boolean;
109
167
  }
110
168
  /**
111
- * Qwen3.5 MoE model wrapper.
169
+ * Shared base type produced by the factory: a `SessionCapableModel`
170
+ * whose static surface still exposes `load`. Concrete families extend
171
+ * the returned class with an empty body so they inherit everything and
172
+ * pick up the correct `.name` (and working `instanceof`) for free.
173
+ */
174
+ export type StreamingModel = SessionCapableModel;
175
+ /**
176
+ * The effective `applyTemplate` flag resolved from the options literal:
177
+ * an explicit `applyTemplate` wins, otherwise it defaults to `recordModelPath`
178
+ * — mirroring the runtime `opts.applyTemplate ?? recordPath`. Requires the
179
+ * options to be inferred as a literal (the `const` type parameter below), so
180
+ * `{ recordModelPath: true }` yields `true`, not `boolean`.
181
+ */
182
+ type ResolvedApplyTemplate<O extends StreamingModelOptions> = O extends {
183
+ applyTemplate: boolean;
184
+ } ? O["applyTemplate"] : O["recordModelPath"];
185
+ /** @internal Method names whose callback ABI is replaced by the generator wrapper. */
186
+ export type NativeStreamingMethod = keyof NativeStreamingInstance;
187
+ type StreamingReplacementMethod<O extends StreamingModelOptions> = NativeStreamingMethod | (ResolvedApplyTemplate<O> extends true ? "applyChatTemplate" : never);
188
+ /**
189
+ * Instance surface of a generated streaming wrapper. Only methods replaced at
190
+ * runtime are removed from the native instance: the three callback streaming
191
+ * methods, plus `applyChatTemplate` when the wrapper installs its path-backed
192
+ * implementation. Intersecting the remaining native surface with
193
+ * `SessionCapableModel` preserves required native capabilities such as
194
+ * `hasBlockPagedCache()` while exposing the generator streaming signatures.
112
195
  *
113
- * Streaming is driven through the `ChatSession` API overrides below
114
- * adapt the callback-based native methods to
115
- * `AsyncGenerator<ChatStreamEvent>` so the wrapper structurally
116
- * satisfies `SessionCapableModel`.
196
+ * When `applyTemplate` resolves false, an existing native implementation stays
197
+ * intact (notably Qwen3's required tokenizer-backed method), while models that
198
+ * never had one (QianfanOCR) retain the optional structural contract.
199
+ *
200
+ * @internal Concrete instance type returned by {@link makeStreamingModel}.
117
201
  */
118
- export declare class Qwen35MoeModel extends Qwen35MoeModelNative {
119
- static load(modelPath: string): Promise<Qwen35MoeModel>;
120
- /** Streaming variant of {@link Qwen35MoeModel#chatSessionStart}. */
121
- chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
122
- /** Streaming variant of {@link Qwen35MoeModel#chatSessionContinue}. */
123
- chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
124
- /** Streaming variant of {@link Qwen35MoeModel#chatSessionContinueTool}. */
125
- chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
126
- }
202
+ export type StreamingInstance<C extends NativeStreamingCtor, O extends StreamingModelOptions> = Omit<InstanceType<C>, StreamingReplacementMethod<O>> & SessionCapableModel & (ResolvedApplyTemplate<O> extends true ? Required<Pick<SessionCapableModel, "applyChatTemplate">> : object);
127
203
  /**
128
- * LFM2 model wrapper.
204
+ * Build the streaming-model subclass for a native chat model class.
129
205
  *
130
- * Streaming is driven through the `ChatSession` API — overrides below
131
- * adapt the callback-based native methods to
132
- * `AsyncGenerator<ChatStreamEvent>` so the wrapper structurally
133
- * satisfies `SessionCapableModel`. LFM2 is text-only; the native
134
- * `images` guard rejects non-empty image sets with an
135
- * `IMAGE_CHANGE_REQUIRES_SESSION_RESTART:` prefix.
206
+ * The returned class:
207
+ * - captures the three native callback-based session-streaming methods
208
+ * from `NativeClass.prototype`,
209
+ * - overrides them as `async *` generators delegating to
210
+ * {@link _runChatStream} with identical argument plumbing (including
211
+ * `config ?? null`, `images`, `isError ?? null`, and the `signal`),
212
+ * - overrides `static load` to re-prototype the native instance onto
213
+ * the concrete subclass (`this`) and optionally record the path,
214
+ * - installs a path-backed `applyChatTemplate` when `opts.applyTemplate`
215
+ * (defaulting to `opts.recordModelPath`).
216
+ *
217
+ * @internal Exported so the VLM wrapper (`@mlx-node/vlm`) builds its
218
+ * `QianfanOCRModel` from the same factory. Not part of the public API.
136
219
  */
137
- export declare class Lfm2Model extends Lfm2ModelNative {
138
- static load(modelPath: string): Promise<Lfm2Model>;
139
- /** Streaming variant of {@link Lfm2Model#chatSessionStart}. */
140
- chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
141
- /** Streaming variant of {@link Lfm2Model#chatSessionContinue}. */
142
- chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
143
- /** Streaming variant of {@link Lfm2Model#chatSessionContinueTool}. */
144
- chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
145
- }
220
+ export declare function makeStreamingModel<C extends NativeStreamingCtor, const O extends StreamingModelOptions>(NativeClass: C, opts: O): {
221
+ new (...args: ConstructorParameters<C>): StreamingInstance<C, O>;
222
+ load(...args: Parameters<C["load"]>): Promise<StreamingInstance<C, O>>;
223
+ };
224
+ declare const Qwen35Model_base: {
225
+ new (): StreamingInstance<typeof Qwen35ModelNative, {
226
+ readonly recordModelPath: true;
227
+ }>;
228
+ load(path: string): Promise<StreamingInstance<typeof Qwen35ModelNative, {
229
+ readonly recordModelPath: true;
230
+ }>>;
231
+ };
146
232
  /**
147
- * Gemma4 model wrapper.
233
+ * Qwen3.5 dense model with AsyncGenerator-based session streaming.
148
234
  *
149
- * Streaming is driven through the `ChatSession` API overrides below
150
- * adapt the callback-based native methods to
151
- * `AsyncGenerator<ChatStreamEvent>` so the wrapper structurally
152
- * satisfies `SessionCapableModel`. Gemma4 is text-only in the
153
- * current refactor scope; the native `images` guard rejects non-empty
154
- * image sets with an `IMAGE_CHANGE_REQUIRES_SESSION_RESTART:` prefix.
235
+ * The empty `extends` inherits the factory's streaming overrides,
236
+ * `static load`, and `applyChatTemplate`, and supplies the concrete
237
+ * `.name === 'Qwen35Model'` and a working `instanceof`. Records its
238
+ * model path so `applyChatTemplate` can serve a lazily built tokenizer.
155
239
  */
156
- export declare class Gemma4Model extends Gemma4ModelNative {
157
- static load(modelPath: string): Promise<Gemma4Model>;
158
- /** Streaming variant of {@link Gemma4Model#chatSessionStart}. */
159
- chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
160
- /** Streaming variant of {@link Gemma4Model#chatSessionContinue}. */
161
- chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
162
- /** Streaming variant of {@link Gemma4Model#chatSessionContinueTool}. */
163
- chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
240
+ export declare class Qwen35Model extends Qwen35Model_base {
241
+ }
242
+ declare const Qwen35MoeModel_base: {
243
+ new (): StreamingInstance<typeof Qwen35MoeModelNative, {
244
+ readonly recordModelPath: true;
245
+ }>;
246
+ load(path: string): Promise<StreamingInstance<typeof Qwen35MoeModelNative, {
247
+ readonly recordModelPath: true;
248
+ }>>;
249
+ };
250
+ /** Qwen3.5 MoE model — see {@link Qwen35Model} for the wrapper shape. */
251
+ export declare class Qwen35MoeModel extends Qwen35MoeModel_base {
252
+ }
253
+ declare const Lfm2Model_base: {
254
+ new (): StreamingInstance<typeof Lfm2ModelNative, {
255
+ readonly recordModelPath: true;
256
+ readonly replayAssistantRawText: true;
257
+ }>;
258
+ load(modelPath: string): Promise<StreamingInstance<typeof Lfm2ModelNative, {
259
+ readonly recordModelPath: true;
260
+ readonly replayAssistantRawText: true;
261
+ }>>;
262
+ };
263
+ /** LFM2 model (text-only) — see {@link Qwen35Model} for the wrapper shape. */
264
+ export declare class Lfm2Model extends Lfm2Model_base {
265
+ }
266
+ declare const Gemma4Model_base: {
267
+ new (config: import("@mlx-node/core").Gemma4Config): StreamingInstance<typeof Gemma4ModelNative, {
268
+ readonly recordModelPath: true;
269
+ }>;
270
+ load(modelPath: string, options?: import("@mlx-node/core").Gemma4LoadOptions | null | undefined): Promise<StreamingInstance<typeof Gemma4ModelNative, {
271
+ readonly recordModelPath: true;
272
+ }>>;
273
+ };
274
+ /** Gemma4 model (text-only) — see {@link Qwen35Model} for the wrapper shape. */
275
+ export declare class Gemma4Model extends Gemma4Model_base {
164
276
  }
277
+ declare const Qwen3Model_base: {
278
+ new (): StreamingInstance<typeof Qwen3ModelNative, {
279
+ readonly recordModelPath: true;
280
+ readonly applyTemplate: false;
281
+ }>;
282
+ load(modelPath: string): Promise<StreamingInstance<typeof Qwen3ModelNative, {
283
+ readonly recordModelPath: true;
284
+ readonly applyTemplate: false;
285
+ }>>;
286
+ };
165
287
  /**
166
- * Qwen3 (legacy) model wrapper.
288
+ * Qwen3 (first-gen, text-only) model.
167
289
  *
168
- * Streaming is driven through the `ChatSession` API overrides below
169
- * adapt the callback-based native methods to
170
- * `AsyncGenerator<ChatStreamEvent>` so the wrapper structurally
171
- * satisfies `SessionCapableModel`. Qwen3 legacy is text-only; the
172
- * native `images` guard rejects non-empty image sets with an
173
- * `IMAGE_CHANGE_REQUIRES_SESSION_RESTART:` prefix.
290
+ * Records its model path (so prototype-set + path-recording match the
291
+ * other families) but does not install the factory's path-backed
292
+ * `applyChatTemplate`; it retains the native tokenizer-backed method.
174
293
  */
175
- export declare class Qwen3Model extends Qwen3ModelNative {
176
- static load(modelPath: string): Promise<Qwen3Model>;
177
- /** Streaming variant of {@link Qwen3Model#chatSessionStart}. */
178
- chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
179
- /** Streaming variant of {@link Qwen3Model#chatSessionContinue}. */
180
- chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
181
- /** Streaming variant of {@link Qwen3Model#chatSessionContinueTool}. */
182
- chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
294
+ export declare class Qwen3Model extends Qwen3Model_base {
183
295
  }
296
+ export {};
184
297
  //# sourceMappingURL=stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,UAAU,IAAI,gBAAgB,EAC9B,WAAW,IAAI,iBAAiB,EAChC,cAAc,IAAI,oBAAoB,EACvC,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,cAAc,EAAE,CAAC;I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