llm-large-files 0.4.1 → 0.7.0

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 (236) hide show
  1. package/CHANGELOG.md +1400 -338
  2. package/README.md +217 -49
  3. package/dist/analyze.d.ts +5 -0
  4. package/dist/analyze.d.ts.map +1 -1
  5. package/dist/analyze.js +96 -47
  6. package/dist/analyze.js.map +1 -1
  7. package/dist/anthropic/adapter.d.ts +117 -0
  8. package/dist/anthropic/adapter.d.ts.map +1 -0
  9. package/dist/anthropic/adapter.js +542 -0
  10. package/dist/anthropic/adapter.js.map +1 -0
  11. package/dist/anthropic/index.d.ts +3 -0
  12. package/dist/anthropic/index.d.ts.map +1 -0
  13. package/dist/anthropic/index.js +2 -0
  14. package/dist/anthropic/index.js.map +1 -0
  15. package/dist/ask.d.ts +200 -0
  16. package/dist/ask.d.ts.map +1 -0
  17. package/dist/ask.js +1402 -0
  18. package/dist/ask.js.map +1 -0
  19. package/dist/budget.d.ts +23 -0
  20. package/dist/budget.d.ts.map +1 -0
  21. package/dist/budget.js +64 -0
  22. package/dist/budget.js.map +1 -0
  23. package/dist/encoding.d.ts +17 -0
  24. package/dist/encoding.d.ts.map +1 -0
  25. package/dist/encoding.js +852 -0
  26. package/dist/encoding.js.map +1 -0
  27. package/dist/errors.d.ts +4 -0
  28. package/dist/errors.d.ts.map +1 -1
  29. package/dist/errors.js +15 -0
  30. package/dist/errors.js.map +1 -1
  31. package/dist/events.d.ts +333 -0
  32. package/dist/events.d.ts.map +1 -0
  33. package/dist/events.js +159 -0
  34. package/dist/events.js.map +1 -0
  35. package/dist/evidence.d.ts +42 -0
  36. package/dist/evidence.d.ts.map +1 -0
  37. package/dist/evidence.js +138 -0
  38. package/dist/evidence.js.map +1 -0
  39. package/dist/extract.d.ts +35 -3
  40. package/dist/extract.d.ts.map +1 -1
  41. package/dist/extract.js +626 -58
  42. package/dist/extract.js.map +1 -1
  43. package/dist/gemini/adapter.d.ts +59 -0
  44. package/dist/gemini/adapter.d.ts.map +1 -0
  45. package/dist/gemini/adapter.js +226 -0
  46. package/dist/gemini/adapter.js.map +1 -0
  47. package/dist/gemini/chat.d.ts +53 -77
  48. package/dist/gemini/chat.d.ts.map +1 -1
  49. package/dist/gemini/chat.js +42 -300
  50. package/dist/gemini/chat.js.map +1 -1
  51. package/dist/gemini/errors.d.ts +16 -0
  52. package/dist/gemini/errors.d.ts.map +1 -0
  53. package/dist/gemini/errors.js +46 -0
  54. package/dist/gemini/errors.js.map +1 -0
  55. package/dist/gemini/generate.d.ts +18 -21
  56. package/dist/gemini/generate.d.ts.map +1 -1
  57. package/dist/gemini/generate.js +49 -92
  58. package/dist/gemini/generate.js.map +1 -1
  59. package/dist/gemini/index.d.ts +6 -4
  60. package/dist/gemini/index.d.ts.map +1 -1
  61. package/dist/gemini/index.js +4 -3
  62. package/dist/gemini/index.js.map +1 -1
  63. package/dist/gemini/sse.d.ts +1 -2
  64. package/dist/gemini/sse.d.ts.map +1 -1
  65. package/dist/gemini/sse.js +1 -38
  66. package/dist/gemini/sse.js.map +1 -1
  67. package/dist/http.d.ts +136 -0
  68. package/dist/http.d.ts.map +1 -0
  69. package/dist/http.js +401 -0
  70. package/dist/http.js.map +1 -0
  71. package/dist/index.d.ts +18 -2
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +13 -4
  74. package/dist/index.js.map +1 -1
  75. package/dist/library.d.ts +96 -8
  76. package/dist/library.d.ts.map +1 -1
  77. package/dist/library.js +414 -96
  78. package/dist/library.js.map +1 -1
  79. package/dist/map-reduce.d.ts +37 -1
  80. package/dist/map-reduce.d.ts.map +1 -1
  81. package/dist/map-reduce.js +255 -61
  82. package/dist/map-reduce.js.map +1 -1
  83. package/dist/model.d.ts +278 -0
  84. package/dist/model.d.ts.map +1 -0
  85. package/dist/model.js +222 -0
  86. package/dist/model.js.map +1 -0
  87. package/dist/node/handlers.d.ts +20 -4
  88. package/dist/node/handlers.d.ts.map +1 -1
  89. package/dist/node/handlers.js +122 -20
  90. package/dist/node/handlers.js.map +1 -1
  91. package/dist/node/index.d.ts +2 -0
  92. package/dist/node/index.d.ts.map +1 -1
  93. package/dist/node/index.js +1 -0
  94. package/dist/node/index.js.map +1 -1
  95. package/dist/node/sse.d.ts +59 -0
  96. package/dist/node/sse.d.ts.map +1 -0
  97. package/dist/node/sse.js +174 -0
  98. package/dist/node/sse.js.map +1 -0
  99. package/dist/openai/adapter.d.ts +109 -0
  100. package/dist/openai/adapter.d.ts.map +1 -0
  101. package/dist/openai/adapter.js +567 -0
  102. package/dist/openai/adapter.js.map +1 -0
  103. package/dist/openai/index.d.ts +3 -0
  104. package/dist/openai/index.d.ts.map +1 -0
  105. package/dist/openai/index.js +2 -0
  106. package/dist/openai/index.js.map +1 -0
  107. package/dist/output-limit.d.ts +42 -0
  108. package/dist/output-limit.d.ts.map +1 -0
  109. package/dist/output-limit.js +121 -0
  110. package/dist/output-limit.js.map +1 -0
  111. package/dist/pause.d.ts +24 -0
  112. package/dist/pause.d.ts.map +1 -0
  113. package/dist/pause.js +38 -0
  114. package/dist/pause.js.map +1 -0
  115. package/dist/pdf-pages.d.ts +32 -2
  116. package/dist/pdf-pages.d.ts.map +1 -1
  117. package/dist/pdf-pages.js +275 -14
  118. package/dist/pdf-pages.js.map +1 -1
  119. package/dist/pdf-pictures.d.ts +30 -3
  120. package/dist/pdf-pictures.d.ts.map +1 -1
  121. package/dist/pdf-pictures.js +50 -8
  122. package/dist/pdf-pictures.js.map +1 -1
  123. package/dist/pdf-work.d.ts +40 -0
  124. package/dist/pdf-work.d.ts.map +1 -0
  125. package/dist/pdf-work.js +734 -0
  126. package/dist/pdf-work.js.map +1 -0
  127. package/dist/plan.d.ts +22 -4
  128. package/dist/plan.d.ts.map +1 -1
  129. package/dist/plan.js +61 -12
  130. package/dist/plan.js.map +1 -1
  131. package/dist/retry.d.ts +76 -0
  132. package/dist/retry.d.ts.map +1 -0
  133. package/dist/retry.js +141 -0
  134. package/dist/retry.js.map +1 -0
  135. package/dist/search.d.ts +8 -2
  136. package/dist/search.d.ts.map +1 -1
  137. package/dist/search.js +60 -10
  138. package/dist/search.js.map +1 -1
  139. package/dist/sse.d.ts +36 -0
  140. package/dist/sse.d.ts.map +1 -0
  141. package/dist/sse.js +153 -0
  142. package/dist/sse.js.map +1 -0
  143. package/dist/stores.d.ts.map +1 -1
  144. package/dist/stores.js +5 -2
  145. package/dist/stores.js.map +1 -1
  146. package/dist/text-index.d.ts +6 -0
  147. package/dist/text-index.d.ts.map +1 -1
  148. package/dist/text-index.js +25 -8
  149. package/dist/text-index.js.map +1 -1
  150. package/dist/text.d.ts +62 -2
  151. package/dist/text.d.ts.map +1 -1
  152. package/dist/text.js +314 -14
  153. package/dist/text.js.map +1 -1
  154. package/dist/tools.d.ts +72 -1
  155. package/dist/tools.d.ts.map +1 -1
  156. package/dist/tools.js +341 -60
  157. package/dist/tools.js.map +1 -1
  158. package/dist/types.d.ts +128 -4
  159. package/dist/types.d.ts.map +1 -1
  160. package/dist/zip-directory.d.ts +43 -0
  161. package/dist/zip-directory.d.ts.map +1 -0
  162. package/dist/zip-directory.js +130 -0
  163. package/dist/zip-directory.js.map +1 -0
  164. package/docs/README.md +288 -0
  165. package/docs/api.md +58 -184
  166. package/docs/configuration.md +34 -490
  167. package/docs/getting-started.md +412 -177
  168. package/docs/guides/anthropic.md +590 -0
  169. package/docs/guides/conversations.md +629 -0
  170. package/docs/guides/costs-and-limits.md +726 -0
  171. package/docs/guides/deployment.md +654 -0
  172. package/docs/guides/errors-and-reliability.md +735 -0
  173. package/docs/guides/explorer-model.md +399 -0
  174. package/docs/guides/openai-compatible.md +602 -0
  175. package/docs/guides/own-adapter-and-loop.md +1169 -0
  176. package/docs/guides/pdfs.md +971 -0
  177. package/docs/guides/storage.md +731 -0
  178. package/docs/guides/testing.md +1199 -0
  179. package/docs/guides/vertex-and-gemini.md +717 -0
  180. package/docs/guides/web-app.md +1589 -0
  181. package/docs/how-it-works.md +1022 -138
  182. package/docs/measurements.md +881 -0
  183. package/docs/publishing.md +274 -46
  184. package/docs/reference/anthropic.md +427 -0
  185. package/docs/reference/ask.md +892 -0
  186. package/docs/reference/errors-and-retries.md +758 -0
  187. package/docs/reference/events.md +993 -0
  188. package/docs/reference/gemini.md +823 -0
  189. package/docs/reference/library.md +1467 -0
  190. package/docs/reference/node.md +528 -0
  191. package/docs/reference/openai.md +385 -0
  192. package/docs/reference/tools.md +883 -0
  193. package/docs/security.md +902 -90
  194. package/docs/troubleshooting.md +1390 -0
  195. package/package.json +22 -4
  196. package/src/analyze.ts +93 -42
  197. package/src/anthropic/adapter.ts +611 -0
  198. package/src/anthropic/index.ts +2 -0
  199. package/src/ask.ts +1560 -0
  200. package/src/budget.ts +71 -0
  201. package/src/encoding.ts +850 -0
  202. package/src/errors.ts +17 -0
  203. package/src/events.ts +442 -0
  204. package/src/evidence.ts +165 -0
  205. package/src/extract.ts +602 -62
  206. package/src/gemini/adapter.ts +271 -0
  207. package/src/gemini/chat.ts +87 -355
  208. package/src/gemini/errors.ts +48 -0
  209. package/src/gemini/generate.ts +67 -94
  210. package/src/gemini/index.ts +6 -4
  211. package/src/gemini/sse.ts +1 -34
  212. package/src/http.ts +434 -0
  213. package/src/index.ts +55 -4
  214. package/src/library.ts +497 -97
  215. package/src/map-reduce.ts +266 -59
  216. package/src/model.ts +433 -0
  217. package/src/node/handlers.ts +137 -22
  218. package/src/node/index.ts +2 -0
  219. package/src/node/sse.ts +198 -0
  220. package/src/openai/adapter.ts +613 -0
  221. package/src/openai/index.ts +2 -0
  222. package/src/output-limit.ts +135 -0
  223. package/src/pause.ts +41 -0
  224. package/src/pdf-pages.ts +268 -15
  225. package/src/pdf-pictures.ts +56 -9
  226. package/src/pdf-work.ts +722 -0
  227. package/src/plan.ts +68 -12
  228. package/src/retry.ts +176 -0
  229. package/src/search.ts +63 -10
  230. package/src/sse.ts +159 -0
  231. package/src/stores.ts +5 -2
  232. package/src/text-index.ts +26 -7
  233. package/src/text.ts +323 -13
  234. package/src/tools.ts +338 -62
  235. package/src/types.ts +129 -5
  236. package/src/zip-directory.ts +136 -0
