@mlx-node/lm 0.0.6 → 0.0.8

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,8 +1,10 @@
1
- import { 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;
7
+ isReasoning?: boolean;
6
8
  }
7
9
  export interface ChatStreamFinal {
8
10
  text: string;
@@ -11,46 +13,249 @@ export interface ChatStreamFinal {
11
13
  toolCalls: ToolCallResult[];
12
14
  thinking: string | null;
13
15
  numTokens: number;
16
+ promptTokens: number;
17
+ reasoningTokens: number;
14
18
  rawText: string;
19
+ /**
20
+ * Number of prompt tokens served from the reused KV-cache prefix on
21
+ * this turn. Mirrors the `cachedTokens` field on the non-streaming
22
+ * `ChatResult` so session-aware streaming consumers can observe
23
+ * prefix-cache reuse without round-tripping to the non-streaming
24
+ * path.
25
+ *
26
+ * The native `ChatStreamChunk` surfaces `cachedTokens` on the
27
+ * terminal (`done == true`) chunk for every streaming entry point
28
+ * (Qwen3, Qwen3.5 Dense / MoE, LFM2, Gemma4, QianfanOCR) — start-path
29
+ * chunks carry the matched prefix length from
30
+ * `verify_cache_prefix_direct`, delta-path chunks carry the reused
31
+ * prior-history length. Non-terminal deltas carry `None` /
32
+ * `undefined` (only the terminal chunk is authoritative).
33
+ *
34
+ * This field remains OPTIONAL because the bridge-level mock tests
35
+ * (and any future in-process driver that constructs its own
36
+ * `ChatStreamChunk`) may legitimately omit it. Consumers SHOULD
37
+ * treat `undefined` distinctly from `0` (e.g. skip emitting
38
+ * `X-Cached-Tokens` rather than reporting `0`); a numeric value is
39
+ * always authoritative.
40
+ */
41
+ cachedTokens?: number;
15
42
  performance?: PerformanceMetrics;
16
43
  }
17
44
  export type ChatStreamEvent = ChatStreamDelta | ChatStreamFinal;
18
45
  /**
19
- * Shared AsyncGenerator implementation that wraps a native callback-based
20
- * chatStream into a `for await...of`-compatible stream.
46
+ * Shared AsyncGenerator adapter for callback-based native streaming methods.
21
47
  *
22
- * Cancellation is automatic via the generator's `finally` block.
48
+ * Takes a `startCall` closure that, given the JS-side callback, dispatches
49
+ * the underlying native stream (whatever method signature that is — the
50
+ * closure captures `messages` / `config` / `userMessage` etc) and resolves
51
+ * with a `ChatStreamHandle`. The generator pumps the resulting chunk queue,
52
+ * transforms each chunk into a `ChatStreamEvent`, and calls `handle.cancel()`
53
+ * in a `finally` block so early termination (user `break`, exception) still
54
+ * cleans up native state.
55
+ *
56
+ * ## Signal-driven fast-abort
57
+ *
58
+ * When an optional `AbortSignal` is supplied and fires, the adapter:
59
+ * 1. Calls `handle.cancel()` immediately so the native decode stops
60
+ * on the next safepoint rather than running to completion.
61
+ * 2. Wakes the pending `waitForItem()` await by pushing a synthetic
62
+ * "aborted" marker into the queue and calling `notify()`. Without
63
+ * this wake-up the generator would stay parked on the `await`
64
+ * until the next native chunk arrived, which on a fast-abort
65
+ * path (client disconnect before first token) never happens.
66
+ * 3. The generator sees the marker, breaks out of its loop, and the
67
+ * finally block runs `cancelOnce()` — which is a no-op because
68
+ * `triggerAbort` already flipped the `cancelled` flag. Some
69
+ * backends throw on double-cancel, so routing every cancel site
70
+ * through `cancelOnce` keeps abort behavior deterministic.
71
+ *
72
+ * The finally block is also the landing site for the consumer calling
73
+ * `.return()` on the outer generator — the existing `yield` cleanup
74
+ * covers that case. Signal-driven abort covers the window where the
75
+ * consumer cannot reach `.return()` because they are blocked waiting
76
+ * for the very `yield` that `waitForItem()` is gating.
77
+ *
78
+ * @internal Exported so the VLM wrapper (`@mlx-node/vlm`) can reuse the
79
+ * exact same bridge without duplicating the plumbing. Not part of the
80
+ * public API — may change without notice.
23
81
  */
24
- /** @internal Exported for testing only. */
25
- export declare function _createChatStream(nativeMethod: (messages: ChatMessage[], config: any, callback: (err: Error | null, chunk: ChatStreamChunk) => void) => Promise<ChatStreamHandle>, self: unknown, messages: ChatMessage[], config: unknown): AsyncGenerator<ChatStreamEvent>;
82
+ export declare function _runChatStream(startCall: (callback: (err: Error | null, chunk: ChatStreamChunk) => void) => Promise<ChatStreamHandle>, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
26
83
  /**
27
- * Qwen3.5 dense model with AsyncGenerator-based `chatStream()`.
84
+ * The three callback-based session-streaming methods every native chat
85
+ * class carries on its prototype (and, structurally, on its instances).
86
+ * Used both as the native `prototype` shape and as the constructed
87
+ * instance type so `InstanceType<NativeStreamingCtor>` resolves to the
88
+ * full native instance surface (`generate`, `saveModel`,
89
+ * `numParameters`, `hasMtpWeights`, …) — see {@link NativeStreamingCtor}.
28
90
  *
29
- * @example
30
- * ```typescript
31
- * const model = await Qwen35Model.load('./models/qwen3.5-3b');
32
- * for await (const event of model.chatStream(messages)) {
33
- * if (!event.done) process.stdout.write(event.text);
34
- * }
35
- * ```
91
+ * @internal Native callback streaming surface consumed by
92
+ * {@link makeStreamingModel}.
93
+ */
94
+ export interface NativeStreamingInstance {
95
+ chatStreamSessionStart: (...args: never[]) => Promise<ChatStreamHandle>;
96
+ chatStreamSessionContinue: (...args: never[]) => Promise<ChatStreamHandle>;
97
+ chatStreamSessionContinueTool: (...args: never[]) => Promise<ChatStreamHandle>;
98
+ }
99
+ /**
100
+ * Minimal structural shape of a native chat model constructor that the
101
+ * factory needs: a real `new (...)` signature (so `InstanceType<C>`
102
+ * resolves to the native instance surface and the factory return type
103
+ * can preserve `generate`/`saveModel`/`numParameters`/… on the public
104
+ * subclass), a `static load(path)`, and the three callback-based
105
+ * session-streaming methods on its prototype. The native NAPI classes
106
+ * (`Qwen35ModelNative` etc.) all satisfy this — the concrete generic
107
+ * `C` passed at each call site carries the full per-family instance
108
+ * type, which `InstanceType<C>` recovers.
36
109
  */
37
- export declare class Qwen35Model extends Qwen35ModelNative {
38
- static load(modelPath: string): Promise<Qwen35Model>;
39
- chatStream(messages: ChatMessage[], config?: ChatConfig | null): AsyncGenerator<ChatStreamEvent>;
110
+ interface NativeStreamingCtor {
111
+ new (...args: never[]): NativeStreamingInstance;
112
+ load(modelPath: string): Promise<object>;
113
+ prototype: NativeStreamingInstance;
114
+ }
115
+ /** Tuning knobs for {@link makeStreamingModel}. */
116
+ interface StreamingModelOptions {
117
+ /**
118
+ * When `true`, `static load` records the on-disk model path so the
119
+ * generated subclass can serve `applyChatTemplate` from a lazily
120
+ * constructed tokenizer (see {@link applyChatTemplateFromModelPath}).
121
+ * When `false` (QianfanOCR) the path is not recorded and
122
+ * `applyChatTemplate` is omitted.
123
+ */
124
+ recordModelPath: boolean;
125
+ /**
126
+ * Whether to attach an `applyChatTemplate` method. Defaults to
127
+ * `recordModelPath` because the method can only work when a path was
128
+ * recorded. Qwen3 (first-gen) records its path but keeps its native
129
+ * tokenizer-backed implementation; pass `applyTemplate: false` to suppress
130
+ * only the factory's path-backed replacement.
131
+ */
132
+ applyTemplate?: boolean;
133
+ }
134
+ /**
135
+ * Shared base type produced by the factory: a `SessionCapableModel`
136
+ * whose static surface still exposes `load`. Concrete families extend
137
+ * the returned class with an empty body so they inherit everything and
138
+ * pick up the correct `.name` (and working `instanceof`) for free.
139
+ */
140
+ export type StreamingModel = SessionCapableModel;
141
+ /**
142
+ * The effective `applyTemplate` flag resolved from the options literal:
143
+ * an explicit `applyTemplate` wins, otherwise it defaults to `recordModelPath`
144
+ * — mirroring the runtime `opts.applyTemplate ?? recordPath`. Requires the
145
+ * options to be inferred as a literal (the `const` type parameter below), so
146
+ * `{ recordModelPath: true }` yields `true`, not `boolean`.
147
+ */
148
+ type ResolvedApplyTemplate<O extends StreamingModelOptions> = O extends {
149
+ applyTemplate: boolean;
150
+ } ? O['applyTemplate'] : O['recordModelPath'];
151
+ /** @internal Method names whose callback ABI is replaced by the generator wrapper. */
152
+ export type NativeStreamingMethod = keyof NativeStreamingInstance;
153
+ type StreamingReplacementMethod<O extends StreamingModelOptions> = NativeStreamingMethod | (ResolvedApplyTemplate<O> extends true ? 'applyChatTemplate' : never);
154
+ /**
155
+ * Instance surface of a generated streaming wrapper. Only methods replaced at
156
+ * runtime are removed from the native instance: the three callback streaming
157
+ * methods, plus `applyChatTemplate` when the wrapper installs its path-backed
158
+ * implementation. Intersecting the remaining native surface with
159
+ * `SessionCapableModel` preserves required native capabilities such as
160
+ * `hasBlockPagedCache()` while exposing the generator streaming signatures.
161
+ *
162
+ * When `applyTemplate` resolves false, an existing native implementation stays
163
+ * intact (notably Qwen3's required tokenizer-backed method), while models that
164
+ * never had one (QianfanOCR) retain the optional structural contract.
165
+ *
166
+ * @internal Concrete instance type returned by {@link makeStreamingModel}.
167
+ */
168
+ export type StreamingInstance<C extends NativeStreamingCtor, O extends StreamingModelOptions> = Omit<InstanceType<C>, StreamingReplacementMethod<O>> & SessionCapableModel & (ResolvedApplyTemplate<O> extends true ? Required<Pick<SessionCapableModel, 'applyChatTemplate'>> : object);
169
+ /**
170
+ * Build the streaming-model subclass for a native chat model class.
171
+ *
172
+ * The returned class:
173
+ * - captures the three native callback-based session-streaming methods
174
+ * from `NativeClass.prototype`,
175
+ * - overrides them as `async *` generators delegating to
176
+ * {@link _runChatStream} with identical argument plumbing (including
177
+ * `config ?? null`, `images`, `isError ?? null`, and the `signal`),
178
+ * - overrides `static load` to re-prototype the native instance onto
179
+ * the concrete subclass (`this`) and optionally record the path,
180
+ * - installs a path-backed `applyChatTemplate` when `opts.applyTemplate`
181
+ * (defaulting to `opts.recordModelPath`).
182
+ *
183
+ * @internal Exported so the VLM wrapper (`@mlx-node/vlm`) builds its
184
+ * `QianfanOCRModel` from the same factory. Not part of the public API.
185
+ */
186
+ export declare function makeStreamingModel<C extends NativeStreamingCtor, const O extends StreamingModelOptions>(NativeClass: C, opts: O): {
187
+ new (...args: ConstructorParameters<C>): StreamingInstance<C, O>;
188
+ load(...args: Parameters<C['load']>): Promise<StreamingInstance<C, O>>;
189
+ };
190
+ declare const Qwen35Model_base: {
191
+ new (): StreamingInstance<typeof Qwen35ModelNative, {
192
+ readonly recordModelPath: true;
193
+ }>;
194
+ load(path: string): Promise<StreamingInstance<typeof Qwen35ModelNative, {
195
+ readonly recordModelPath: true;
196
+ }>>;
197
+ };
198
+ /**
199
+ * Qwen3.5 dense model with AsyncGenerator-based session streaming.
200
+ *
201
+ * The empty `extends` inherits the factory's streaming overrides,
202
+ * `static load`, and `applyChatTemplate`, and supplies the concrete
203
+ * `.name === 'Qwen35Model'` and a working `instanceof`. Records its
204
+ * model path so `applyChatTemplate` can serve a lazily built tokenizer.
205
+ */
206
+ export declare class Qwen35Model extends Qwen35Model_base {
207
+ }
208
+ declare const Qwen35MoeModel_base: {
209
+ new (): StreamingInstance<typeof Qwen35MoeModelNative, {
210
+ readonly recordModelPath: true;
211
+ }>;
212
+ load(path: string): Promise<StreamingInstance<typeof Qwen35MoeModelNative, {
213
+ readonly recordModelPath: true;
214
+ }>>;
215
+ };
216
+ /** Qwen3.5 MoE model — see {@link Qwen35Model} for the wrapper shape. */
217
+ export declare class Qwen35MoeModel extends Qwen35MoeModel_base {
218
+ }
219
+ declare const Lfm2Model_base: {
220
+ new (): StreamingInstance<typeof Lfm2ModelNative, {
221
+ readonly recordModelPath: true;
222
+ }>;
223
+ load(modelPath: string): Promise<StreamingInstance<typeof Lfm2ModelNative, {
224
+ readonly recordModelPath: true;
225
+ }>>;
226
+ };
227
+ /** LFM2 model (text-only) — see {@link Qwen35Model} for the wrapper shape. */
228
+ export declare class Lfm2Model extends Lfm2Model_base {
229
+ }
230
+ declare const Gemma4Model_base: {
231
+ new (config: import("@mlx-node/core").Gemma4Config): StreamingInstance<typeof Gemma4ModelNative, {
232
+ readonly recordModelPath: true;
233
+ }>;
234
+ load(modelPath: string, options?: import("@mlx-node/core").Gemma4LoadOptions | null | undefined): Promise<StreamingInstance<typeof Gemma4ModelNative, {
235
+ readonly recordModelPath: true;
236
+ }>>;
237
+ };
238
+ /** Gemma4 model (text-only) — see {@link Qwen35Model} for the wrapper shape. */
239
+ export declare class Gemma4Model extends Gemma4Model_base {
40
240
  }
241
+ declare const Qwen3Model_base: {
242
+ new (): StreamingInstance<typeof Qwen3ModelNative, {
243
+ readonly recordModelPath: true;
244
+ readonly applyTemplate: false;
245
+ }>;
246
+ load(modelPath: string): Promise<StreamingInstance<typeof Qwen3ModelNative, {
247
+ readonly recordModelPath: true;
248
+ readonly applyTemplate: false;
249
+ }>>;
250
+ };
41
251
  /**
42
- * Qwen3.5 MoE model with AsyncGenerator-based `chatStream()`.
252
+ * Qwen3 (first-gen, text-only) model.
43
253
  *
44
- * @example
45
- * ```typescript
46
- * const model = await Qwen35MoeModel.load('./models/qwen3.5-moe');
47
- * for await (const event of model.chatStream(messages)) {
48
- * if (!event.done) process.stdout.write(event.text);
49
- * }
50
- * ```
254
+ * Records its model path (so prototype-set + path-recording match the
255
+ * other families) but does not install the factory's path-backed
256
+ * `applyChatTemplate`; it retains the native tokenizer-backed method.
51
257
  */
52
- export declare class Qwen35MoeModel extends Qwen35MoeModelNative {
53
- static load(modelPath: string): Promise<Qwen35MoeModel>;
54
- chatStream(messages: ChatMessage[], config?: ChatConfig | null): AsyncGenerator<ChatStreamEvent>;
258
+ export declare class Qwen3Model extends Qwen3Model_base {
55
259
  }
260
+ export {};
56
261
  //# sourceMappingURL=stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,iBAA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