@seanhogg/builderforce-memory-engine 2026.6.39 → 2026.7.11

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.
Files changed (61) hide show
  1. package/dist/codec/evermind_video.d.ts +35 -0
  2. package/dist/codec/evermind_video.d.ts.map +1 -0
  3. package/dist/codec/evermind_video.js +37 -0
  4. package/dist/codec/evermind_video.js.map +1 -0
  5. package/dist/codec/image_rvq.d.ts +28 -0
  6. package/dist/codec/image_rvq.d.ts.map +1 -0
  7. package/dist/codec/image_rvq.js +39 -0
  8. package/dist/codec/image_rvq.js.map +1 -0
  9. package/dist/codec/index.d.ts +13 -0
  10. package/dist/codec/index.d.ts.map +1 -0
  11. package/dist/codec/index.js +11 -0
  12. package/dist/codec/index.js.map +1 -0
  13. package/dist/codec/multimodal_vocab.d.ts +79 -0
  14. package/dist/codec/multimodal_vocab.d.ts.map +1 -0
  15. package/dist/codec/multimodal_vocab.js +96 -0
  16. package/dist/codec/multimodal_vocab.js.map +1 -0
  17. package/dist/codec/video_rvq.d.ts +116 -0
  18. package/dist/codec/video_rvq.d.ts.map +1 -0
  19. package/dist/codec/video_rvq.js +450 -0
  20. package/dist/codec/video_rvq.js.map +1 -0
  21. package/dist/index.d.ts +3 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/kernels/selective_scan.d.ts.map +1 -1
  26. package/dist/kernels/selective_scan.js +9 -3
  27. package/dist/kernels/selective_scan.js.map +1 -1
  28. package/dist/kernels/ssd.d.ts.map +1 -1
  29. package/dist/kernels/ssd.js +8 -2
  30. package/dist/kernels/ssd.js.map +1 -1
  31. package/dist/kernels/weight_update.d.ts.map +1 -1
  32. package/dist/kernels/weight_update.js +22 -3
  33. package/dist/kernels/weight_update.js.map +1 -1
  34. package/dist/model/mamba_model.d.ts +17 -0
  35. package/dist/model/mamba_model.d.ts.map +1 -1
  36. package/dist/model/mamba_model.js +27 -0
  37. package/dist/model/mamba_model.js.map +1 -1
  38. package/dist/moe/index.d.ts +1 -1
  39. package/dist/moe/index.d.ts.map +1 -1
  40. package/dist/moe/moe_package.d.ts +40 -2
  41. package/dist/moe/moe_package.d.ts.map +1 -1
  42. package/dist/moe/moe_package.js +90 -7
  43. package/dist/moe/moe_package.js.map +1 -1
  44. package/dist/training/trainer.d.ts +34 -2
  45. package/dist/training/trainer.d.ts.map +1 -1
  46. package/dist/training/trainer.js +76 -26
  47. package/dist/training/trainer.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/codec/evermind_video.ts +55 -0
  50. package/src/codec/image_rvq.ts +50 -0
  51. package/src/codec/index.ts +16 -0
  52. package/src/codec/multimodal_vocab.ts +115 -0
  53. package/src/codec/video_rvq.ts +496 -0
  54. package/src/index.ts +22 -0
  55. package/src/kernels/selective_scan.ts +9 -3
  56. package/src/kernels/ssd.ts +8 -2
  57. package/src/kernels/weight_update.ts +22 -3
  58. package/src/model/mamba_model.ts +27 -0
  59. package/src/moe/index.ts +1 -0
  60. package/src/moe/moe_package.ts +107 -6
  61. package/src/training/trainer.ts +92 -28