@@ -1,257 +1,492 @@
1
- # Integration guide
1
+ # Getting started
2
2
 
3
- This guide adds large-file support to an existing chatbot backend in four steps. The examples use
4
- Express and Gemini, with notes for other setups.
3
+ This page takes you from `npm install` to a first answer about a file, then through the steps of
4
+ adding the library to an app. Each step is short and links to the guide that explains it.
5
5
 
6
- ## 1. Install
6
+ ## Install
7
7
 
8
8
  ```bash
9
9
  npm install llm-large-files
10
- npm install jszip unpdf # optional: DOCX/PPTX and PDF support
11
- npm install @cantoo/pdf-lib # optional: let the model look at pages of a PDF (pictures, charts)
12
10
  ```
13
11
 
14
- ## 2. Create the library once
12
+ The library needs Node.js 20.19 or later. It is an ES module, and its TypeScript types come with
13
+ it. From CommonJS code, `require("llm-large-files")` works on the Node versions that load ES
14
+ modules with `require()` by default: 20.19 and later in Node 20, 22.12 and later, and 23 and later.
15
+ On Node 21 and on 22.0 to 22.11, load it with `import("llm-large-files")`.
15
16
 
16
- ```ts
17
- // large-files.ts
18
- import { createLargeFiles, FileDocumentStore } from "llm-large-files";
17
+ Text, Markdown, logs, JSON and CSV need nothing more. Three optional packages add the rest:
19
18
 
20
- export const files = createLargeFiles({
21
- store: new FileDocumentStore(process.env.LARGE_FILES_DIR ?? "./data/large-files"),
22
- // Your connector's real limits. Anything left out uses the defaults in docs/configuration.md.
23
- budget: { contextTokens: 1_000_000, maxRequestBytes: 10_000_000 },
24
- ttlMs: 72 * 60 * 60 * 1000, // keep uploads for 3 days
25
- maxUploadBytes: 100 * 1024 * 1024,
26
- // Optional: keep uploaded PDFs, so the model can look at their pages (see "Pictures" below).
27
- // keepOriginals: ["pdf"],
28
- });
19
+ ```bash
20
+ npm install jszip unpdf @cantoo/pdf-lib # Node 24 and later
21
+ npm install jszip unpdf@1 @cantoo/pdf-lib # Node 22
22
+ npm install jszip unpdf@1.7.0 @cantoo/pdf-lib # Node 20
23
+ ```
24
+
25
+ | Package | What it enables |
26
+ | --- | --- |
27
+ | `jszip` | DOCX and PPTX files. |
28
+ | `unpdf` | PDF files: their text, with tables rebuilt as rows. |
29
+ | `@cantoo/pdf-lib` | The model can look at the pages of a PDF (`view_pages`, with `keepOriginals`). The text of a PDF also marks the pages that show a picture. |
30
+
31
+ Without the package a format needs, its upload fails with an error that names the package, such
32
+ as `Reading PDF files needs the optional dependency "unpdf".` Install `@cantoo/pdf-lib` before you
33
+ turn on `keepOriginals`: without it, every look at a page fails. The details are in
34
+ [PDFs](./guides/pdfs.md).
29
35
 
30
- // Reclaim disk space from expired uploads (expired files are already ignored on read).
31
- setInterval(() => void files.sweep(), 60 * 60 * 1000).unref();
36
+ On Node 24 and later, `npm install unpdf` installs unpdf 2, which asks for Node 24. On Node 22,
37
+ install `unpdf@1`, and on Node 20, `unpdf@1.7.0`. An unpdf that cannot read PDFs on your version
38
+ of Node is refused at the first PDF, with a message that says what to install, such as
39
+ `The unpdf installed cannot read PDF files on Node 20 (…). Install unpdf 1.7.0 (npm install unpdf@1.7.0), or run Node 22 or later.`
40
+
41
+ The Vertex AI samples on this page also use Google's auth library, which is not a dependency of
42
+ this package:
43
+
44
+ ```bash
45
+ npm install google-auth-library
32
46
  ```
33
47
 
34
- Running several server instances? Give them a shared store. Use a shared disk, or implement
35
- `DocumentStore` over Redis, S3, or your database (see [configuration](configuration.md#stores)).
48
+ ## Quickstart
36
49
 
37
- ## 3. Accept uploads
50
+ This script ingests one file and asks one question about it, with Gemini on Vertex AI. You need a
51
+ Google Cloud project with Vertex AI turned on, and Application Default Credentials (on your own
52
+ machine, `gcloud auth application-default login`).
38
53
 
39
54
  ```ts
