llm-large-files 0.10.0 → 0.10.2

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 (62) hide show
  1. package/CHANGELOG.md +136 -7
  2. package/dist/ask.d.ts +16 -0
  3. package/dist/ask.d.ts.map +1 -1
  4. package/dist/ask.js +26 -2
  5. package/dist/ask.js.map +1 -1
  6. package/dist/cache.d.ts +27 -1
  7. package/dist/cache.d.ts.map +1 -1
  8. package/dist/cache.js +96 -21
  9. package/dist/cache.js.map +1 -1
  10. package/dist/citations.d.ts.map +1 -1
  11. package/dist/citations.js +14 -7
  12. package/dist/citations.js.map +1 -1
  13. package/dist/events.d.ts +2 -1
  14. package/dist/events.d.ts.map +1 -1
  15. package/dist/events.js.map +1 -1
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/ingest.d.ts +12 -1
  21. package/dist/ingest.d.ts.map +1 -1
  22. package/dist/ingest.js +146 -11
  23. package/dist/ingest.js.map +1 -1
  24. package/dist/library.d.ts +55 -5
  25. package/dist/library.d.ts.map +1 -1
  26. package/dist/library.js +74 -4
  27. package/dist/library.js.map +1 -1
  28. package/dist/stores.d.ts +38 -1
  29. package/dist/stores.d.ts.map +1 -1
  30. package/dist/stores.js +184 -6
  31. package/dist/stores.js.map +1 -1
  32. package/dist/testing/store-checks.d.ts +8 -3
  33. package/dist/testing/store-checks.d.ts.map +1 -1
  34. package/dist/testing/store-checks.js +74 -1
  35. package/dist/testing/store-checks.js.map +1 -1
  36. package/dist/types.d.ts +56 -0
  37. package/dist/types.d.ts.map +1 -1
  38. package/docs/guides/costs-and-limits.md +3 -2
  39. package/docs/guides/deployment.md +3 -3
  40. package/docs/guides/errors-and-reliability.md +2 -1
  41. package/docs/guides/storage.md +62 -8
  42. package/docs/guides/vertex-and-gemini.md +1 -1
  43. package/docs/measurements.md +4 -4
  44. package/docs/reference/ask.md +30 -6
  45. package/docs/reference/events.md +1 -1
  46. package/docs/reference/gemini.md +9 -4
  47. package/docs/reference/library.md +106 -11
  48. package/docs/reference/testing.md +10 -4
  49. package/docs/reference/tools.md +4 -2
  50. package/docs/security.md +2 -1
  51. package/docs/upgrading-0.10.md +27 -15
  52. package/package.json +1 -1
  53. package/src/ask.ts +35 -2
  54. package/src/cache.ts +95 -19
  55. package/src/citations.ts +14 -7
  56. package/src/events.ts +2 -1
  57. package/src/index.ts +3 -3
  58. package/src/ingest.ts +144 -12
  59. package/src/library.ts +122 -8
  60. package/src/stores.ts +174 -7
  61. package/src/testing/store-checks.ts +74 -3
  62. package/src/types.ts +55 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtH,MAAM,MAAM,YAAY,GAAG;IACzB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF;;;;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AG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG;IACzB,sDAAsD;IACtD,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,sDAAsD;IACtD,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,GAAG,wBAAwB,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEnJ;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,iGAAiG;IACjG,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,mGAAmG;IACnG,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC"}
@@ -714,8 +714,9 @@ that counts and sums over it are exact, not made by eye. What a question costs t
714
714
  with a tool anyway, which takes 2 requests: in the live checks of 0.10.0, Flash-Lite did so for
715
715
  about half of these questions, and Flash rarely