@@ -0,0 +1,35 @@
1
+ /**
2
+ * evermind_video.ts — thin bridge that makes the EXISTING EvermindLM generate
3
+ * video. No new model, no new generator: the codec turns frames into tokens, the
4
+ * unqualified `EvermindLM.generate` autoregresses over them, and the codec turns
5
+ * the emitted tokens back into frames. Deliberately DRY — everything the text
6
+ * path already has (sampling, checkpoints, delta export, training) is reused.
7
+ */
8
+ import type { EvermindLM, LMGenerateOptions } from "../lm/evermind_lm.js";
9
+ import type { VideoRVQCodec, Video, Frame } from "./video_rvq.js";
10
+ import type { ImageRVQCodec } from "./image_rvq.js";
11
+ /**
12
+ * Build a unified training sequence `text… <vid> frames… </vid>` for
13
+ * `EvermindLMTrainer.fit`. `textTokens` are ids in the codec's text region (from
14
+ * a BPE tokenizer whose vocab size equals `codec.vocab.textVocabSize`). Training
15
+ * the LM on many such sequences is what teaches text→video.
16
+ */
17
+ export declare function buildVideoSequence(codec: VideoRVQCodec, textTokens: number[], video: Video): number[];
18
+ /**
19
+ * Generate video from a prompt of already-tokenised context (text ids and/or a
20
+ * partial video stream). The prompt should normally end just before or at the
21
+ * `<vid>` marker; generation stops at `</vid>` or after `maxNewTokens`.
22
+ *
23
+ * Returns the decoded clip plus the raw produced token ids (useful for chaining
24
+ * or continued generation).
25
+ */
26
+ export declare function generateVideo(lm: EvermindLM, codec: VideoRVQCodec, promptTokens: number[], opts: LMGenerateOptions): {
27
+ video: Video;
28
+ tokens: number[];
29
+ };
30
+ /** Generate a single image — the still-image case of {@link generateVideo}. */
31
+ export declare function generateImage(lm: EvermindLM, codec: ImageRVQCodec, promptTokens: number[], opts: LMGenerateOptions): {
32
+ image: Frame;
33
+ tokens: number[];
34
+ };
35
+ //# sourceMappingURL=evermind_video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evermind_video.d.ts","sourceRoot":"","sources":["../../src/codec/evermind_video.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAErG;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,EAAE,iBAAiB,GACtB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAQpC;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAC3B,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,EAAE,iBAAiB,GACtB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAGpC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * evermind_video.ts — thin bridge that makes the EXISTING EvermindLM generate
3
+ * video. No new model, no new generator: the codec turns frames into tokens, the
4
+ * unqualified `EvermindLM.generate` autoregresses over them, and the codec turns
5
+ * the emitted tokens back into frames. Deliberately DRY — everything the text
6
+ * path already has (sampling, checkpoints, delta export, training) is reused.
7
+ */
8
+ /**
9
+ * Build a unified training sequence `text… <vid> frames… </vid>` for
10
+ * `EvermindLMTrainer.fit`. `textTokens` are ids in the codec's text region (from
11
+ * a BPE tokenizer whose vocab size equals `codec.vocab.textVocabSize`). Training
12
+ * the LM on many such sequences is what teaches text→video.
13
+ */
14
+ export function buildVideoSequence(codec, textTokens, video) {
15
+ return [...textTokens, ...codec.encode(video)];
16
+ }
17
+ /**
18
+ * Generate video from a prompt of already-tokenised context (text ids and/or a
19
+ * partial video stream). The prompt should normally end just before or at the
20
+ * `<vid>` marker; generation stops at `</vid>` or after `maxNewTokens`.
21
+ *
22
+ * Returns the decoded clip plus the raw produced token ids (useful for chaining
23
+ * or continued generation).
24
+ */
25
+ export function generateVideo(lm, codec, promptTokens, opts) {
26
+ if (lm.config.vocabSize !== codec.vocabSize) {
27
+ throw new Error(`generateVideo: EvermindLM vocabSize (${lm.config.vocabSize}) must equal codec.vocabSize (${codec.vocabSize})`);
28
+ }
29
+ const tokens = lm.generate(promptTokens, { ...opts, stopToken: opts.stopToken ?? codec.vocab.eosVideo });
30
+ return { video: codec.decode(tokens), tokens };
31
+ }
32
+ /** Generate a single image — the still-image case of {@link generateVideo}. */
33
+ export function generateImage(lm, codec, promptTokens, opts) {
34
+ const { video, tokens } = generateVideo(lm, codec.video, promptTokens, opts);
35
+ return { image: video[0] ?? new Float32Array(codec.frameSize), tokens };
36
+ }
37
+ //# sourceMappingURL=evermind_video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evermind_video.js","sourceRoot":"","sources":["../../src/codec/evermind_video.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAoB,EAAE,UAAoB,EAAE,KAAY;IACzF,OAAO,CAAC,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,EAAc,EACd,KAAoB,EACpB,YAAsB,EACtB,IAAuB;IAEvB,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,wCAAwC,EAAE,CAAC,MAAM,CAAC,SAAS,iCAAiC,KAAK,CAAC,SAAS,GAAG,CAC/G,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzG,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;AACjD,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CAC3B,EAAc,EACd,KAAoB,EACpB,YAAsB,EACtB,IAAuB;IAEvB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAC7E,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * image_rvq.ts — ImageRVQCodec: still-image generation as the single-frame case
3
+ * of {@link VideoRVQCodec}. An image has no temporal axis, so every frame is a
4
+ * keyframe (intra) — this wrapper just fixes `keyframeInterval = 1` and speaks in
5
+ * single frames instead of clips. Deliberately thin: it reuses the video codec's
6
+ * patchify + residual-VQ + learned codebooks + tolerant decode wholesale, so
7
+ * there is exactly one implementation to maintain.
8
+ */
9
+ import { VideoRVQCodec, type VideoRVQConfig, type Frame } from "./video_rvq.js";
10
+ export type { Frame } from "./video_rvq.js";
11
+ export declare class ImageRVQCodec {
12
+ /** The underlying video codec (pass to `generateVideo`/`generateImage`). */
13
+ readonly video: VideoRVQCodec;
14
+ constructor(config: Omit<VideoRVQConfig, "keyframeInterval">);
15
+ get vocab(): import("./multimodal_vocab.js").MultimodalVocab;
16
+ get vocabSize(): number;
17
+ get frameSize(): number;
18
+ /** Encode one image to a `<vid> <key> codes… </vid>` token stream. */
19
+ encode(image: Frame): number[];
20
+ /** Decode a token stream to a single image (zeros if the stream yields no frame). */
21
+ decode(tokens: number[]): Frame;
22
+ /** Learn codebooks from a set of images (each is a one-frame clip). Returns recon MSE. */
23
+ fit(images: Frame[], opts?: {
24
+ iterations?: number;
25
+ seed?: number;
26
+ }): number;
27
+ }
28
+ //# sourceMappingURL=image_rvq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_rvq.d.ts","sourceRoot":"","sources":["../../src/codec/image_rvq.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhF,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,qBAAa,aAAa;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;gBAElB,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAI5D,IAAI,KAAK,oDAER;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE;IAI9B,qFAAqF;IACrF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK;IAK/B,0FAA0F;IAC1F,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;CAM5E"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * image_rvq.ts — ImageRVQCodec: still-image generation as the single-frame case
3
+ * of {@link VideoRVQCodec}. An image has no temporal axis, so every frame is a
4
+ * keyframe (intra) — this wrapper just fixes `keyframeInterval = 1` and speaks in
5
+ * single frames instead of clips. Deliberately thin: it reuses the video codec's
6
+ * patchify + residual-VQ + learned codebooks + tolerant decode wholesale, so
7
+ * there is exactly one implementation to maintain.
8
+ */
9
+ import { VideoRVQCodec } from "./video_rvq.js";
10
+ export class ImageRVQCodec {
11
+ /** The underlying video codec (pass to `generateVideo`/`generateImage`). */
12
+ video;
13
+ constructor(config) {
14
+ this.video = new VideoRVQCodec({ ...config, keyframeInterval: 1 });
15
+ }
16
+ get vocab() {
17
+ return this.video.vocab;
18
+ }
19
+ get vocabSize() {
20
+ return this.video.vocabSize;
21
+ }
22
+ get frameSize() {
23
+ return this.video.height * this.video.width * this.video.channels;
24
+ }
25
+ /** Encode one image to a `<vid> <key> codes… </vid>` token stream. */
26
+ encode(image) {
27
+ return this.video.encode([image]);
28
+ }
29
+ /** Decode a token stream to a single image (zeros if the stream yields no frame). */
30
+ decode(tokens) {
31
+ const frames = this.video.decode(tokens);
32
+ return frames[0] ?? new Float32Array(this.frameSize);
33
+ }
34
+ /** Learn codebooks from a set of images (each is a one-frame clip). Returns recon MSE. */
35
+ fit(images, opts) {
36
+ return this.video.fit(images.map((im) => [im]), opts);
37
+ }
38
+ }
39
+ //# sourceMappingURL=image_rvq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_rvq.js","sourceRoot":"","sources":["../../src/codec/image_rvq.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAmC,MAAM,gBAAgB,CAAC;AAIhF,MAAM,OAAO,aAAa;IACxB,4EAA4E;IACnE,KAAK,CAAgB;IAE9B,YAAY,MAAgD;QAC1D,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;IAC9B,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IACpE,CAAC;IAED,sEAAsE;IACtE,MAAM,CAAC,KAAY;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,qFAAqF;IACrF,MAAM,CAAC,MAAgB;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,0FAA0F;IAC1F,GAAG,CAAC,MAAe,EAAE,IAA6C;QAChE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CACnB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EACxB,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * codec/ — modality codecs that turn non-text media into the discrete token
3
+ * streams Evermind's generator already speaks. Today: video (temporal residual
4
+ * VQ). Images are the single-frame case; audio/other modalities follow the same
5
+ * "media ⇄ tokens + unified vocab" shape.
6
+ */
7
+ export { MultimodalVocab, VIDEO_BANK_INTRA, VIDEO_BANK_INTER } from "./multimodal_vocab.js";
8
+ export type { MultimodalVocabConfig, TokenKind } from "./multimodal_vocab.js";
9
+ export { VideoRVQCodec } from "./video_rvq.js";
10
+ export type { VideoRVQConfig, Frame, Video } from "./video_rvq.js";
11
+ export { ImageRVQCodec } from "./image_rvq.js";
12
+ export { buildVideoSequence, generateVideo, generateImage } from "./evermind_video.js";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codec/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5F,YAAY,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * codec/ — modality codecs that turn non-text media into the discrete token
3
+ * streams Evermind's generator already speaks. Today: video (temporal residual
4
+ * VQ). Images are the single-frame case; audio/other modalities follow the same
5
+ * "media ⇄ tokens + unified vocab" shape.
6
+ */
7
+ export { MultimodalVocab, VIDEO_BANK_INTRA, VIDEO_BANK_INTER } from "./multimodal_vocab.js";
8
+ export { VideoRVQCodec } from "./video_rvq.js";
9
+ export { ImageRVQCodec } from "./image_rvq.js";
10
+ export { buildVideoSequence, generateVideo, generateImage } from "./evermind_video.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codec/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * multimodal_vocab.ts — one flat token space shared by text and video.
3
+ *
4
+ * Evermind's generator ({@link ../lm/evermind_lm.EvermindLM}) is a pure
5
+ * next-token predictor: it neither knows nor cares whether a token id is a BPE
6
+ * text piece or a quantised video-patch code. So "make Evermind generate video"
7
+ * is a *vocabulary* problem, not a model problem — lay text tokens, a handful of
8
+ * modality control tokens, and the video codebook codes out on a single integer
9
+ * axis, and the same model handles `(caption … <vid> … frames … </vid>)`.
10
+ *
11
+ * Layout (low → high):
12
+ *
13
+ * [ 0 .. textVocabSize ) text (BPE) — passthrough
14
+ * textVocabSize + 0 <vid> (BOS_VIDEO)
15
+ * textVocabSize + 1 </vid> (EOS_VIDEO)
16
+ * textVocabSize + 2 <key> (start of an intra frame)
17
+ * textVocabSize + 3 <delta> (start of an inter frame)
18
+ * codeBase + bank·levels·K + level·K + code residual-VQ code tokens
19
+ *
20
+ * where `bank ∈ {INTRA, INTER}`, `level ∈ [0, levels)`, `code ∈ [0, K)` and
21
+ * `K = codebookSize`. A frame is therefore a marker followed by
22
+ * `patchesPerFrame · levels` code tokens — a deterministic, self-delimiting
23
+ * structure the codec can parse straight out of the generator's output.
24
+ */
25
+ export declare const VIDEO_BANK_INTRA = 0;
26
+ export declare const VIDEO_BANK_INTER = 1;
27
+ export interface MultimodalVocabConfig {
28
+ /** Size of the text (BPE) region; 0 for a pure-video model. */
29
+ textVocabSize: number;
30
+ /** Residual-VQ depth (codes emitted per patch). */
31
+ levels: number;
32
+ /** Entries per codebook per level per bank. */
33
+ codebookSize: number;
34
+ }
35
+ /** What a token id decodes to when parsing a mixed stream. */
36
+ export type TokenKind = {
37
+ kind: "text";
38
+ id: number;
39
+ } | {
40
+ kind: "control";
41
+ control: "bosVideo" | "eosVideo" | "frameKey" | "frameDelta";
42
+ } | {
43
+ kind: "code";
44
+ bank: number;
45
+ level: number;
46
+ code: number;
47
+ };
48
+ /**
49
+ * Bijective map between (text ids, control tokens, video codes) and a single
50
+ * flat token id space. Owns the offset arithmetic so nothing else has to.
51
+ */
52
+ export declare class MultimodalVocab {
53
+ readonly textVocabSize: number;
54
+ readonly levels: number;
55
+ readonly codebookSize: number;
56
+ readonly bosVideo: number;
57
+ readonly eosVideo: number;
58
+ readonly frameKey: number;
59
+ readonly frameDelta: number;
60
+ readonly codeBase: number;
61
+ /** Total vocabulary size — pass this as EvermindLM's `vocabSize`. */
62
+ readonly size: number;
63
+ private readonly perBank;
64
+ constructor(cfg: MultimodalVocabConfig);
65
+ /** Global token id for a residual-VQ code. */
66
+ codeToken(bank: number, level: number, code: number): number;
67
+ isText(tok: number): boolean;
68
+ isCode(tok: number): boolean;
69
+ isVideoMarker(tok: number): boolean;
70
+ /** Decompose a code token into (bank, level, code). Level/code are meaningful even if the bank differs. */
71
+ decodeCode(tok: number): {
72
+ bank: number;
73
+ level: number;
74
+ code: number;
75
+ };
76
+ /** Classify any token id in the flat space. */
77
+ classify(tok: number): TokenKind;
78
+ }
79
+ //# sourceMappingURL=multimodal_vocab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multimodal_vocab.d.ts","sourceRoot":"","sources":["../../src/codec/multimodal_vocab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE;;;GAGG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,GAAG,EAAE,qBAAqB;IAgBtC,8CAA8C;IAC9C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC,2GAA2G;IAC3G,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAStE,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;CAQjC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * multimodal_vocab.ts — one flat token space shared by text and video.
3
+ *
4
+ * Evermind's generator ({@link ../lm/evermind_lm.EvermindLM}) is a pure
5
+ * next-token predictor: it neither knows nor cares whether a token id is a BPE
6
+ * text piece or a quantised video-patch code. So "make Evermind generate video"
7
+ * is a *vocabulary* problem, not a model problem — lay text tokens, a handful of
8
+ * modality control tokens, and the video codebook codes out on a single integer
9
+ * axis, and the same model handles `(caption … <vid> … frames … </vid>)`.
10
+ *
11
+ * Layout (low → high):
12
+ *
13
+ * [ 0 .. textVocabSize ) text (BPE) — passthrough
14
+ * textVocabSize + 0 <vid> (BOS_VIDEO)
15
+ * textVocabSize + 1 </vid> (EOS_VIDEO)
16
+ * textVocabSize + 2 <key> (start of an intra frame)
17
+ * textVocabSize + 3 <delta> (start of an inter frame)
18
+ * codeBase + bank·levels·K + level·K + code residual-VQ code tokens
19
+ *
20
+ * where `bank ∈ {INTRA, INTER}`, `level ∈ [0, levels)`, `code ∈ [0, K)` and
21
+ * `K = codebookSize`. A frame is therefore a marker followed by
22
+ * `patchesPerFrame · levels` code tokens — a deterministic, self-delimiting
23
+ * structure the codec can parse straight out of the generator's output.
24
+ */
25
+ export const VIDEO_BANK_INTRA = 0;
26
+ export const VIDEO_BANK_INTER = 1;
27
+ /**
28
+ * Bijective map between (text ids, control tokens, video codes) and a single
29
+ * flat token id space. Owns the offset arithmetic so nothing else has to.
30
+ */
31
+ export class MultimodalVocab {
32
+ textVocabSize;
33
+ levels;
34
+ codebookSize;
35
+ bosVideo;
36
+ eosVideo;
37
+ frameKey;
38
+ frameDelta;
39
+ codeBase;
40
+ /** Total vocabulary size — pass this as EvermindLM's `vocabSize`. */
41
+ size;
42
+ perBank;
43
+ constructor(cfg) {
44
+ if (cfg.textVocabSize < 0)
45
+ throw new Error("MultimodalVocab: textVocabSize must be ≥ 0");
46
+ if (cfg.levels <= 0 || cfg.codebookSize <= 0)
47
+ throw new Error("MultimodalVocab: levels and codebookSize must be > 0");
48
+ this.textVocabSize = cfg.textVocabSize;
49
+ this.levels = cfg.levels;
50
+ this.codebookSize = cfg.codebookSize;
51
+ this.bosVideo = cfg.textVocabSize;
52
+ this.eosVideo = cfg.textVocabSize + 1;
53
+ this.frameKey = cfg.textVocabSize + 2;
54
+ this.frameDelta = cfg.textVocabSize + 3;
55
+ this.codeBase = cfg.textVocabSize + 4;
56
+ this.perBank = cfg.levels * cfg.codebookSize;
57
+ this.size = this.codeBase + 2 * this.perBank;
58
+ }
59
+ /** Global token id for a residual-VQ code. */
60
+ codeToken(bank, level, code) {
61
+ return this.codeBase + bank * this.perBank + level * this.codebookSize + code;
62
+ }
63
+ isText(tok) {
64
+ return tok >= 0 && tok < this.textVocabSize;
65
+ }
66
+ isCode(tok) {
67
+ return tok >= this.codeBase && tok < this.size;
68
+ }
69
+ isVideoMarker(tok) {
70
+ return tok === this.frameKey || tok === this.frameDelta;
71
+ }
72
+ /** Decompose a code token into (bank, level, code). Level/code are meaningful even if the bank differs. */
73
+ decodeCode(tok) {
74
+ const idx = tok - this.codeBase;
75
+ const bank = Math.floor(idx / this.perBank);
76
+ const rem = idx - bank * this.perBank;
77
+ const level = Math.floor(rem / this.codebookSize);
78
+ const code = rem - level * this.codebookSize;
79
+ return { bank, level, code };
80
+ }
81
+ /** Classify any token id in the flat space. */
82
+ classify(tok) {
83
+ if (this.isText(tok))
84
+ return { kind: "text", id: tok };
85
+ if (tok === this.bosVideo)
86
+ return { kind: "control", control: "bosVideo" };
87
+ if (tok === this.eosVideo)
88
+ return { kind: "control", control: "eosVideo" };
89
+ if (tok === this.frameKey)
90
+ return { kind: "control", control: "frameKey" };
91
+ if (tok === this.frameDelta)
92
+ return { kind: "control", control: "frameDelta" };
93
+ return { kind: "code", ...this.decodeCode(tok) };
94
+ }
95
+ }
96
+ //# sourceMappingURL=multimodal_vocab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multimodal_vocab.js","sourceRoot":"","sources":["../../src/codec/multimodal_vocab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAiBlC;;;GAGG;AACH,MAAM,OAAO,eAAe;IACjB,aAAa,CAAS;IACtB,MAAM,CAAS;IACf,YAAY,CAAS;IAErB,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACjB,UAAU,CAAS;IACnB,QAAQ,CAAS;IAC1B,qEAAqE;IAC5D,IAAI,CAAS;IAEL,OAAO,CAAS;IAEjC,YAAY,GAA0B;QACpC,IAAI,GAAG,CAAC,aAAa,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QACzF,IAAI,GAAG,CAAC,MAAM,IA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AAE,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * video_rvq.ts — VideoRVQCodec: the pixels ⇄ tokens bottleneck that lets Evermind
3
+ * generate video without changing the generator.
4
+ *
5
+ * Evermind is a discrete-token autoregressive SSM. To make it a video model you
6
+ * do NOT touch the model — you give it a codec that maps a clip to a stream of
7
+ * discrete tokens and back. This is the visual analogue of the BPE tokenizer:
8
+ * where BPE turns text ⇄ ids, VideoRVQCodec turns frames ⇄ ids.
9
+ *
10
+ * Design — TEMPORAL residual vector quantization (the "video-from-the-start"
11
+ * choice):
12
+ *
13
+ * • Each frame is cut into non-overlapping p×p patches; each patch is a vector
14
+ * of length p·p·C (the "latent").
15
+ * • KEYFRAMES (frame 0 and every `keyframeInterval`-th frame) are quantized
16
+ * directly against the INTRA codebook bank.
17
+ * • Every other frame is INTER: we quantize the *residual against the previous
18
+ * RECONSTRUCTED frame* against the INTER bank. Video is mostly temporally
19
+ * redundant, so these deltas are small and cheap — this is exactly why an
20
+ * SSM (linear-time in sequence length) is the right generator for the long
21
+ * token streams video produces.
22
+ * • Quantization at each bank is RESIDUAL VQ over `levels` codebooks: level 0
23
+ * picks the nearest entry, level 1 quantizes what level 0 missed, and so on.
24
+ * More levels ⇒ finer reconstruction ⇒ more tokens per patch.
25
+ *
26
+ * The encoder runs closed-loop (it references its own reconstruction, never the
27
+ * ground-truth previous frame) so the decoder — which only ever has
28
+ * reconstructions — stays exactly in sync.
29
+ *
30
+ * Codebooks start random (a cold codec is lossy, like any untrained neural
31
+ * codec) and are learned by {@link VideoRVQCodec.fit} (greedy per-level k-means).
32
+ * Reaching photoreal fidelity needs training on a real corpus with real compute
33
+ * — that is the one genuine blocker on shipping generated video, not the wiring.
34
+ *
35
+ * Pure CPU, zero deps, deterministic under a seed — same conventions as the rest
36
+ * of the engine. A WGSL/WebGPU acceleration is a future drop-in with these shapes.
37
+ */
38
+ import { MultimodalVocab } from "./multimodal_vocab.js";
39
+ /** A single frame: length `height·width·channels`, layout `((y·W)+x)·C + ch`, values in [0,1]. */
40
+ export type Frame = Float32Array;
41
+ /** A clip: T frames, all the same shape. */
42
+ export type Video = Frame[];
43
+ export interface VideoRVQConfig {
44
+ height: number;
45
+ width: number;
46
+ /** Colour channels. Default 3 (RGB). */
47
+ channels?: number;
48
+ /** Square patch size; `height` and `width` must be divisible by it. Default 4. */
49
+ patch?: number;
50
+ /** Residual-VQ depth (codes per patch). Default 2. */
51
+ levels?: number;
52
+ /** Codebook entries per level per bank. Default 16. */
53
+ codebookSize?: number;
54
+ /** Emit a keyframe every N frames (frame 0 is always a keyframe). Default 12. */
55
+ keyframeInterval?: number;
56
+ /** Size of the text region this codec's tokens sit above; 0 ⇒ pure-video vocab. Default 0. */
57
+ textVocabSize?: number;
58
+ /** Deterministic seed for codebook init. */
59
+ seed?: number;
60
+ }
61
+ export declare class VideoRVQCodec {
62
+ readonly height: number;
63
+ readonly width: number;
64
+ readonly channels: number;
65
+ readonly patch: number;
66
+ readonly levels: number;
67
+ readonly codebookSize: number;
68
+ readonly keyframeInterval: number;
69
+ /** Patch latent dimension = patch·patch·channels. */
70
+ readonly latentDim: number;
71
+ /** Patches per frame = (H/patch)·(W/patch). */
72
+ readonly patchesPerFrame: number;
73
+ /** Code tokens emitted per frame = patchesPerFrame·levels. */
74
+ readonly tokensPerFrame: number;
75
+ /** The unified text+video vocabulary; feed `.vocab.size` to EvermindLM. */
76
+ readonly vocab: MultimodalVocab;
77
+ /** Two banks × levels codebooks; each codebook is `codebookSize × latentDim` row-major. */
78
+ private readonly banks;
79
+ constructor(config: VideoRVQConfig);
80
+ /** Total vocabulary size for this codec's model. */
81
+ get vocabSize(): number;
82
+ /**
83
+ * Serialize config + learned codebooks to a compact "VRQ0" binary. A generated
84
+ * video model is only servable if its codec travels with it (the decoder needs
85
+ * these codebooks), so this is the video analogue of EvermindLM.exportWeights.
86
+ */
87
+ serialize(): ArrayBuffer;
88
+ /** Reconstruct a codec (config + codebooks) from a "VRQ0" binary. */
89
+ static deserialize(buffer: ArrayBuffer): VideoRVQCodec;
90
+ /** Encode a clip to a self-delimiting token stream: `<vid> (marker codes…)… </vid>`. */
91
+ encode(video: Video): number[];
92
+ /**
93
+ * Decode a token stream back to frames. Tolerant by design: it skips text /
94
+ * stray tokens, treats a frame whose codes run short as zero-padded, and stops
95
+ * at `</vid>` or end-of-stream — so a stream sampled from an under-trained
96
+ * generator still yields a valid (if noisy) clip instead of throwing.
97
+ */
98
+ decode(tokens: number[]): Video;
99
+ /**
100
+ * Learn both codebook banks from a set of clips (greedy per-level k-means over
101
+ * residuals — the standard way to train residual VQ). Returns the mean
102
+ * reconstruction MSE over the training clips after fitting. This is the codec's
103
+ * "training"; the generator is trained separately on the resulting token streams.
104
+ */
105
+ fit(videos: Video[], opts?: {
106
+ iterations?: number;
107
+ seed?: number;
108
+ }): number;
109
+ /** Fit one bank's `levels` codebooks greedily over residuals. */
110
+ private fitBank;
111
+ private rvqEncode;
112
+ private toPatches;
113
+ private fromPatches;
114
+ private assertShape;
115
+ }
116
+ //# sourceMappingURL=video_rvq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video_rvq.d.ts","sourceRoot":"","sources":["../../src/codec/video_rvq.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAAE,eAAe,EAAsC,MAAM,uBAAuB,CAAC;AAE5F,kGAAkG;AAClG,MAAM,MAAM,KAAK,GAAG,YAAY,CAAC;AACjC,4CAA4C;AAC5C,MAAM,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC;AAE5B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,KAAK,CAA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