40
- import express from "express";
41
- import { createDocumentHandlers } from "llm-large-files/node";
55
+ // quickstart.mts
56
+ import { readFile } from "node:fs/promises";
57
+ import { basename } from "node:path";
58
+ import { GoogleAuth } from "google-auth-library";
59
+ import { createLargeFiles, MemoryDocumentStore } from "llm-large-files";
60
+ import { askGemini, vertexAi } from "llm-large-files/gemini";
42
61
 
43
- const app = express();
44
- const documents = createDocumentHandlers(files, {
45
- // Uploads become private to this user. Return undefined to allow anonymous use.
46
- getOwner: (req) => (req as any).user?.id,
62
+ const [path, question] = process.argv.slice(2);
63
+ if (!path || !question) throw new Error('Usage: node quickstart.mts <file> "<question>"');
64
+
65
+ // 1. The library. This one keeps documents in memory, for as long as the process runs.
66
+ const files = createLargeFiles({ store: new MemoryDocumentStore() });
67
+
68
+ // 2. Ingest the file: its text is extracted, measured and stored.
69
+ const doc = await files.ingest({ name: basename(path), bytes: await readFile(path) });
70
+ console.log(`${doc.name}: ${doc.format}, ${doc.lines} lines, about ${doc.estimatedTokens} tokens\n`);
71
+
72
+ // 3. Ask. The access token comes from Application Default Credentials.
73
+ const auth = new GoogleAuth({ scopes: "https://www.googleapis.com/auth/cloud-platform" });
74
+ const endpoint = vertexAi({
75
+ project: process.env.GOOGLE_CLOUD_PROJECT!,
76
+ location: "global", // the default; or "us", "eu", or a region such as "europe-west4"
77
+ model: "gemini-3.8-flash",
78
+ accessToken: async () => (await auth.getAccessToken())!,
47
79
  });
48
80
 
49
- // Mount before express.json(): the body is the raw file, not JSON.
50
- app.post("/api/documents", documents.upload);
51
- app.get("/api/documents/:id", (req, res) => documents.get(req, res, req.params.id));
52
- app.delete("/api/documents/:id", (req, res) => documents.remove(req, res, req.params.id));
53
- app.use(express.json());
81
+ const result = await askGemini({
82
+ files,
83
+ endpoint,
84
+ documentIds: [doc.id],
85
+ messages: [{ role: "user", text: question }],
86
+ onText: (delta) => process.stdout.write(delta), // the answer, as it streams
87
+ });
88
+
89
+ console.log(`\n\n${result.plan.inline.length > 0 ? "Read whole" : "Searched with tools"}, ${result.turns} chat request(s)`);
90
+ for (const step of result.steps) console.log(`- ${step}`);
54
91
  ```
55
92
 
56
- The response is a `DocumentSummary`:
93
+ Node 22.18 and later in Node 22, and Node 23.6 and later, run TypeScript files directly:
57
94
 
58
- ```json
59
- { "id": "doc_3f9c…", "name": "app.log", "mimeType": "text/plain", "format": "log",
60
- "bytes": 5082044, "lines": 60000, "estimatedTokens": 1270511, "expiresAt": "2026-11-09T07:43:14.435Z" }
95
+ ```bash
96
+ GOOGLE_CLOUD_PROJECT=your-project-id node quickstart.mts ./app.log "What failed first, and when?"
61
97
  ```
62
98
 
63
- Errors are JSON `{ "error": "…" }`: 400 when there's no file name, 413 when the file is too large,
64
- 422 for an unreadable file (binary, empty, a zip bomb, or a scanned PDF that cannot be shown page by
65
- page), and 500 when the server fails, as when the store's disk is full. `getOwner` can refuse a
66
- request by throwing an error with a `status`, such as 401 (see the [API reference](api.md)).
99
+ In PowerShell, set the variable with `$env:GOOGLE_CLOUD_PROJECT = "your-project-id"`, then run
100
+ `node quickstart.mts ./app.log "What failed first, and when?"`. On older versions of Node, compile
101
+ the file first, with `typescript` and `@types/node` installed:
102
+ `npx tsc --module nodenext --target es2022 quickstart.mts`. Then run `node quickstart.mjs` with
103
+ the same arguments.
104
+
105
+ What happened:
106
+
107
+ - `ingest` extracted the text of the file, counted its lines and estimated its tokens, and stored
108
+ it. The `doc.id` it returned is how you name the document from then on.
109
+ - `askGemini` planned the request. A document that fits the budget goes into the prompt whole: by
110
+ default up to 200,000 tokens of document text, in a window of 1,000,000 tokens and a request of
111
+ 10 MB. A larger one becomes a short card, and the model gets tools to search it, read lines of
112
+ it, get an overview of it, and read it whole in parts.
113
+ - When the model used tools, the loop ran its calls and sent it what they returned, until it
114
+ answered: at most 12 chat requests by default, the last of which must be answered in text, and
115
+ one more when that answer comes back without text. `result.steps` lists what it did, for example
116
+ `Search app.log (exact) for “timeout” — 12 matching lines`.
67
117
 
68
- **Other servers.** The handlers take Node's `IncomingMessage` / `ServerResponse`, so they work with
69
- `node:http`, Express, Koa (`ctx.req`, `ctx.res`), Fastify (`request.raw`, `reply.raw`), and Next.js
70
- API routes on the Node runtime. Not using Node HTTP? Call `files.ingest({ name, mimeType, bytes, owner })`
71
- yourself and return `toDocumentSummary(meta)`.
118
+ The details of the plan and the loop are in [How it works](./how-it-works.md).
72
119
 
73
- ### Browser
120
+ The quickstart works the same with other providers. Each sample below replaces its step 3, from
121
+ `const auth` to the end of the `askGemini` call. Put the sample's imports in place of the two
122
+ Vertex AI imports, those of `google-auth-library` and `llm-large-files/gemini`.
123
+
124
+ ### With a Gemini API key
125
+
126
+ `askGemini` takes the Gemini Developer API with an API key:
74
127
 
75
128
  ```ts
76
- async function uploadLargeFile(file: File) {
77
- const response = await fetch("/api/documents", {
78
- method: "POST",
79
- headers: {
80
- "Content-Type": "application/octet-stream",
81
- "X-File-Name": encodeURIComponent(file.name),
82
- "X-File-Type": file.type,
83
- },
84
- body: file,
85
- });
86
- const result = await response.json();
87
- if (!response.ok) throw new Error(result.error);
88
- return result; // keep result.id with the conversation
89
- }
129
+ import { askGemini, geminiApi } from "llm-large-files/gemini";
130
+
131
+ const result = await askGemini({
132
+ files,
133
+ endpoint: geminiApi({ apiKey: process.env.GEMINI_API_KEY!, model: "gemini-3.8-flash" }),
134
+ documentIds: [doc.id],
135
+ messages: [{ role: "user", text: question }],
136
+ onText: (delta) => process.stdout.write(delta),
137
+ });
90
138
  ```
91
139
 
92
- **Which files should go to the server?** Anything your current inline path can't handle. A
93
- practical rule is text over about 512 KB and PDFs over about 7 MB (base64 makes them about a
94
- third bigger). Smaller files can keep your existing path. PDFs under your payload limit are better
95
- sent inline, because Gemini then reads every page with its layout and images. For larger PDFs,
96
- turn on `keepOriginals` (below) so the model can ask for the pages it needs.
140
+ ### With an OpenAI-compatible model
141
+
142
+ `askGemini` is `askWithFiles` with a Gemini model. With any other model, call `askWithFiles` and
143
+ pass the model as an adapter. `openAiCompatible()` speaks Chat Completions: OpenAI, Azure OpenAI,
144
+ DeepSeek, OpenRouter, vLLM, Ollama, LiteLLM, llama.cpp.
145
+
146
+ ```ts
147
+ import { askWithFiles } from "llm-large-files";
148
+ import { openAiCompatible } from "llm-large-files/openai";
149
+
150
+ const model = openAiCompatible({
151
+ baseUrl: "https://api.openai.com/v1", // the default; DeepSeek, OpenRouter, vLLM, Ollama: their own
152
+ apiKey: process.env.OPENAI_API_KEY!,
153
+ model: "gpt-5.5",
154
+ contextTokens: 400_000, // your model's context window: the plan follows it
155
+ });
156
+
157
+ const result = await askWithFiles({
158
+ files,
159
+ model,
160
+ documentIds: [doc.id],
161
+ messages: [{ role: "user", text: question }],
162
+ onText: (delta) => process.stdout.write(delta),
163
+ });
164
+ ```
97
165
 
98
- ## 4. Answer questions
166
+ Set `contextTokens` to the window of your model. Without it, the plan assumes the library's
167
+ window, 1,000,000 tokens unless you set another. The recipe for each server is in
168
+ [OpenAI-compatible endpoints](./guides/openai-compatible.md).
99
169
 
100
- ### With Gemini or Vertex AI: `askGemini`
170
+ ### With Claude
101
171
 
102
172
  ```ts
103
- import { askGemini, DocumentsNotFoundError, geminiApi } from "llm-large-files/gemini";
104
-
105
- const endpoint = geminiApi({ apiKey: process.env.GEMINI_API_KEY!, model: "gemini-3.8-flash" });
106
-
107
- app.post("/api/chat", async (req, res) => {
108
- const { messages, documentIds } = req.body; // messages: [{ role: "user" | "model", text }]
109
- res.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache" });
110
- const send = (event: string, data: unknown) => res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
111
- const abort = new AbortController();
112
- res.on("close", () => abort.abort());
113
- try {
114
- await askGemini({
115
- files, endpoint, messages, documentIds,
116
- owner: (req as any).user?.id,
117
- system: "You are our support assistant.",
118
- generationConfig: { temperature: 0.3, maxOutputTokens: 8192 },
119
- signal: abort.signal,
120
- onText: (text) => send("text", text), // answer, streamed
121
- onActivity: (text) => send("activity", text), // "Searching app.log for “timeout”…"
122
- onStep: (text) => send("step", text), // "Search app.log … — 12 matching lines"
123
- });
124
- send("done", {});
125
- } catch (error) {
126
- send("error", error instanceof DocumentsNotFoundError
127
- ? "A file has expired. Please attach it again."
128
- : String((error as Error).message));
129
- }
130
- res.end();
173
+ import { askWithFiles } from "llm-large-files";
174
+ import { anthropic } from "llm-large-files/anthropic";
175
+
176
+ const model = anthropic({
177
+ apiKey: process.env.ANTHROPIC_API_KEY!,
178
+ model: "claude-opus-5-5",
179
+ contextTokens: 1_000_000, // your model's context window: the plan follows it
180
+ });
181
+
182
+ const result = await askWithFiles({
183
+ files,
184
+ model,
185
+ documentIds: [doc.id],
186
+ messages: [{ role: "user", text: question }],
187
+ onText: (delta) => process.stdout.write(delta),
131
188
  });
132
189
  ```
133
190
 
134
- What `askGemini` does each turn:
191
+ Thinking, streaming and gateways for Claude are in [Claude](./guides/anthropic.md).
192
+
193
+ ## Integrate it into your app
194
+
195
+ The quickstart holds everything in one process for one question. An app creates the library once,
196
+ takes uploads in one request and questions in others, and keeps the conversation between them.
197
+ The samples below use Gemini on Vertex AI. With another provider, use `askWithFiles` as above:
198
+ the options these samples use are the same, with `model` in place of `endpoint`. Model settings
199
+ that `askGemini` takes (`generationConfig`, `toolFilePlacement`, the waits) are options of the
200
+ adapter there.
135
201
 
136
- 1. Measures the rest of the request (history, system prompt, other files).
137
- 2. Plans the documents against your budget. Each one goes in whole, or becomes a card plus tools.
138
- 3. Adds each document's text or card at the start of the first user message, where it stays for
139
- the whole conversation (so follow-up questions reuse Gemini's prompt cache), and a short tool
140
- guide to the system prompt.
141
- 4. Runs the tool loop if needed (up to `maxToolTurns` requests, default 12). If the model keeps
142
- searching, the last request is sent without tools so it has to answer. `result.answered` is
143
- `false` in the rare case that there is still no answer (a blocked prompt, or an empty reply).
202
+ ### 1. Create the library once
144
203
 
145
- **Vertex AI:**
204
+ Create the library and the endpoint when the server starts, and share them between requests.
146
205
 
147
206
  ```ts
207
+ // large-files.ts: created once, when the server starts, and shared by every request.
148
208
  import { GoogleAuth } from "google-auth-library";
209
+ import { createLargeFiles, FileDocumentStore } from "llm-large-files";
149
210
  import { vertexAi } from "llm-large-files/gemini";
150
211
 
212
+ export const files = createLargeFiles({
213
+ // Text extracted from uploads is kept here. Several servers need one shared store.
214
+ store: new FileDocumentStore(process.env.LARGE_FILES_DIR ?? "./data/large-files"),
215
+ // The context window of the model that answers (1,000,000 is the default). The rest follows it.
216
+ budget: { contextTokens: 1_000_000 },
217
+ });
218
+
151
219
  const auth = new GoogleAuth({ scopes: "https://www.googleapis.com/auth/cloud-platform" });
152
- const endpoint = vertexAi({
153
- project: "my-project",
154
- location: "global", // or "us", "eu", "europe-west4", …
220
+ export const endpoint = vertexAi({
221
+ project: process.env.GOOGLE_CLOUD_PROJECT!,
155
222
  model: "gemini-3.8-flash",
156
223
  accessToken: async () => (await auth.getAccessToken())!,
157
224
  });
158
- ```
159
-
160
- **An enterprise gateway** that proxies Generate Content:
161
225
 
162
- ```ts
163
- const endpoint = {
164
- url: "https://llm-gateway.corp.example/gemini/models/gemini-3.8-flash:generateContent",
165
- streamUrl: "https://llm-gateway.corp.example/gemini/models/gemini-3.8-flash:streamGenerateContent?alt=sse", // optional
166
- headers: { Authorization: `Bearer ${process.env.GATEWAY_TOKEN}`, "Content-Type": "application/json" },
167
- };
226
+ // An expired document is ignored at once. This frees the space it took.
227
+ setInterval(() => {
228
+ files.sweep().catch((error) => console.error("sweep failed", error));
229
+ }, 60 * 60 * 1000).unref();
168
230
  ```
169
231
 
170
- Without `streamUrl`, answers arrive in one piece (and `onText` fires once).
232
+ Documents are kept for 72 hours (`ttlMs`), and uploads are taken up to 100 MB
233
+ (`maxUploadBytes`). To let the model look at the pages of a PDF, add `keepOriginals: ["pdf"]`
234
+ ([PDFs](./guides/pdfs.md)). Every option is in the
235
+ [library reference](./reference/library.md#largefilesoptions).
171
236
 
172
- **Existing Gemini history.** If your chat already stores Gemini `contents` (with images or inline
173
- PDFs), pass `contents` instead of `messages`; document text is added at the start of the first user turn.
237
+ Where the documents live is up to your app: a shared volume for `FileDocumentStore`, or a store of
238
+ your own over your database or object storage, laid out per user and per chat session. See
239
+ [Storage](./guides/storage.md), and [Deployment](./guides/deployment.md) for several servers.
240
+ Vertex AI settings for production (credentials, location, quotas) are in
241
+ [Gemini and Vertex AI](./guides/vertex-and-gemini.md).
174
242
 
175
- **A second model for the searching (optional).** The model you name does both halves of the work:
176
- it searches and reads a large file, and it answers. `explorerModel` gives the first half to another
177
- model, for example a cheaper one, and `model` then only writes the answer:
243
+ ### 2. Accept uploads
244
+
245
+ `createDocumentHandlers` gives you upload, get and delete handlers for any Node HTTP server:
246
+ `node:http`, Express, Fastify (`request.raw`, `reply.raw`), and Next.js API routes on the Node
247
+ runtime (Fastify and Next.js need a step first: see
248
+ [Web app](./guides/web-app.md#mount-them-in-plain-nodehttp)).
178
249
 
179
250
  ```ts
180
- const endpoint = geminiApi({
181
- apiKey: process.env.GEMINI_API_KEY!,
182
- model: "gemini-3.8-flash",
183
- explorerModel: process.env.GEMINI_EXPLORER_MODEL, // unset or empty: one model does both
251
+ import express from "express";
252
+ import { createDocumentHandlers } from "llm-large-files/node";
253
+ import { files } from "./large-files.js";
254
+
255
+ const app = express();
256
+ const documents = createDocumentHandlers(files, {
257
+ // Uploads become private to this user. undefined: anonymous. currentUserId is your auth.
258
+ getOwner: (request) => currentUserId(request),
184
259
  });
260
+
261
+ // Before any body parser: the body of an upload is the raw file.
262
+ app.post("/api/documents", documents.upload);
263
+ app.get("/api/documents/:id", (req, res) => documents.get(req, res, req.params.id));
264
+ app.delete("/api/documents/:id", (req, res) => documents.remove(req, res, req.params.id));
265
+ app.use(express.json());
185
266
  ```
186
267
 
187
- `vertexAi()` takes it the same way, and an endpoint of your own takes the explorer's URL as
188
- `explorerUrl`. What each model gets, and what it costs, is in
189
- [An explorer model](configuration.md#an-explorer-model).
268
+ The browser posts the raw file, with its name in an `X-File-Name` header (URI-encoded). The
269
+ response is a `201` with a `DocumentSummary`: `id`, `name`, `format`, `lines`, `estimatedTokens`,
270
+ `expiresAt` and more. A text file that was not valid UTF-8 also has `encoding`, the older encoding
271
+ it was read in (`"windows-1255"`), or `replacedCharacters`, the characters stored as �, or both.
272
+ Keep the `id` with the chat session. Not on a Node HTTP server, or taking multipart forms? Call
273
+ `files.ingest({ name, mimeType, bytes, owner })` yourself and return `toDocumentSummary(meta)`.
190
274
 
191
- ### Pictures, charts and scans in PDFs
275
+ `getOwner` returns the signed-in user's ID, or `undefined` for an anonymous upload. An empty
276
+ string, a string of spaces or `null` would be one owner shared by every caller without a user, so
277
+ the upload is refused: `500` with `{ "error": "Upload failed (empty owner)." }`. Return the ID
278
+ itself, not the user object (`{ "error": "Upload failed (owner is not a string)." }`). Both come
279
+ before the body is read.
192
280
 
193
- The text of a PDF does not hold its pictures. To let the model look at a page when the text is not
194
- enough, install `@cantoo/pdf-lib` and keep the uploaded PDFs:
281
+ The browser side, every status and other servers are in [Web app](./guides/web-app.md); the
282
+ routes in full are in the [node reference](./reference/node.md).
283
+
284
+ ### 3. Ask with the user's history, and stream the answer
285
+
286
+ Send the whole conversation on every turn, with all the documents of the session. The plan is made
287
+ again for each question, because the history grows.
195
288
 
196
289
  ```ts
197
- export const files = createLargeFiles({
198
- store: new FileDocumentStore("./data/large-files"),
199
- keepOriginals: ["pdf"],
200
- });
290
+ // chat.ts
291
+ import type { ChatTurn, ToolTurn } from "llm-large-files";
292
+ import { askGemini } from "llm-large-files/gemini";
293
+ import { endpoint, files } from "./large-files.js";
294
+
295
+ // A chat session as your app stores it: who owns it, its documents, and its turns.
296
+ export type Session = { userId: string; documentIds: string[]; turns: StoredTurn[] };
297
+ export type StoredTurn = { question: string; toolTurns: ToolTurn[]; answer: string };
298
+
299
+ export async function ask(session: Session, question: string, send: (event: string, data: unknown) => void, signal: AbortSignal) {
300
+ // The whole history, on every turn, with the tool rounds of each earlier question in its place.
301
+ const messages: Array<ChatTurn | ToolTurn> = session.turns.flatMap((turn): Array<ChatTurn | ToolTurn> => [
302
+ { role: "user", text: turn.question },
303
+ ...turn.toolTurns,
304
+ { role: "assistant", text: turn.answer },
305
+ ]);
306
+ messages.push({ role: "user", text: question });
307
+
308
+ const result = await askGemini({
309
+ files,
310
+ endpoint,
311
+ messages,
312
+ documentIds: session.documentIds, // every document of the session, on every turn
313
+ owner: session.userId,
314
+ signal,
315
+ onText: (delta) => send("text", delta), // the answer, as it streams
316
+ onActivity: (text) => send("activity", text), // short-lived: "Search app.log (keywords) for “timeout”…"
317
+ onStep: (text) => send("step", text), // done: "Search app.log (exact) for “timeout” — 12 matching lines"
318
+ });
319
+
320
+ if (!result.answered) {
321
+ send("error", "No answer came back. Please ask again.");
322
+ return;
323
+ }
324
+ // Keep what the question read with its answer: the next question starts from it.
325
+ session.turns.push({ question, toolTurns: result.toolTurns, answer: result.text });
326
+ send("done", {});
327
+ }
201
328
  ```
202
329
 
203
- `askGemini` needs no change. It offers the model a tool, `view_pages`, and sends the pages it asks
204
- for (up to five a call) as a small PDF. A look shows up among the steps:
330
+ - The last message must be the user's question. `"model"` is accepted for `"assistant"`.
331
+ - `owner` must be the owner the documents were uploaded with. A document of another owner is
332
+ treated as missing.
333
+ - `send` stands for your transport: in a web app, a Server-Sent Event. The answer streams when
334
+ `onText` is set and the endpoint has a stream URL, as `vertexAi()` and `geminiApi()` do.
335
+ - Show the steps and activity lines as plain text, never as markdown or HTML: they quote what the
336
+ model sent, which a file can steer ([Security](./security.md#what-the-library-logs)).
337
+ - Abort `signal` when the client goes away, so the question stops.
338
+ - `answered` is `false` when the model's last turn had no text: a blocked prompt, a reply cut off,
339
+ or a tool call that could not be read. An answer that comes back empty, or with a tool call in
340
+ place of the text, is asked for once more first. Show your own message then.
205
341
 
206
- ```
207
- ✓ Look at report.pdf pages 12-14
208
- ```
342
+ The route, the browser side and cancelling are in [Web app](./guides/web-app.md). To have a
343
+ second, cheaper model search the files while this one writes the answer, add `explorerModel` to
344
+ `vertexAi()`: see [An explorer model](./guides/explorer-model.md).
345
+
346
+ ### 4. Keep `toolTurns` with the answer
347
+
348
+ `result.toolTurns` holds the tool calls of the question and what they returned, as plain JSON.
349
+ Store it with the answer, and put it back between the question and the answer, as `ask()` does
350
+ above. The model then sees what it found before, and a follow-up question often needs no new
351
+ search. A call whose result is still in the conversation in full is not run again: the model gets
352
+ a pointer to it, and the step ends with `— already shown above`.
209
353
 
210
- With originals kept, a scanned PDF of up to 30 pages is accepted too, and read page by page.
211
- Kept files take disk space until they expire, which is why this is off by default. The limits, the
212
- costs and the measurements are in [Pictures in PDFs](configuration.md#pictures-in-pdfs), and what
213
- to think about before turning it on in [Security](security.md#original-files).
354
+ Storing history across servers, keeping it inside the window, and converting history that is in a
355
+ provider's own form are in [Conversations](./guides/conversations.md).
214
356
 
215
- ### With another model: build your own loop
357
+ ### 5. Handle errors
216
358
 
217
- `files.prepare()` and `files.tools()` are provider-neutral. Tool declarations are plain JSON Schema,
218
- which OpenAI (`{ type: "function", function: declaration }`) and Anthropic
219
- (`{ name, description, input_schema: parameters }`) also accept.
359
+ Before a question fails, the loop sends a failed request again when a wait can mend it, recovers
360
+ from a request too large, and asks once more after an empty or unreadable turn
361
+ ([Errors and reliability](./guides/errors-and-reliability.md)). What still fails is thrown:
220
362
 
221
363
  ```ts
222
- const prepared = await files.prepare(documentIds, { tokens: historyTokens, bytes: historyBytes }, { owner });
223
- // 1. Add prepared.blocks.get(id) for each document to the user's message.
224
- // 2. Add prepared.instruction to the system prompt.
225
- // 3. If prepared.plan.searchable is not empty, give the model tools:
226
- const tools = files.tools(prepared.plan.searchable, { generate: myTextCompletion /* optional: enables analyze-all */ });
227
- // tools.declarations → your SDK's tool format
228
- // for each tool call: const result = await tools.execute(call.name, call.args)
229
- // return result to the model; repeat until it answers.
364
+ import { DocumentsNotFoundError, DocumentStoreError, errorKindOf, partialResultOf } from "llm-large-files";
365
+ import { ask } from "./chat.js";
366
+
367
+ // session, question, send and signal: as in step 3.
368
+ try {
369
+ await ask(session, question, send, signal);
370
+ } catch (error) {
371
+ if (!signal.aborted) send("error", messageFor(error)); // after an abort, no one is listening
372
+ // What a failed question had found and used, or undefined.
373
+ const partial = partialResultOf(error);
374
+ if (partial) console.warn(`The failed question used ${partial.usage.inputTokens} input tokens`);
375
+ }
376
+
377
+ function messageFor(error: unknown): string {
378
+ if (error instanceof DocumentsNotFoundError) return "A file is no longer available. Please attach it again.";
379
+ if (error instanceof DocumentStoreError) return "Your files could not be read just now. Please try again.";
380
+ switch (errorKindOf(error)) {
381
+ case "quota":
382
+ return "The assistant is not available right now. Please tell support.";
383
+ case "rate_limit":
384
+ return "The assistant is busy. Please try again in a minute.";
385
+ case "auth":
386
+ case "invalid":
387
+ return "The assistant is not set up correctly. Please tell support.";
388
+ case "context_overflow":
389
+ return "This conversation is too long for the model. Please start a new chat.";
390
+ case undefined:
391
+ return "Something went wrong. Please try again.";
392
+ default:
393
+ return "The model did not answer. Please try again.";
394
+ }
395
+ }
230
396
  ```
231
397
 
232
- `generate` is any `({ system, prompt, maxOutputTokens, signal }) => Promise<string>`. It's used
233
- only to read whole files in parts.
398
+ - `DocumentsNotFoundError` (`.ids`): a document expired, was deleted, was never uploaded, or
399
+ belongs to another owner. It is thrown before any model request.
400
+ - `DocumentStoreError`: the store could not be read just now. It does not mean the documents are
401
+ gone: the same request may work a moment later.
402
+ - `ModelRequestError`: the model failed. `.kind` says how (`quota`, `rate_limit`, `timeout`,
403
+ `unreachable`, `server`, `auth`, `invalid`, `context_overflow`), and `.status` is the HTTP
404
+ status, or 0 when no answer came. `errorKindOf(error)` reads the kind of any error that has one.
405
+ - `partialResultOf(error)` gives the steps, `toolTurns` and `usage` of a question that failed
406
+ under way, so you can still keep and count them.
234
407
 
235
- To offer `view_pages` in your own loop, it has to send a file to the model with a tool result. See
236
- [Your own loop](configuration.md#your-own-loop).
408
+ What to tell the user for each case, and how to change the retries and the waits, are in
409
+ [Errors and reliability](./guides/errors-and-reliability.md).
237
410
 
238
- ## Keeping the conversation working
411
+ ### 6. Set limits
239
412
 
240
- - Send the **full history** each turn when files are attached. The plan is recomputed each time,
241
- because the history grows. Stateful APIs that keep history server-side (such as Gemini
242
- Interactions with `previous_interaction_id`) don't mix with per-turn planning.
243
- - Keep the document IDs with the conversation, not with one message. Pass all of them on every turn.
244
- - Expired documents raise `DocumentsNotFoundError` (with `.ids`). Ask the user to attach them again.
245
- A store that could not be read raises `DocumentStoreError` instead: the documents are still
246
- there, so retry the request. With `ttlMs: Infinity` documents do not expire at all.
413
+ A question costs what its requests take in. These options bound it:
414
+
415
+ ```ts
416
+ import { askGemini } from "llm-large-files/gemini";
417
+
418
+ // files, endpoint, messages and session: as in step 3.
419
+ const result = await askGemini({
420
+ files,
421
+ endpoint,
422
+ messages,
423
+ documentIds: session.documentIds,
424
+ owner: session.userId,
425
+ limits: {
426
+ toolTurns: 8, // chat requests for one question, the answer included; part reads not counted (default 12)
427
+ inputTokens: 400_000, // input tokens for one question, over all its requests (default: none)
428
+ },
429
+ });
430
+ console.log(result.usage.inputTokens, result.usage.outputTokens, result.usage.requests);
431
+ ```
432
+
433
+ - `budget.contextTokens` in `createLargeFiles` is the window the plan fits the request into. With
434
+ `askWithFiles`, an adapter's `contextTokens` applies too, and the smaller wins.
435
+ - `limits` also takes `callsPerTurn` (default 8), `wholeDocumentReads` (default 1 per document)
436
+ and `requests` (default: none). See [`AskLimits`](./reference/ask.md#asklimits). An answer that
437
+ comes back without text is asked for once more, which can be one request past `toolTurns`; it is
438
+ not made once `requests` or `inputTokens` is reached.
439
+ - `result.usage` is what the question used, in all and for each model: input, cached input, output
440
+ and thought tokens, and requests. Store it per user or per session to count costs.
441
+
442
+ What costs most, and how to set the budget for each model, are in
443
+ [Costs and limits](./guides/costs-and-limits.md).
247
444
 
248
445
  ## Run the demo
249
446
 
447
+ The repository has two examples that run as they are, with a Gemini API key:
448
+
250
449
  ```bash
251
- git clone https://github.com/renanbazinin/llm-large-files && cd llm-large-files
252
- npm install && npm run build
253
- GEMINI_API_KEY=... node examples/server.ts # http://localhost:3000
254
- GEMINI_API_KEY=... node examples/ask-cli.ts big.log "What failed first?"
450
+ git clone https://github.com/renanbazinin/llm-large-files
451
+ cd llm-large-files
452
+ npm install
453
+ npm run build
454
+ GEMINI_API_KEY=... node examples/server.ts # then open http://localhost:3000
455
+ GEMINI_API_KEY=... node examples/ask-cli.ts ./big.log "What failed first, and when?"
255
456
  ```
256
457
 
257
- The examples need Node 22.18+ or 24 to run TypeScript directly.
458
+ - `examples/server.ts` is a chat server in one file, on `node:http`: an upload route
459
+ (`createDocumentHandlers`), answers streamed as Server-Sent Events, and a small web page. It
460
+ stores uploads in `.data/large-files` and keeps PDFs, so the model can look at their pages.
461
+ `GEMINI_MODEL` picks the model (default `gemini-3.8-flash`), and `GEMINI_EXPLORER_MODEL` adds an
462
+ explorer model. Every upload is anonymous.
463
+ - `examples/ask-cli.ts` asks one question about one file from the command line. Two more
464
+ arguments are optional: the model, and an explorer model.
465
+
466
+ Both need a Node that runs TypeScript directly: 22.18 and later in Node 22, or 23.6 and later.
467
+ Build first: the examples import
468
+ the package by name, which resolves to the repository's own `dist/`. `npm install` in the
469
+ repository also installs the optional packages, so every format works. In PowerShell, set the key
470
+ with `$env:GEMINI_API_KEY = "..."` and then run `node examples/server.ts`.
471
+
472
+ ## Next steps
473
+
474
+ - [Gemini and Vertex AI](./guides/vertex-and-gemini.md): endpoints, access tokens, thinking,
475
+ gateways, Vertex quotas and errors.
476
+ - [OpenAI-compatible endpoints](./guides/openai-compatible.md) and [Claude](./guides/anthropic.md):
477
+ the other adapters.
478
+ - [An explorer model](./guides/explorer-model.md): a cheaper model that searches while another
479
+ answers.
480
+ - [Web app](./guides/web-app.md): uploads, streaming over SSE, cancelling.
481
+ - [Conversations](./guides/conversations.md): history, `toolTurns`, converters.
482
+ - [Storage](./guides/storage.md): your own store, per user and per session.
483
+ - [Deployment](./guides/deployment.md): several servers, memory, proxies and timeouts.
484
+ - [Errors and reliability](./guides/errors-and-reliability.md) and
485
+ [Costs and limits](./guides/costs-and-limits.md).
486
+ - [PDFs](./guides/pdfs.md): tables, pictures, scans and page views.
487
+ - [Your own adapter and loop](./guides/own-adapter-and-loop.md) and
488
+ [Testing](./guides/testing.md).
489
+ - [How it works](./how-it-works.md), [Security](./security.md) and
490
+ [Troubleshooting](./troubleshooting.md).
491
+ - [The documentation index](./README.md), with the reference for every export, and the
492
+ [changelog](../CHANGELOG.md).