716
716
  ([measurements](../measurements.md#tables-sent-whole-p1s-live-gate)). A reply that ends with no
717
- text and no call, and not by a filter or the output limit, is asked again once with a note, as in
718
- any question: one request more, with the table.
717
+ text and no call, and not by a filter, the output limit or another reason that asking again does
718
+ not mend (`finish: "other"`), is asked again once with a note, as in any question: one request
719
+ more, with the table.
719
720
  - **A count** takes about 3 requests: one that calls `aggregate_table` (or an exact search), one
720
721
  that answers from its result, and sometimes one more call. Each sends the table again. For a CSV
721
722
  of 3,000 invoices (113,000 estimated tokens, 131,000 with its lines numbered), one request of 0.9
@@ -22,7 +22,7 @@ rebuild from the store.
22
22
  | Searches of large files waiting their turn | A queue in each `LargeFiles` (`maxConcurrentScans`) | No | Empty |
23
23
  | Ingests waiting their turn | A queue in each `LargeFiles` (`maxConcurrentIngests`, new in 0.8.2) | No | Empty: the uploads in it get no answer, and must be sent again |
24
24
  | Uploads being received | A count in each set of `createDocumentHandlers` (`maxPendingUploadBytes`, new in 0.8.2) | No | Empty |
25
- | Store calls past their time limit that have not ended | A count in each process (`files.stats().stuckStoreCalls`, new in 0.10.0) | No | Zero |
25
+ | Store calls past their time limit that have not ended, and since 0.10.2 an ingest's own reads of a path upload | A count in each process (`files.stats().stuckStoreCalls`, new in 0.10.0) | No | Zero |
26
26
  | The output limit a thinking model needs for whole-file part reads | Each process, by URL and model | No | Learned again, at the cost of one request |
27
27
  | The name of the output limit an OpenAI-compatible server takes | Each `openAiCompatible()` adapter | No | Learned again, at the cost of one refused request |
28
28
 
@@ -185,8 +185,8 @@ http.createServer((request, response) => {
185
185
 
186
186
  | What takes memory | How much | What bounds it |
187
187
  |---|---|---|
188
- | Documents kept ready to search | Up to `cacheBytes`, 256 MB by default | `cacheBytes`; `cacheSize` also caps their number |
189
- | A document loaded whole: text up to `wholeDocumentBytes` (2 MB), or any size when the store has no `readTextRange` | Its text and a lowercased copy: 2 bytes a character for ASCII text, 4 for any other | Counted in `cacheBytes`. One larger than `cacheBytes` is loaded again for each call and not kept |
188
+ | Documents kept ready to search | Up to `cacheBytes`, 256 MB by default, and since 0.10.2 the last document larger than that, kept apart for a minute after its last use | `cacheBytes`; `cacheSize` also caps their number, the one kept apart counted |
189
+ | A document loaded whole: text up to `wholeDocumentBytes` (2 MB), or any size when the store has no `readTextRange` | Its text and a lowercased copy: 2 bytes a character for ASCII text, 4 for any other | Counted in `cacheBytes`. One larger than `cacheBytes` is not kept with the others: since 0.10.2 the last one is kept apart, on top of `cacheBytes`, for a minute after its last use (before, it was loaded again for each call) |
190
190
  | A document read by range | Its line index: about 8 bytes a line (8.2 MB for a log of a million lines) | Counted in `cacheBytes` |
191
191
  | Searches of documents read by range | Tens of MB each at their peak (60 to 80 MB for a search of a log of 95 MB on Windows; 49 MB above the process for one of 100 MB on Linux, [measurements](../measurements.md#the-server)): `scanChunkBytes` (1 MB) of text read, decoded and lowercased, the next piece read ahead, and what the pieces leave until the next collection | `maxConcurrentScans` (4) per `LargeFiles`. The others wait, and those waiting for the same file share one pass over it |
192
192
  | Decoded pieces of a document read by range | Up to its whole decoded text | Kept within `cacheBytes`, and only for a document whose decoded text takes at most a quarter of it |
@@ -744,7 +744,8 @@ New in 0.10.0. A store that stops answering no longer holds a question forever.
744
744
  the library has a time limit, `storeTimeoutMs` (30 s by default): past it, the call is a
745
745
  `DocumentStoreError` of code `"ETIMEDOUT"`, a 503 to retry. In a question it ends the question with
746
746
  `run.error`, and the model sees no new text. While too many calls of the process are stuck past
747
- their limit (`maxStuckStoreCalls`, half of `UV_THREADPOOL_SIZE`), store calls fail at once with code
747
+ their limit (`maxStuckStoreCalls`, half of the libuv pool, at least 1: 2 when `UV_THREADPOOL_SIZE`
748
+ is unset), store calls fail at once with code
748
749
  `"STORE_STUCK"`, 503 too, so that the server keeps its threads for everything else. Both are
749
750
  category `"store"` for `errorInfoOf`: the words of the `"store"` case above fit them ("try again in
750
751
  a moment"). [Deployment](./deployment.md#a-store-that-stops-answering) says how to size the limits
@@ -97,8 +97,15 @@ With `scopes` (new in 0.9.0), the files of each scope are in a folder of their o
97
97
  - `put` writes the text first and the metadata last. `delete` removes the metadata first, and
98
98
  nothing else when that fails: it throws, and the document stays whole. Once the metadata is
99
99
  gone, the document is gone: `delete` returns true, and a text, index or original it could not
100
- remove is left for `sweep` (new in 0.9.0: it threw). A document never appears without its text,
101
- and is never listed once its text is gone.
100
+ remove is left for `sweep` (new in 0.9.0: it threw). A document never appears without its text.
101
+ Once its text is gone, a question takes it as missing; `getMeta` and `list` still give its
102
+ metadata until `sweep` removes it (since 0.10.2, once that metadata is older than `orphanAgeMs`).
103
+ - `patchMeta` (`files.touch`, `files.update`, `dedupe`, 0.10.2) reads the metadata, changes it and
104
+ writes it whole. On one server its changes take turns with `put` and `delete` of the same document,
105
+ so a document deleted and stored again meanwhile is never written over. Across servers that share
106
+ the folder nothing makes them take turns: a change on one server at the moment of a delete and a
107
+ new `put` of the same ID on another can write the old metadata over the new document (with
108
+ `scopes`, both are in one chat's folder, so of one user), or leave metadata without text.
102
109
  - File names are document IDs: the library's (`doc_` and 32 hex digits), or, since 0.9.0, an
103
110
  application's ([Application IDs](#application-ids)). `APP_DOCUMENT_ID_PATTERN` leaves out the
104
111
  names Windows keeps for devices (`con`, `nul`, `com1` and the like), since `con.json` is not a
@@ -565,8 +572,10 @@ setInterval(() => {
565
572
  }, 60 * 60 * 1000).unref();
566
573
  ```
567
574
 
568
- - At ingest, `expiresAt` is set to `createdAt` plus `ttlMs`. It never changes: the library has no
569
- call to extend it.
575
+ - At ingest, `expiresAt` is set to `createdAt` plus `ttlMs`. Since 0.10.2,
576
+ [`files.touch(id, access)`](../reference/library.md#filestouchid-access) counts it again from now,
577
+ so that a file a chat still uses stays (see [Expiry from the last use](#expiry-from-the-last-use)),
578
+ and so does `ingest({ dedupe: true })` for the document it gives back. Nothing else changes it.
570
579
  - From that instant the document counts as missing everywhere: `getMeta` and `getOriginal` give
571
580
  undefined, `prepare` lists it in `missing`, and a question throws `DocumentsNotFoundError`. The
572
581
  library checks `expiresAt` with its own clock before every use, whether or not the store has
@@ -603,6 +612,46 @@ answers without them, and a function can ingest them again from the uploads you
603
612
  `toISOString()`. In the example store below, change `meta.expiresAt` and the record's own
604
613
  `expiresAt` together: `sweep` and a TTL index read the second.
605
614
 
615
+ ### Expiry from the last use
616
+
617
+ New in 0.10.2. With a store that has `patchMeta` (both built-in stores do), `files.touch` counts a
618
+ document's expiry again from the time of the call, so `ttlMs` becomes the time a file is kept after
619
+ its last use rather than after its upload. It writes the metadata alone, never the text, and an
620
+ expiry already later stays. Call it for the documents of each question:
621
+
622
+ ```ts
623
+ const result = await askGemini({ files, endpoint, documentIds, owner: userId, scope: [userId, chatId], messages });
624
+ // The chat used these files: they stay ttlMs from now.
625
+ await Promise.all(documentIds.map((id) => files.touch!(id, { owner: userId, scope: [userId, chatId] })));
626
+ ```
627
+
628
+ ### A chat's files, its own data and the same file twice
629
+
630
+ New in 0.10.2. Three calls for a chat that keeps its files in the library, with no second list of
631
+ them in your database:
632
+
633
+ - **`files.list({ owner, scope })`** gives the documents stored with exactly that owner and scope,
634
+ the oldest first, for the chat's file panel (a document without an owner is listed only to a
635
+ caller without one: its ID alone opens it). It needs a store with `list`; the built-in stores read the
636
+ chat's folder (a `FileDocumentStore` without `scopes` reads its whole directory: give it `scopes`,
637
+ or keep your own list, when it holds many files).
638
+ - **`appData`** is your own data about a document, kept with its metadata and never sent to the
639
+ model: the ID of its row in your database, who uploaded it, a label. Set it at ingest
640
+ (`ingest({ appData })`), change it with `files.update(id, { appData }, access)`, remove it with
641
+ `appData: null`. A JSON object of at most 16 KB.
642
+ - **`ingest({ dedupe: true })`** gives back the chat's document of the same file (same owner, scope
643
+ and SHA-256) when a user uploads it again, instead of a second copy. The file is read once to
644
+ hash it, not extracted; the document keeps its own name, `createdAt` and `appData`, and its expiry
645
+ is counted again. Its `createdAt` is before the upload: if your app deletes an upload's document
646
+ when a later step fails, do not delete this one. Dedupe looks at what is stored: two uploads of
647
+ the same file at the same moment may both be stored. The upload handlers of `llm-large-files/node`
648
+ do not pass `dedupe` or `appData`.
649
+
650
+ ```ts
651
+ const meta = await files.ingest({ name, bytes, owner: userId, scope: [userId, chatId], dedupe: true, appData: { uploadedBy: userId } });
652
+ const panel = (await files.list!({ owner: userId, scope: [userId, chatId] })).map((doc) => ({ ...toDocumentSummary(doc), by: doc.appData?.uploadedBy }));
653
+ ```
654
+
606
655
  ## Keeping the uploaded files
607
656
 
608
657
  By default only the text of a document is kept. `keepOriginals` keeps the uploaded file too, for
@@ -729,9 +778,10 @@ export function ingestSaved(userId: string, chatId: string, uploadId: string, na
729
778
  byte past it. What it throws becomes a `DocumentStoreError` (operation `"read"`) with its error as
730
779
  `cause` ([`OriginalsReader`](../reference/library.md#originalsreader)).
731
780
  - **The same file twice.** Every document of 0.9.0 has `meta.sha256`, the SHA-256 of the upload,
732
- for bytes and for paths. The library does not look for another document of the same file: to
733
- give a user the document of a file already in the chat, compare it with the `sha256` your
734
- session record keeps for the chat's documents. Never across owners.
781
+ for bytes and for paths. Since 0.10.2, `ingest({ dedupe: true })` gives back the document of the
782
+ same owner and scope with the same SHA-256 ([below](#a-chats-files-its-own-data-and-the-same-file-twice)).
783
+ Or compare it yourself with the `sha256` your session record keeps for the chat's documents. Never
784
+ across owners.
735
785
 
736
786
  ## Writing a store of your own
737
787
 
@@ -800,6 +850,8 @@ Which context a call carries:
800
850
  | `readTextRange(id, start, end)` | No | To read a document larger than `wholeDocumentBytes`, and to build its index. Only after `getMeta` found the document. | Return the bytes of the text from `start` (inclusive) to `end` (exclusive). See [Reading by range](#reading-by-range). |
801
851
  | `putIndex(id, index)` | No | `ingest`, after `putOriginal` and before `put`, for every document. Again when a document read by range has no index, or one that does not match its text. | Keep the bytes. |
802
852
  | `getIndex(id)` | No | When a document read by range is opened. | Return the bytes `putIndex` kept, or undefined. A damaged index is noticed and built again. |
853
+ | `list()` | No | `files.list`, and `ingest({ dedupe: true })`. New in 0.10.2. | Return the metadata of the documents of `context.scope` (of no scope without one). Expired ones may be left out or given: the library leaves them out. A query on the scope, not a read of each document: index the field you keep the scope in. |
854
+ | `patchMeta(id, patch)` | No | `files.touch`, `files.update`, and `ingest({ dedupe: true })` for the document it gives back. New in 0.10.2. | Change only the fields of `patch` (the later `expiresAt`; `appData` set, or removed when `null`), only in the document of that `id` whose `createdAt`, owner and scope are `patch`'s (absent is none), applied to what is stored at the time of the write; return the metadata after the change, or undefined, writing nothing, when there is no such document. In MongoDB: `findOneAndUpdate({ _id: id, "meta.createdAt": patch.createdAt, "meta.owner": patch.owner ?? null, "meta.scope": patch.scope ?? null }, { $max: { "meta.expiresAt": patch.expiresAt }, $set: { "meta.appData": … } }, { returnDocument: "after" })` (`null` matches a field left out), and `$unset` for `null`. In a store that keeps `expiresAt` in a field of its own for a TTL index, change that field too. |
803
855
 
804
856
  The library checks `expiresAt` itself, with its own clock, before every use. Your `getMeta` and
805
857
  `get` may return a document that has expired; your `sweep` must remove it. If they remove an expired
@@ -828,6 +880,8 @@ What a missing optional method changes:
828
880
  | `getOriginal` | `files.getOriginal` returns undefined, and `view_pages` is never offered. |
829
881
  | `readTextRange` | Every document is loaded whole with `get`, whatever its size, so memory grows with the size of the files in use and the number of users. `wholeDocumentBytes`, `scanChunkBytes` and `maxConcurrentScans` change nothing. |
830
882
  | `putIndex` and `getIndex` | With `readTextRange` only: the index of a large document is built by reading its whole text once, 4 MB at a time, each time the document is opened, that is, each time it is not in the cache. |
883
+ | `list` | `files.list` and `ingest({ dedupe: true })` are a `TypeError` (0.10.2). |
884
+ | `patchMeta` | `files.touch` and `files.update` are a `TypeError`, and `dedupe` counts no expiry again (0.10.2). |
831
885
 
832
886
  ### Reading by range
833
887
 
@@ -1217,7 +1271,7 @@ just those lines.
1217
1271
 
1218
1272
  | Option | Default | What it does |
1219
1273
  |---|---|---|
1220
- | `cacheBytes` | `DEFAULT_CACHE_BYTES`: 256 MB | The most memory the kept documents may take, decoded pieces of large documents included. The least recently used go first. A document larger than this is read again for each call. `0` keeps none. |
1274
+ | `cacheBytes` | `DEFAULT_CACHE_BYTES`: 256 MB | The most memory the kept documents may take, decoded pieces of large documents included. The least recently used go first. A document larger than this is not kept with them: since 0.10.2 the last one is kept apart, on top of this, for a minute after its last use (before, it was read again for each call). `0` keeps none. |
1221
1275
  | `cacheSize` | No cap | Also caps the number of documents kept. The pieces of a document read by range do not count. |
1222
1276
  | `wholeDocumentBytes` | `DEFAULT_WHOLE_DOCUMENT_BYTES`: 2 MB | A document whose text is at most this many bytes is loaded whole. A larger one is read by range, when the store has `readTextRange`. `Infinity` loads every document whole; `0` reads every one by range. |
1223
1277
  | `scanChunkBytes` | 1 MB | Reading by range: about this many bytes of text are read and searched at a time. |
@@ -662,7 +662,7 @@ not an overflow.
662
662
  | A conflict | 409 | `"invalid"` | Yes |
663
663
  | A gateway refused the body as too large | 413 | `"context_overflow"` | Made smaller, as in [A request too large](#a-request-too-large) |
664
664
  | Gemini failed on its side | 5xx | `"server"` | Yes |
665
- | An error inside a stream, or in a body of HTTP 200, without a numeric code | The status of its `google.rpc` name: `"UNAVAILABLE"` 503, `"RESOURCE_EXHAUSTED"` 429, `"DEADLINE_EXCEEDED"` 504, `"INVALID_ARGUMENT"` 400 …; 500 for a name it does not know. Before 0.10.0, 200. | By the status | Yes for 429 and 5xx, unless text was shown; a daily quota is `"quota"`, and is not |
665
+ | An error inside a stream, or in a body of HTTP 200, without a numeric code | The status of its `google.rpc` name: `"UNAVAILABLE"` 503, `"RESOURCE_EXHAUSTED"` 429, `"DEADLINE_EXCEEDED"` 504, `"INVALID_ARGUMENT"` 400 …; 500 for a name it does not know. Before 0.10.0, 200. | By the status | Yes for 408, 409, 429 and 5xx (`"ABORTED"` and `"ALREADY_EXISTS"` are 409), unless text was shown; a daily quota is `"quota"`, and is not |
666
666
  | Nothing came for `firstByteTimeoutMs` or `idleTimeoutMs` | 0 | `"timeout"` | Once |
667
667
  | A part read took longer than `timeoutMs` | 0 | `"timeout"` | Once (since 0.10.0) |
668
668
  | The connection failed, or a stream ended before its `finishReason` | 0 | `"unreachable"` | Yes, unless text was shown |
@@ -18,8 +18,8 @@ as it was recorded, with the release it was recorded for. Before you rely on a n
18
18
  probe that reproduced a fault, and so does this page.
19
19
  - **Version** is the release a result was recorded for. 0.1.0 is of 2026-11-06, 0.2.0 and 0.3.0 of
20
20
  2026-11-10, 0.3.5 and 0.3.6 of 2026-11-11, 0.4.0 of 2026-11-12, and 0.4.1 and 0.5.0 of
21
- 2026-11-13. The checks of 0.6.0 are of November 2026. The live results of 0.10.0, not released
22
- yet, are of 2026-11-24. All live results are of November 2026.
21
+ 2026-11-13. The checks of 0.6.0 are of November 2026. The live results of 0.10.0 (released on
22
+ 2026-11-25) are of 2026-11-24. All live results are of November 2026.
23
23
  - **Main** is a result recorded on the code on `main` up to commit 5157e7f (2026-11-20), or on its
24
24
  branches, before the rest of 0.6.0 was written. "The 0.6 review" is the review of that code, of
25
25
  2026-11-20.
@@ -38,8 +38,8 @@ as it was recorded, with the release it was recorded for. Before you rely on a n
38
38
 
39
39
  | Provider | Live runs on record | Not run live |
40
40
  |---|---|---|
41
- | Gemini API: `askGemini`, `gemini()`, `geminiApi()` | From 0.1.0 to 0.5.0: large files, pages of PDFs, explorer pairs, follow-up questions. 0.10.0: the prompt cache, thought signatures of earlier questions, and the eval's cases at pass^3 ([below](#0100-live-on-the-gemini-api)) | Gemini 2.5 with pages (`toolFilePlacement`) and in explorer pairs: it is closed to new users on the Gemini API |
42
- | Vertex AI: `vertexAi()` | 0.3.0: pages of PDFs, in the locations `global` and `eu`. 0.3.5: explorer pairs. Main (see above): a count, a repeated search, the error of a request too large, and in the 0.6 review a production log of 3 MB | Everything of 0.10.0, among it thought signatures of earlier questions, Model Armor, `LANGUAGE` and labels |
41
+ | Gemini API: `askGemini`, `gemini()`, `geminiApi()` | From 0.1.0 to 0.5.0: large files, pages of PDFs, explorer pairs, follow-up questions. 0.10.0: the eval's cases at pass^3, and two probes: the prompt cache, and thought signatures sent back with earlier questions, which 0.10.0 does not send ([below](#0100-live-on-the-gemini-api)) | Gemini 2.5 with pages (`toolFilePlacement`) and in explorer pairs: it is closed to new users on the Gemini API |
42
+ | Vertex AI: `vertexAi()` | 0.3.0: pages of PDFs, in the locations `global` and `eu`. 0.3.5: explorer pairs. Main (see above): a count, a repeated search, the error of a request too large, and in the 0.6 review a production log of 3 MB | Everything of 0.10.0, among it Model Armor, `LANGUAGE` and labels |
43
43
  | OpenAI-compatible: `openAiCompatible()` | 0.5.0: Gemini's OpenAI layer only. 0.10.0: a streamed tool call on Gemini's OpenAI layer | Every other server: OpenAI, Azure OpenAI, DeepSeek, OpenRouter, vLLM, Ollama, LiteLLM, llama.cpp. The adapter is tested against fake servers. `pdfInput` was never run to an answer: Gemini's OpenAI layer refuses its `file` part (HTTP 400), it was not run against OpenAI itself, and it follows OpenAI's documented shape untested |
44
44
  | Claude: `anthropic()` | None | The whole adapter. It is tested against the request and response shapes of the Messages API documentation |
45
45
 
@@ -9,7 +9,7 @@ task, where there is one.
9
9
  ```ts
10
10
  import {
11
11
  askWithFiles, askStream, partialResultOf, DocumentsNotFoundError, UsageMeter, TOOL_TURN_VERSION,
12
- evidenceOf, mergeRanges, stubResult, DEFAULT_INPUT_TOKENS, answerInfoOf, checkCitations,
12
+ evidenceOf, mergeRanges, stubResult, compactToolTurns, DEFAULT_INPUT_TOKENS, answerInfoOf, checkCitations,
13
13
  EXPLORER_INSTRUCTION, FINAL_ANSWER_REQUEST, FINAL_ANSWER_AFTER_PAGES, FINAL_ANSWER_WITHOUT_TOOLS,
14
14
  } from "llm-large-files";
15
15
  import type {
@@ -53,7 +53,8 @@ Contents:
53
53
  [`UsageMeter`](#usagemeter)
54
54
  - **Evidence and ranges:** [`Evidence`](#evidence), [`NumberRange`](#numberrange),
55
55
  [`evidenceOf(call, result)`](#evidenceofcall-result), [`mergeRanges(ranges)`](#mergerangesranges),
56
- [`stubResult(call, result, hadFiles?)`](#stubresultcall-result-hadfiles)
56
+ [`stubResult(call, result, hadFiles?)`](#stubresultcall-result-hadfiles),
57
+ [`compactToolTurns(turns)`](#compacttoolturnsturns)
57
58
 
58
59
  The rest of the main entry is on three other pages: [library and documents](./library.md)
59
60
  (`createLargeFiles`, the budget, stores, extractors, document types), [errors and
@@ -300,6 +301,7 @@ The options of `askWithFiles`.
300
301
  | `onEvent` | `(event: AskEvent) => void` | none | Everything the question does, as typed events in order: `run.start`, the `plan`, each model request (`request.start`, `retry`, `request.end`), each tool call (`tool.start`, `tool.progress`, `tool.end`), the text, the notices, and last `run.finish` or `run.error`. See [events](./events.md). `onText`, `onActivity` and `onStep` still get the same strings, at the same moments. A model error in an event is told by its kind and status, never in the provider's words ([`EventError`](./errors-and-retries.md#errors-in-events-eventerror)). Tool results are left out unless `eventResults` is set. A throw from it ends the question with that error ([a listener that throws](./events.md#a-listener-that-throws)). New in 0.7.0. |
301
302
  | `runId` | `string` | `"run_"` and 16 hex digits | The `runId` of every event of the question. Pass your own to find the events in your logs. New in 0.7.0. |
302
303
  | `eventResults` | `boolean` | `false` | Put each tool result in its `tool.end` event (`result`), and `toolTurns` in the result that `run.finish` and `run.error` carry. Off by default: results hold the text of the documents, and events are often sent on to a browser. The result `askWithFiles` returns always has `toolTurns`. New in 0.7.0. |
304
+ | `storeRounds` | `"full" \| "compact"` | `"full"` | How `result.toolTurns` holds the results of the question's calls. `"full"`: as the model had them. `"compact"`: each large result replaced by its stand-in ([`stubResult`](#stubresultcall-result-hadfiles)), as [`compactToolTurns`](#compacttoolturnsturns) makes it, so a stored question takes a few hundred bytes for most calls instead of up to 24,000 characters (the stand-in of a whole-file read keeps its notes, up to 6,000 characters). A later question sends the stand-ins, and the model reads again what it needs, at the price of a tool call. The requests of this question are the same either way. Another value is a `TypeError`. New in 0.10.2. |
303
305
  | `filteredAnswer` | `"keep" \| "drop"` | `"keep"` | What to do with an answer that a filter of the provider stopped (`result.finish` `"filtered"`). `"keep"` keeps its text, as in 0.9, with `answered: true` when it has some. `"drop"` gives `answered: false` and `text: ""`. Text that was already sent (`onText`, `text` events) cannot be taken back: the `answer_filtered` notice then has `discardText: true`, before `run.finish`, and the page takes the text away. Text of a reply that was not streamed is not sent at all. Any other value (`"Drop"`, `true`) is a `TypeError` before any request: it would keep an answer that was meant to be dropped. See [filtered and cut answers](../guides/errors-and-reliability.md#filtered-and-cut-answers). New in 0.10.0. |
304
306
  | `onToolResult` | `(context: ToolResultContext) => ToolResultVerdict \| undefined \| Promise<ToolResultVerdict \| undefined>` | none | Called with the result of every tool call that ran, as soon as it is in (the hooks of one turn may run at the same time), before the model, the evidence, the steps and the events get it ([`ToolResultContext` and `ToolResultVerdict`](#toolresultcontext-and-toolresultverdict)). A call that was refused, not run, or answered with a pointer is not passed to it. What it throws, or a value of another shape, ends the question. For data loss prevention: [security](../security.md#tool-results-ontoolresult). New in 0.10.0. |
305
307
  | `signal` | `AbortSignal` | none | Stops the question: the request under way is aborted through the adapter, tool calls stop, and nothing is sent again. `askWithFiles` then throws the signal's reason, at once: the loop does not wait for an adapter, or a part reader, that does not look at the signal. A request left running that way may be billed by the provider, and is not counted in the usage. Since 0.10.0 the loop does not wait either for `files.prepare`, a tool call or `onToolResult` once it aborts, and it passes the signal on with the access of the question (`PrepareOptions.signal`, `ToolOptions.access.signal`), for a library that ends its own waits for the store with it. |
@@ -350,7 +352,7 @@ question that failed.
350
352
  | `blockReason` | `string`, optional | Why the provider refused the prompt, in the adapter's words. Set only then. Nothing more is asked after a refusal. |
351
353
  | `steps` | `string[]` | Each finished step, in order: a line for each tool call, run or refused ("Search app.log (exact) for “timeout” — 12 matching lines", or "… — already shown above"), one for the calls of a turn over `callsPerTurn`, and one when the loop shortened older results, asked again after an empty or broken reply, or planned the documents again. The second try of the answer says "The model's answer was empty: it was asked again" or "The model called a tool instead of answering: it was asked again for the answer". The lines `onStep` got. Each is one line of plain text: a line break, a tab or another control character in what the model sent becomes one space with the blanks around it; the invisible characters that file text loses are dropped (text-direction overrides and isolates, zero-width spaces, word joiners, soft hyphens, tag characters); `](` becomes `] (`, so that a markdown link or picture stays text. A query is cut at 80 characters and a task at 100, never in the middle of a character. Steps still quote the model's words, HTML tags and web addresses included: show them as plain text, never as markdown or HTML. |
352
354
  | `evidence` | [`Evidence[]`](#evidence) | What the model was shown. First each file sent whole, in the order of its block: `{ tool: "inline", documentId, document, lines: [[1, lines]], whole: true }`, with no `callId` (new in 0.10.0). Then what each tool call showed: the document, and the lines or pages, in call order. A call that failed, was not run, or was answered with a pointer to an earlier result adds none. Each of those has the `callId` of its call's events (new in 0.7.0). |
353
- | `toolTurns` | [`ToolTurn[]`](#toolturn) | The tool rounds of this question, as plain JSON, as the model last had them. Pass them back in `messages`, between this question and its answer, and a later question sees what was found here. Each result of a call made in this question has `tool_turns_left`, except a stand-in (`dropped: true`, see [`stubResult`](#stubresultcall-result-hadfiles)): a result shortened to make room, a pointer whose result was shortened, and the result of a call that showed pages. The pages are not kept: their stand-in says which pages were shown. A call's `problem` is left out. |
355
+ | `toolTurns` | [`ToolTurn[]`](#toolturn) | The tool rounds of this question, as plain JSON, as the model last had them. Pass them back in `messages`, between this question and its answer, and a later question sees what was found here. Each result of a call made in this question has `tool_turns_left`, except a stand-in (`dropped: true`, see [`stubResult`](#stubresultcall-result-hadfiles)): a result shortened to make room, a pointer whose result was shortened, and the result of a call that showed pages. The pages are not kept: their stand-in says which pages were shown. A call's `problem` is left out. With `storeRounds: "compact"` (0.10.2), each large result is its stand-in ([`compactToolTurns`](#compacttoolturnsturns)). |
354
356
  | `plan` | [`DocumentPlan`](./library.md#documentplan) | Which documents went in whole (`inline`) and which were reached through tools (`searchable`). |
355
357
  | `missing` | `string[]`, optional | The documents of `documentIds` that were missing, and that the question was answered without (`onMissingDocuments` `"drop"`). Absent when none was. New in 0.9.0. |
356
358
  | `budget` | [`Budget`](./library.md#budget) | The budget the question ran with: the library's (with `options.budget`), fitted to the models. |
@@ -359,7 +361,7 @@ question that failed.
359
361
  | `usage` | [`UsageTotals`](#usagetotals) | Tokens and requests of the whole question, whole-file part reads included, in all and for each model by its `id`. The input of requests that reported none is in `estimatedInputTokens`. |
360
362
  | `lastUsage` | `Record<string, unknown>`, optional | The provider's own usage object of the last chat reply that had one, as it came. |
361
363
  | `finish` | `"complete" \| "cut" \| "filtered" \| "malformed_call" \| "other"`, optional | How the reply whose text is the answer ended (`ModelReply.finish`), or the last reply of the chat when none answered. Absent when the adapter does not say. `"filtered"` and `"cut"` come with an `answer_filtered` or `answer_cut` notice. New in 0.10.0. |
362
- | `citations` | [`CitationCheck`](#citationcheck), optional | The line citations of `text`, checked against the evidence of the question: a document sent whole, or read whole, counts as shown, every line it has. Set when the question had documents. New in 0.10.0. |
364
+ | `citations` | [`CitationCheck`](#citationcheck), optional | The line citations of `text`, checked against the evidence of the question: a document sent whole, or read whole for an answer, counts as shown, every line it has; a read of items, the lines of its items. Set when the question had documents. New in 0.10.0. |
363
365
 
364
366
  Guides: [conversations](../guides/conversations.md) (`toolTurns`),
365
367
  [costs and limits](../guides/costs-and-limits.md) (`usage`),
@@ -642,8 +644,10 @@ line it names was shown, by the lines of an evidence entry of that document. An
642
644
  `whole: true` (a file read whole, or sent whole) and no `lines` shows every line; one with `lines`
643
645
  (`[[1, 120]]`) shows those, so a line past the end of the file is not supported. Two documents of
644
646
  one name support it by either. `askWithFiles` counts each document sent whole, and each document
645
- read whole (`analyze_whole_document`), as shown from its first line to its last
646
- (`DocumentMeta.lines`): its `evidence` is not changed for that.
647
+ read whole for an answer (`analyze_whole_document`), as shown from its first line to its last
648
+ (`DocumentMeta.lines`): its `evidence` is not changed for that. A read with `output: "items"` shows
649
+ the lines of its items only (its evidence has them as `lines`), so a citation of another line of
650
+ that file is not supported.
647
651
 
648
652
  | Field | Type | What it holds |
649
653
  |---|---|---|
@@ -1248,6 +1252,26 @@ declare function mergeRanges(ranges: NumberRange[]): NumberRange[];
1248
1252
  The ranges in order, with those that overlap or touch made one: `[1, 30]` and `[31, 35]` become
1249
1253
  `[1, 35]`. It returns a new array and leaves `ranges` as it was. The sample above shows it.
1250
1254
 
1255
+ ### compactToolTurns(turns)
1256
+
1257
+ ```ts
1258
+ declare function compactToolTurns(turns: readonly ToolTurn[]): ToolTurn[];
1259
+ ```
1260
+
1261
+ New in 0.10.2. Stored tool rounds made small, for a database that keeps every question: each call's
1262
+ result is replaced by its [`stubResult`](#stubresultcall-result-hadfiles) stand-in when that is
1263
+ smaller, and errors and small results stay as they are. It returns copies, and makes the same
1264
+ rounds that `storeRounds: "compact"` gives, from rounds stored in full (by 0.10.1 and earlier, or
1265
+ by `"full"`). A later question takes them as any stored round: the model sees that the results were
1266
+ dropped to make room, and reads again what it needs.
1267
+
1268
+ ```ts
1269
+ // Shrink the stored questions of a chat once it is older than a day.
1270
+ for (const turn of await turns.find({ sessionId, createdAt: { $lt: dayAgo } }).toArray()) {
1271
+ await turns.updateOne({ _id: turn._id }, { $set: { toolTurns: compactToolTurns(turn.toolTurns) } });
1272
+ }
1273
+ ```
1274
+
1251
1275
  ### stubResult(call, result, hadFiles?)
1252
1276
 
1253
1277
  ```ts
@@ -837,7 +837,7 @@ this order, and each stage ends before the next starts:
837
837
  | `"extract"` | pages, or parts | the pages, or the parts | Text read: each page of a PDF; each part of a DOCX (body, footnotes, headers…), each slide of a PPTX or each sheet of an XLSX. | A PDF, DOCX, PPTX or XLSX, or an extractor of your own that reports it. Not a text file. |
838
838
  | `"pictures"` | pages | the pages | Pages looked at for pictures. | A PDF, with `@cantoo/pdf-lib` installed and `pictures` on. |
839
839
  | `"decode"` | bytes | the bytes | One event when the file is decoded. | A text file that is not UTF-8, and every HTML file. |
840
- | `"prepare"` | characters | the characters | The text cleaned before it is cut into lines. | Every file. |
840
+ | `"prepare"` | characters | the characters | The text cleaned before it is cut into lines. | Every file, except one that `dedupe` (0.10.2) answers with a document stored before: it has no stage after `ingest.start`, only `ingest.finish`. |
841
841
  | `"index"` | characters | the characters | The line index built. | A store with `putIndex`, such as `FileDocumentStore`. |
842
842
  | `"store"` | parts | the writes | Each write to the store, once done: the original file (`keepOriginals`), the line index, then the text. | Every file. |
843
843
 
@@ -107,7 +107,7 @@ The endpoint of a Gemini model on Vertex AI, signed in with an OAuth access toke
107
107
  | `project` | `string` | required with `accessToken` | The Google Cloud project ID. URL-encoded into the path. Not with `apiKey`. |
108
108
  | `model` | `string` | required | The model that answers, under `publishers/google/models/`. Without an explorer it also makes the tool calls. |
109
109
  | `explorerModel` | `string \| undefined` | none | A second model that explores the documents, with the same rules as in [`geminiApi()`](#geminiapioptions). It is in the same project and location. |
110
- | `location` | `string` | `"global"` | Where the requests are served. It picks the host ([`vertexHost()`](#vertexhostlocation)) and is the `locations/{location}` segment of the path. It must be lowercase letters, digits and single hyphens (`"global"`, `"us"`, `"europe-west4"`): anything else throws a `TypeError`, since 0.7.1. Not with `apiKey`. |
110
+ | `location` | `string` | `"global"` | Where the requests are served. It picks the host ([`vertexHost()`](#vertexhostlocation)) and is the `locations/{location}` segment of the path. It must be lowercase letters, digits and single hyphens (`"global"`, `"us"`, `"europe-west4"`): anything else throws a `TypeError`, since 0.7.1 (with `host`, it is not checked, only URL-encoded). Not with `apiKey`. |
111
111
  | `accessToken` | `string \| ((context: { refresh: boolean }) => string \| Promise<string>)` | required without `apiKey` | Sent as `Authorization: Bearer {token}`. A function is called before every request, chat requests and part reads of both models alike, so it can return a renewed token. Since 0.10.0 it is called with `{ refresh: true }` when the token it gave was refused with HTTP 401: return a new token then, not the one kept in a cache. A function of no arguments still fits. |
112
112
  | `apiKey` | `string` | none | The API key of Vertex AI express mode, sent as the `x-goog-api-key` header. The URL then names no project or location: `{host}/{apiVersion}/publishers/google/models/{model}:generateContent`. Give `apiKey` or `project` and `accessToken`, not both. New in 0.10.0. |
113
113
  | `headers` | `Record<string, string>` or a function that returns them | none | More headers, merged after the library's: a name you give replaces the library's. A function is called before every request with the context the endpoint's `headers` get (`{ refresh: true }` after a 401). New in 0.10.0. |
@@ -164,6 +164,7 @@ type VertexAiOptions =
164
164
  project: string;
165
165
  location?: string;
166
166
  accessToken: string | ((context: { refresh: boolean }) => string | Promise<string>);
167
+ apiKey?: never;
167
168
  model: string;
168
169
  explorerModel?: string | undefined;
169
170
  headers?: HeaderSource | undefined;
@@ -172,6 +173,9 @@ type VertexAiOptions =
172
173
  }
173
174
  | {
174
175
  apiKey: string;
176
+ project?: never;
177
+ location?: never;
178
+ accessToken?: never;
175
179
  model: string;
176
180
  explorerModel?: string | undefined;
177
181
  headers?: HeaderSource | undefined;
@@ -179,11 +183,12 @@ type VertexAiOptions =
179
183
  apiVersion?: string;
180
184
  };
181
185
  // HeaderSource = Record<string, string> | ((context?: { refresh?: boolean }) => Record<string, string> | Promise<Record<string, string>>)
186
+ // HeaderSource is exported from llm-large-files since 0.10.1.
182
187
  ```
183
188
 
184
189
  The options of [`vertexAi()`](#vertexaioptions): a project with a token, or an API key of express
185
- mode. The type refuses a project with an API key, and a project without a token. New as a type of
186
- its own in 0.10.0.
190
+ mode. The type refuses a project with an API key (the `never` fields), and a project without a
191
+ token. New as a type of its own in 0.10.0.
187
192
 
188
193
  ### vertexHost(location)
189
194
 
@@ -484,7 +489,7 @@ What `send` does:
484
489
  | Case | Error | `status` | `kind` |
485
490
  |---|---|---|---|
486
491
  | Gemini answered with an HTTP error | `GeminiRequestError` with Gemini's `error.message`, or "Gemini returned HTTP 503." | The HTTP status | Told from the status, Gemini's `error.status` and `details` |
487
- | An error object inside the stream, or in a reply of HTTP 200 that is not streamed | `GeminiRequestError` with its message, or "Gemini reported an error." | Its `code` when that is a number; else, since 0.10.0, the status of its `google.rpc` name (`"UNAVAILABLE"` 503, `"RESOURCE_EXHAUSTED"` 429, `"DEADLINE_EXCEEDED"` 504, `"INVALID_ARGUMENT"` 400 …); else 500. Before 0.10.0, the response's 200, so it was not sent again. | As above |
492
+ | An error object inside the stream, or in a reply of HTTP 200 that is not streamed | `GeminiRequestError` with its message, or "Gemini reported an error." | Its `code` when that is a whole number from 400 to 599; else, since 0.10.0, the status of its `google.rpc` name (`"UNAVAILABLE"` 503, `"RESOURCE_EXHAUSTED"` 429, `"DEADLINE_EXCEEDED"` 504, `"INVALID_ARGUMENT"` 400 …); else 500. Before 0.10.0, the response's 200, so it was not sent again. | As above |
488
493
  | The connection failed, before or while the reply arrived, or an event of the stream was not JSON | `GeminiRequestError`: "Gemini could not be reached (fetch failed)." | 0 | `"unreachable"` |
489
494
  | A reply of HTTP 200 whose body is empty | `GeminiRequestError`: "Gemini could not be reached (the reply was empty).", new in 0.6.0. When the reply's type is `text/event-stream`, "Gemini's reply ended before it was complete." Either is sent again as a reply cut off on its way. | 0 | `"unreachable"` |
490
495
  | Nothing arrived for a whole wait | `GeminiRequestError`: "Gemini sent nothing for 600 s." | 0 | `"timeout"` |