@wirecat/drive-cli 0.69.0 → 0.70.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.
- package/contracts/wirecat.json +14 -13
- package/dist/age.d.ts +0 -36
- package/dist/age.d.ts.map +1 -1
- package/dist/age.js +0 -22
- package/dist/age.js.map +1 -1
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/{all-profiles-B4A737YW.js → all-profiles-FW3GK3QO.js} +13 -13
- package/dist/bundle/{anthropic-RZGPDESM.js → anthropic-QVKJT3II.js} +8 -8
- package/dist/bundle/{app-server-OWEW7DY5.js → app-server-QU73RD5R.js} +66 -58
- package/dist/bundle/{bun-V5QLYBZU.js → bun-5XCD5CBB.js} +2 -2
- package/dist/bundle/{bun-sqlite-KHLHXXGH.js → bun-sqlite-TIGSVNSV.js} +9 -9
- package/dist/bundle/{chunk-GK6KXBL6.js → chunk-2SBC4DVV.js} +4 -4
- package/dist/bundle/{chunk-E7URRFBB.js → chunk-3AHBZP33.js} +10 -15
- package/dist/bundle/{chunk-V4FMN5A6.js → chunk-3CHW7JGR.js} +17 -17
- package/dist/bundle/chunk-3TCMANIM.js +387 -0
- package/dist/bundle/{chunk-6EL5AVXX.js → chunk-3UWRAIWA.js} +4 -4
- package/dist/bundle/{chunk-2DS2TDGW.js → chunk-3UZ4OH22.js} +18 -18
- package/dist/bundle/{chunk-WQOGHND4.js → chunk-4WK26MPY.js} +1 -1
- package/dist/bundle/{chunk-AD7VI3XU.js → chunk-54BQWRJL.js} +7 -7
- package/dist/bundle/{chunk-EA2OB75T.js → chunk-54NDYVZA.js} +1 -1
- package/dist/bundle/{chunk-4YECZ6CN.js → chunk-5JTB4URG.js} +12 -12
- package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-66PL7P4C.js} +1 -1
- package/dist/bundle/{chunk-BVVXYZSU.js → chunk-6BMTW5A6.js} +9 -9
- package/dist/bundle/{chunk-6D44YQ5X.js → chunk-6DPOWBKA.js} +6 -6
- package/dist/bundle/{chunk-AMQGKMLZ.js → chunk-7C5KENNU.js} +3 -3
- package/dist/bundle/chunk-7DJNURKV.js +823 -0
- package/dist/bundle/{chunk-5TK2YQCO.js → chunk-7IBENBCK.js} +2 -2
- package/dist/bundle/chunk-7QSRODXM.js +259 -0
- package/dist/bundle/{chunk-HCZYJMBP.js → chunk-ABZ2NYDT.js} +1 -1
- package/dist/bundle/{chunk-RLGQMMYE.js → chunk-AV5UKJZM.js} +35 -13
- package/dist/bundle/{chunk-533XOW74.js → chunk-BBFXQPKD.js} +3 -3
- package/dist/bundle/{chunk-ZUG67442.js → chunk-BBRMDMIR.js} +3 -3
- package/dist/bundle/{chunk-LRCSDAYK.js → chunk-BD2K2ONK.js} +4 -4
- package/dist/bundle/{chunk-CAQ5GW3A.js → chunk-BFKFKDPC.js} +1 -1
- package/dist/bundle/{chunk-OOIAJRKQ.js → chunk-BXPC5TFG.js} +2 -2
- package/dist/bundle/chunk-DHX27E5M.js +31 -0
- package/dist/bundle/{chunk-L342KHIZ.js → chunk-DR57KDAY.js} +6 -6
- package/dist/bundle/{chunk-XUHQ7DVT.js → chunk-DVI72ZQG.js} +1 -1
- package/dist/bundle/{chunk-N4ACIIQB.js → chunk-DVVUJ254.js} +2 -2
- package/dist/bundle/{chunk-MHXZ62CU.js → chunk-EDO5LZVF.js} +1 -1
- package/dist/bundle/{chunk-LUZRVBQR.js → chunk-EG62WVR2.js} +6 -6
- package/dist/bundle/{chunk-WNMPIRRF.js → chunk-F5KJWRF5.js} +3 -3
- package/dist/bundle/{chunk-U3RXH6RY.js → chunk-FADAOLGB.js} +4 -4
- package/dist/bundle/{chunk-4ZFO2CVH.js → chunk-FCSHWUMW.js} +5 -5
- package/dist/bundle/{chunk-GHFBT2ZM.js → chunk-FN3RXBO7.js} +6 -6
- package/dist/bundle/{chunk-GTDCP5OG.js → chunk-FONIFRYI.js} +4 -4
- package/dist/bundle/{chunk-IQ2QU2X6.js → chunk-FVTKFIQH.js} +981 -589
- package/dist/bundle/{chunk-F5UUJU6R.js → chunk-FYPW7NMH.js} +4 -4
- package/dist/bundle/{chunk-FIVFP53N.js → chunk-GA3URWIF.js} +1 -1
- package/dist/bundle/{chunk-HEBZCKMU.js → chunk-GAHIHE4K.js} +1778 -2232
- package/dist/bundle/{chunk-4J5GJJ2I.js → chunk-GJZSVSV3.js} +2 -2
- package/dist/bundle/{chunk-VUPWDCYV.js → chunk-GK3BJMGK.js} +1 -1
- package/dist/bundle/{chunk-6XNTELM5.js → chunk-GPDPEHYX.js} +1 -1
- package/dist/bundle/{chunk-CU6RATZH.js → chunk-GV5DGHSA.js} +4 -4
- package/dist/bundle/{chunk-JRFKCYMW.js → chunk-HHAZ6DCY.js} +23 -6
- package/dist/bundle/{chunk-OUM4ZO53.js → chunk-HK225DAG.js} +1 -1
- package/dist/bundle/{chunk-5SJZDEIO.js → chunk-HRATXUFH.js} +20 -20
- package/dist/bundle/{chunk-TZ75K6R7.js → chunk-HWUPU6WX.js} +8 -8
- package/dist/bundle/{chunk-3RLRJHAI.js → chunk-HYXXMSVD.js} +7688 -8301
- package/dist/bundle/{chunk-EL2E3ABX.js → chunk-I7YSHUPW.js} +13 -13
- package/dist/bundle/{chunk-EWUQIUTB.js → chunk-IFTX7AQU.js} +5 -5
- package/dist/bundle/{chunk-BBJVV4E2.js → chunk-IGNIUDI3.js} +61 -38
- package/dist/bundle/{chunk-7JKECODO.js → chunk-ILAQIBEO.js} +1 -11
- package/dist/bundle/{chunk-SY2HLH5R.js → chunk-KSJAFMU5.js} +57 -23
- package/dist/bundle/{chunk-PB6NWKH3.js → chunk-LINBDWJK.js} +2 -2
- package/dist/bundle/{chunk-CZ4UEXCE.js → chunk-LMJBQFW6.js} +6 -6
- package/dist/bundle/{chunk-IJCUAKR5.js → chunk-ML3R2UHV.js} +4 -4
- package/dist/bundle/{chunk-2Q4CB4EI.js → chunk-MXNQZAJQ.js} +2 -2
- package/dist/bundle/{chunk-WOUIHZRI.js → chunk-NP7LJATI.js} +15 -67
- package/dist/bundle/chunk-OY7TNUEC.js +16 -0
- package/dist/bundle/{chunk-2VFAXC6O.js → chunk-P77FL6RY.js} +18 -18
- package/dist/bundle/{chunk-I55XYREN.js → chunk-P7PLKNPX.js} +993 -2512
- package/dist/bundle/{chunk-3URYKAJP.js → chunk-PAPY6Q6H.js} +1 -1
- package/dist/bundle/{chunk-5B5NOAIA.js → chunk-PN4JYURZ.js} +45 -45
- package/dist/bundle/{chunk-ZBYKCVSV.js → chunk-PR7XD2DI.js} +2 -2
- package/dist/bundle/{chunk-UPCEHSIZ.js → chunk-Q5C6YKAY.js} +21 -16
- package/dist/bundle/{chunk-SEJBS7SI.js → chunk-QBAOIMVB.js} +1 -1
- package/dist/bundle/{chunk-KUQDBWPU.js → chunk-RCTOWLCD.js} +31 -32
- package/dist/bundle/{chunk-22SH77TG.js → chunk-REM5WHHQ.js} +64 -64
- package/dist/bundle/{chunk-Y2QVNVHK.js → chunk-RHSBXOQM.js} +1 -1
- package/dist/bundle/{chunk-3YKAFLXY.js → chunk-RLNZ7NX5.js} +2 -2
- package/dist/bundle/chunk-RQNRYF6D.js +170 -0
- package/dist/bundle/{chunk-PV3AWPHR.js → chunk-SONPLYV7.js} +5 -5
- package/dist/bundle/{chunk-RWQ7T4Y5.js → chunk-T5D4OGDC.js} +2 -2
- package/dist/bundle/{chunk-25FT44S3.js → chunk-TGS5VPJD.js} +282 -525
- package/dist/bundle/chunk-TNKQDS5A.js +335 -0
- package/dist/bundle/{chunk-NVDR72GP.js → chunk-VVN6GHAZ.js} +60 -81
- package/dist/bundle/{chunk-CDSB7WVG.js → chunk-WJK6KTCS.js} +8 -8
- package/dist/bundle/{chunk-T6X6EZ5N.js → chunk-WWE5GO6G.js} +3 -3
- package/dist/bundle/{chunk-SYUXKV2E.js → chunk-XOL346TJ.js} +2 -2
- package/dist/bundle/{chunk-T4FMXDDV.js → chunk-XZBA6FVH.js} +3 -3
- package/dist/bundle/chunk-YCL3SK4T.js +1978 -0
- package/dist/bundle/{chunk-XVH3WZSZ.js → chunk-YRUR3E3E.js} +53 -53
- package/dist/bundle/{chunk-QJGFQRTL.js → chunk-YZPE72GE.js} +12 -12
- package/dist/bundle/{chunk-O6PD7RZY.js → chunk-ZCXWV4XO.js} +4 -4
- package/dist/bundle/{chunk-376ZGVUZ.js → chunk-ZHZYGY5R.js} +4 -4
- package/dist/bundle/{cli-BS4L3HAP.js → cli-K4D4DIGQ.js} +88 -69
- package/dist/bundle/command-contract-V3F452QI.js +43 -0
- package/dist/bundle/{command-server-entry-CJ2CV7ZV.js → command-server-entry-WREK3QBB.js} +33 -30
- package/dist/bundle/decode-SEETPKBH.js +299 -0
- package/dist/bundle/{dispatch-WBEOHZDV.js → dispatch-SQCEURVK.js} +9 -9
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-QIXLXS3G.js → echarts-WZ5RKFCX.js} +2 -2
- package/dist/bundle/{embed-YNZW5X6M.js → embed-B2UCRZZR.js} +9 -9
- package/dist/bundle/{embedder-LRC2PKTS.js → embedder-4R6Z7G7L.js} +12 -12
- package/dist/bundle/entry-ORZYRJ5N.js +25 -0
- package/dist/bundle/{failure-X6PSLVSO.js → failure-CYNXH3RQ.js} +4 -4
- package/dist/bundle/first-run-KAKA6KBY.js +31 -0
- package/dist/bundle/first-screen-R645UHRH.js +41 -0
- package/dist/bundle/google-BSO3YB7N.js +45 -0
- package/dist/bundle/{google-api-7JDZDCWE.js → google-api-SAND2F7L.js} +70 -62
- package/dist/bundle/grants-PLNFYARD.js +118 -0
- package/dist/bundle/{identity-E43WKN5F.js → identity-JVVGS4U6.js} +6 -6
- package/dist/bundle/{instructions-MD2RZT5Z.js → instructions-JSMTSB22.js} +1 -1
- package/dist/bundle/{login-RBDJPQAG.js → login-6WG3YBDU.js} +78 -70
- package/dist/bundle/{mcp-TDKGDB4V.js → mcp-VFIOZDVY.js} +2 -2
- package/dist/bundle/meeting-combined-SUKMFK3F.js +27 -0
- package/dist/bundle/meeting-model-S4YGKIFI.js +29 -0
- package/dist/bundle/meeting-semantic-5U7JQCFF.js +25 -0
- package/dist/bundle/{node-IEVT2FSJ.js → node-VJMVHOWD.js} +2 -2
- package/dist/bundle/{node-sqlite-IENH4TRX.js → node-sqlite-DCNT3HVE.js} +10 -10
- package/dist/bundle/oauth-KCMNQ3ZP.js +22 -0
- package/dist/bundle/{open-TZ5H7NYM.js → open-NFOEHVW7.js} +8 -8
- package/dist/bundle/{openai-XF2KB7W2.js → openai-D47WY7EC.js} +32 -30
- package/dist/bundle/{process-6Q23D3TO.js → process-Q2FRU5VA.js} +1 -1
- package/dist/bundle/{program-D5XWOHV5.js → program-T2AJJQEM.js} +1332 -1331
- package/dist/bundle/{prompt-KUC5D4GX.js → prompt-YJSDABXN.js} +8 -8
- package/dist/bundle/{reasons-KSYP5VDJ.js → reasons-WEHPCSJX.js} +5 -5
- package/dist/bundle/{recognize-DPFW7HO3.js → recognize-6OBEIEB3.js} +7 -7
- package/dist/bundle/{remote-MODTSUNH.js → remote-3SL2QJ7T.js} +13 -13
- package/dist/bundle/{rerank-JK7SERLE.js → rerank-L6F5SLIB.js} +10 -10
- package/dist/bundle/{serve-BV2WHZLW.js → serve-GYSWIWH4.js} +12 -12
- package/dist/bundle/server-BI46BSRE.js +80 -0
- package/dist/bundle/{server-N3WPEU7Z.js → server-GWWP3RIT.js} +54 -46
- package/dist/bundle/{services-SV6CFUCS.js → services-BDQBRXT5.js} +79 -54
- package/dist/bundle/{sqlite-runtime-RZ5PLZVQ.js → sqlite-runtime-ZSZGAUYB.js} +9 -9
- package/dist/bundle/{start-C6EXYXAL.js → start-BJ275RUK.js} +7 -7
- package/dist/bundle/{state-RAZIREVG.js → state-HLNGFI2T.js} +9 -9
- package/dist/bundle/{store-2DLGLYS6.js → store-I43KZNJW.js} +31 -26
- package/dist/bundle/{store-DQKJKX2G.js → store-OSRTGYGI.js} +23 -19
- package/dist/bundle/store-maintenance-command-FO7LEVSL.js +72 -0
- package/dist/bundle/tokens-DB7O7QNB.js +118 -0
- package/dist/catalog.d.ts +0 -28
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +0 -82
- package/dist/catalog.js.map +1 -1
- package/dist/commands/catalog.d.ts +3 -8
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +36 -109
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +20 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +30 -72
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/folders.d.ts +1 -1
- package/dist/commands/folders.d.ts.map +1 -1
- package/dist/commands/folders.js +45 -48
- package/dist/commands/folders.js.map +1 -1
- package/dist/commands/knowledge.d.ts +4 -21
- package/dist/commands/knowledge.d.ts.map +1 -1
- package/dist/commands/knowledge.js +3 -241
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/mirrors.d.ts +2 -2
- package/dist/commands/mirrors.d.ts.map +1 -1
- package/dist/commands/mirrors.js +46 -202
- package/dist/commands/mirrors.js.map +1 -1
- package/dist/commands/search.d.ts +1 -3
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +20 -42
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +36 -53
- package/dist/commands/sync.js.map +1 -1
- package/dist/contract-overrides.d.ts +0 -2
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +0 -317
- package/dist/contract-overrides.js.map +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +4 -3
- package/dist/knowledge.js.map +1 -1
- package/dist/list-queries.d.ts +0 -31
- package/dist/list-queries.d.ts.map +1 -1
- package/dist/list-queries.js +0 -36
- package/dist/list-queries.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +2 -3
- package/dist/program.js.map +1 -1
- package/dist/provider-json.d.ts.map +1 -1
- package/dist/provider-json.js +5 -5
- package/dist/provider-json.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +0 -10
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-HYURWSD6.js +0 -40
- package/dist/bundle/decode-E2NM5SSM.js +0 -165
- package/dist/bundle/entry-2IMSWRJU.js +0 -25
- package/dist/bundle/first-run-7CPHQDM5.js +0 -30
- package/dist/bundle/first-screen-OKZ7GMFR.js +0 -38
- package/dist/bundle/google-WDKDBDD4.js +0 -45
- package/dist/bundle/grants-AU25GWKF.js +0 -110
- package/dist/bundle/oauth-3JGSN47Z.js +0 -22
- package/dist/bundle/server-6YDI4Y36.js +0 -72
- package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +0 -64
- package/dist/bundle/tokens-LY3WML55.js +0 -110
- package/dist/knowledge-query.d.ts +0 -77
- package/dist/knowledge-query.d.ts.map +0 -1
- package/dist/knowledge-query.js +0 -104
- package/dist/knowledge-query.js.map +0 -1
- package/dist/bundle/{chunk-XWBPP2HX.js → chunk-ZI3YTXSF.js} +0 -0
- package/dist/bundle/{mdast-util-from-markdown-CE73EWJ2.js → mdast-util-from-markdown-FXEPSNER.js} +3 -3
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
filesPresent,
|
|
5
|
+
sharedModelsDirectory
|
|
6
|
+
} from "./chunk-FONIFRYI.js";
|
|
7
|
+
import {
|
|
8
|
+
readSharedSection,
|
|
9
|
+
sharedConfigPath,
|
|
10
|
+
writeSharedSection
|
|
11
|
+
} from "./chunk-WJK6KTCS.js";
|
|
12
|
+
import {
|
|
13
|
+
storePath
|
|
14
|
+
} from "./chunk-T5D4OGDC.js";
|
|
15
|
+
import {
|
|
16
|
+
array,
|
|
17
|
+
check,
|
|
18
|
+
getDotPath,
|
|
19
|
+
integer,
|
|
20
|
+
maxLength,
|
|
21
|
+
maxValue,
|
|
22
|
+
minLength,
|
|
23
|
+
minValue,
|
|
24
|
+
number,
|
|
25
|
+
optional,
|
|
26
|
+
picklist,
|
|
27
|
+
pipe,
|
|
28
|
+
regex,
|
|
29
|
+
safeParse,
|
|
30
|
+
startsWith,
|
|
31
|
+
strictObject,
|
|
32
|
+
string,
|
|
33
|
+
trim,
|
|
34
|
+
url
|
|
35
|
+
} from "./chunk-HHAZ6DCY.js";
|
|
36
|
+
import {
|
|
37
|
+
CliError
|
|
38
|
+
} from "./chunk-54NDYVZA.js";
|
|
39
|
+
import {
|
|
40
|
+
__name
|
|
41
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
42
|
+
|
|
43
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/embeddings/models.js
|
|
44
|
+
import { existsSync } from "node:fs";
|
|
45
|
+
import { join } from "node:path";
|
|
46
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
47
|
+
var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
|
|
48
|
+
var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
|
|
49
|
+
var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
|
|
50
|
+
var TEXT_MODELS = [
|
|
51
|
+
{
|
|
52
|
+
id: "e5-small",
|
|
53
|
+
title: "multilingual-e5-small, 8-bit",
|
|
54
|
+
size: "small",
|
|
55
|
+
languages: "about 100 languages, Russian and English among them",
|
|
56
|
+
licence: "MIT",
|
|
57
|
+
dims: 384,
|
|
58
|
+
maxTokens: 512,
|
|
59
|
+
// 100k-message corpus, one 8-thread session on Ryzen AI 9 HX 470: 31–32 chunks/s.
|
|
60
|
+
chunksPerSecond: 31,
|
|
61
|
+
pooling: "mean",
|
|
62
|
+
prefix: { query: "query: ", passage: "passage: " },
|
|
63
|
+
onnx: "onnx/model_quantized.onnx",
|
|
64
|
+
files: [
|
|
65
|
+
{
|
|
66
|
+
name: "onnx/model_quantized.onnx",
|
|
67
|
+
url: e5("onnx/model_quantized.onnx"),
|
|
68
|
+
sha256: "f80102d3f2a1229f387d3c81909990d8945513e347b0eab049f7de3c6f98c193",
|
|
69
|
+
bytes: 118308185
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "tokenizer.json",
|
|
73
|
+
url: e5("tokenizer.json"),
|
|
74
|
+
sha256: "0b44a9d7b51c3c62626640cda0e2c2f70fdacdc25bbbd68038369d14ebdf4c39",
|
|
75
|
+
bytes: 17082730
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "tokenizer_config.json",
|
|
79
|
+
url: e5("tokenizer_config.json"),
|
|
80
|
+
sha256: "a1d6bc8734a6f635dc158508bef000f8e2e5a759c7d92f984b2c86e5ff53425b",
|
|
81
|
+
bytes: 443
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "embeddinggemma",
|
|
87
|
+
title: "EmbeddingGemma 300M, 4-bit",
|
|
88
|
+
size: "medium",
|
|
89
|
+
languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
|
|
90
|
+
licence: "Gemma Terms of Use",
|
|
91
|
+
terms: "https://ai.google.dev/gemma/terms",
|
|
92
|
+
// Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
|
|
93
|
+
notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
|
|
94
|
+
dims: 768,
|
|
95
|
+
maxTokens: 2048,
|
|
96
|
+
// 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
|
|
97
|
+
// 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
|
|
98
|
+
chunksPerSecond: 5,
|
|
99
|
+
pooling: "sentence_embedding",
|
|
100
|
+
prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
|
|
101
|
+
onnx: "onnx/model_q4.onnx",
|
|
102
|
+
externalData: "onnx/model_q4.onnx_data",
|
|
103
|
+
files: [
|
|
104
|
+
{
|
|
105
|
+
name: "onnx/model_q4.onnx",
|
|
106
|
+
url: gemma("onnx/model_q4.onnx"),
|
|
107
|
+
sha256: "ad1dfee81a70f7944b9b9d1cc6e48075b832881cf33fab2f2b248be78f3f0043",
|
|
108
|
+
bytes: 519322
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "onnx/model_q4.onnx_data",
|
|
112
|
+
url: gemma("onnx/model_q4.onnx_data"),
|
|
113
|
+
sha256: "599962c3143b040de2dd05e5975be3e9091dd067cacc6a8f7186e3203bab9e02",
|
|
114
|
+
bytes: 196725760
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "tokenizer.json",
|
|
118
|
+
url: gemma("tokenizer.json"),
|
|
119
|
+
sha256: "4dda02faaf32bc91031dc8c88457ac272b00c1016cc679757d1c441b248b9c47",
|
|
120
|
+
bytes: 20323312
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "tokenizer_config.json",
|
|
124
|
+
url: gemma("tokenizer_config.json"),
|
|
125
|
+
sha256: "3ca953eea6c3c9fcda9cf3df22949ff18b216f7c74bd6459230f3f1013953f3a",
|
|
126
|
+
bytes: 1156830
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "e5-large",
|
|
132
|
+
title: "multilingual-e5-large, 8-bit",
|
|
133
|
+
size: "large",
|
|
134
|
+
languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
|
|
135
|
+
licence: "MIT",
|
|
136
|
+
dims: 1024,
|
|
137
|
+
maxTokens: 512,
|
|
138
|
+
// 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
|
|
139
|
+
chunksPerSecond: 4,
|
|
140
|
+
pooling: "mean",
|
|
141
|
+
prefix: { query: "query: ", passage: "passage: " },
|
|
142
|
+
onnx: "onnx/model_quantized.onnx",
|
|
143
|
+
files: [
|
|
144
|
+
{
|
|
145
|
+
name: "onnx/model_quantized.onnx",
|
|
146
|
+
url: e5Large("onnx/model_quantized.onnx"),
|
|
147
|
+
sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
|
|
148
|
+
bytes: 561768762
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "tokenizer.json",
|
|
152
|
+
url: e5Large("tokenizer.json"),
|
|
153
|
+
sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
|
|
154
|
+
bytes: 17082660
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "tokenizer_config.json",
|
|
158
|
+
url: e5Large("tokenizer_config.json"),
|
|
159
|
+
sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
|
|
160
|
+
bytes: 418
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
];
|
|
165
|
+
var DEFAULT_TEXT_MODEL = "embeddinggemma";
|
|
166
|
+
var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
|
|
167
|
+
var SECTION = "text_models";
|
|
168
|
+
var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
|
|
169
|
+
var words = pipe(string(), trim(), minLength(1), maxLength(300));
|
|
170
|
+
var fileName = pipe(string(), check((name) => /^[\w.-]+(\/[\w.-]+)*$/.test(name) && !name.split("/").some((part) => part === ".." || part === "."), "is not a file inside the model's folder"));
|
|
171
|
+
var modelFile = strictObject({
|
|
172
|
+
name: fileName,
|
|
173
|
+
url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
|
|
174
|
+
sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
|
|
175
|
+
bytes: pipe(number(), integer(), minValue(1))
|
|
176
|
+
});
|
|
177
|
+
var CustomTextModelShape = pipe(strictObject({
|
|
178
|
+
id: slug,
|
|
179
|
+
title: words,
|
|
180
|
+
languages: words,
|
|
181
|
+
licence: words,
|
|
182
|
+
terms: optional(pipe(string(), url())),
|
|
183
|
+
dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
|
|
184
|
+
maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
|
|
185
|
+
chunksPerSecond: optional(pipe(number(), minValue(0.01))),
|
|
186
|
+
pooling: picklist(["mean", "sentence_embedding"]),
|
|
187
|
+
prefix: strictObject({
|
|
188
|
+
query: pipe(string(), maxLength(200)),
|
|
189
|
+
passage: pipe(string(), maxLength(200))
|
|
190
|
+
}),
|
|
191
|
+
onnx: fileName,
|
|
192
|
+
externalData: optional(fileName),
|
|
193
|
+
files: pipe(array(modelFile), minLength(1), maxLength(16))
|
|
194
|
+
}), check((model) => !TEXT_MODELS.some((one) => one.id === model.id), "takes the id of a model this version ships; choose another"), check((model) => {
|
|
195
|
+
const names = model.files.map(({ name }) => name);
|
|
196
|
+
return [model.onnx, model.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
|
|
197
|
+
}, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
|
|
198
|
+
var TextModelsSection = strictObject({
|
|
199
|
+
use: optional(slug),
|
|
200
|
+
custom: optional(array(CustomTextModelShape))
|
|
201
|
+
});
|
|
202
|
+
var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
|
|
203
|
+
var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
|
|
204
|
+
const path = textModelsFile(env);
|
|
205
|
+
const section = readSharedSection(path, SECTION);
|
|
206
|
+
if (section === void 0)
|
|
207
|
+
return {};
|
|
208
|
+
const checked = safeParse(TextModelsSection, section);
|
|
209
|
+
if (!checked.success) {
|
|
210
|
+
const issue = checked.issues[0];
|
|
211
|
+
const at = issue ? getDotPath(issue) : null;
|
|
212
|
+
throw new CliError("configuration_error", `${path}: ${SECTION}${at ? `.${at}` : ""} ${issue?.message ?? "is not valid"}`);
|
|
213
|
+
}
|
|
214
|
+
const ids = checked.output.custom?.map(({ id }) => id) ?? [];
|
|
215
|
+
const twice = ids.find((id, at) => ids.indexOf(id) !== at);
|
|
216
|
+
if (twice)
|
|
217
|
+
throw new CliError("configuration_error", `${path}: ${SECTION}.custom names ${twice} twice`);
|
|
218
|
+
return checked.output;
|
|
219
|
+
}, "readTextModelsSection");
|
|
220
|
+
var writeTextModelsSection = /* @__PURE__ */ __name((section, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section.use === void 0 && !section.custom?.length ? void 0 : section), "writeTextModelsSection");
|
|
221
|
+
var textModels = /* @__PURE__ */ __name((env = process.env) => [
|
|
222
|
+
...TEXT_MODELS,
|
|
223
|
+
...(readTextModelsSection(env).custom ?? []).map((model) => ({ ...model, custom: true }))
|
|
224
|
+
], "textModels");
|
|
225
|
+
var textModel = /* @__PURE__ */ __name((id, env = process.env) => {
|
|
226
|
+
const known = textModels(env);
|
|
227
|
+
const found = known.find((model) => model.id === id);
|
|
228
|
+
if (!found) {
|
|
229
|
+
throw new CliError("validation_error", `no text model ${id} \u2014 one of: ${known.map((model) => model.id).join(", ")}`);
|
|
230
|
+
}
|
|
231
|
+
return found;
|
|
232
|
+
}, "textModel");
|
|
233
|
+
var downloaded = /* @__PURE__ */ __name((id, env) => {
|
|
234
|
+
const model = TEXT_MODELS.find((one) => one.id === id);
|
|
235
|
+
const directory = sharedModelsDirectory("text", env);
|
|
236
|
+
return model !== void 0 && filesPresent(model.files.map((file) => [file, join(directory, model.id, file.name)]));
|
|
237
|
+
}, "downloaded");
|
|
238
|
+
var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
|
|
239
|
+
const use = readTextModelsSection(env).use;
|
|
240
|
+
if (use !== void 0)
|
|
241
|
+
return { id: use, from: "chosen" };
|
|
242
|
+
const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync(join(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
|
|
243
|
+
return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
|
|
244
|
+
}, "chosenTextModel");
|
|
245
|
+
var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
|
|
246
|
+
var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
|
|
247
|
+
var RERANK_MODELS = [
|
|
248
|
+
{
|
|
249
|
+
id: "mmarco",
|
|
250
|
+
title: "mMARCO mMiniLMv2-L12 cross-encoder, 8-bit",
|
|
251
|
+
languages: "about 100 languages, Russian and English among them",
|
|
252
|
+
licence: "Apache-2.0",
|
|
253
|
+
maxTokens: 512,
|
|
254
|
+
// The x86 name is the quantizer's target; WebAssembly and native ONNX Runtime both run it on any processor.
|
|
255
|
+
onnx: "onnx/model_quint8_avx2.onnx",
|
|
256
|
+
files: [
|
|
257
|
+
{
|
|
258
|
+
name: "onnx/model_quint8_avx2.onnx",
|
|
259
|
+
url: mmarco("onnx/model_quint8_avx2.onnx"),
|
|
260
|
+
sha256: "6c2513767fb63d008a4377bef7a7a3555433d9436342bb53e35a3a72ffc52d4b",
|
|
261
|
+
bytes: 118620016
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "tokenizer.json",
|
|
265
|
+
url: mmarco("tokenizer.json"),
|
|
266
|
+
sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
|
|
267
|
+
bytes: 17082660
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "tokenizer_config.json",
|
|
271
|
+
url: mmarco("tokenizer_config.json"),
|
|
272
|
+
sha256: "e7fbfbfa6347b4e414c1cee50d142e2c2f9a895dad68b068ae83a8b564c3837e",
|
|
273
|
+
bytes: 435
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "bge-reranker-v2-m3",
|
|
279
|
+
title: "BGE reranker v2 m3, 8-bit",
|
|
280
|
+
languages: "over 100 languages \u2014 better than mmarco in the benchmark, about seven times slower",
|
|
281
|
+
licence: "Apache-2.0 (BAAI's; the ONNX export declares none)",
|
|
282
|
+
maxTokens: 512,
|
|
283
|
+
onnx: "onnx/model_quantized.onnx",
|
|
284
|
+
files: [
|
|
285
|
+
{
|
|
286
|
+
name: "onnx/model_quantized.onnx",
|
|
287
|
+
url: bge("onnx/model_quantized.onnx"),
|
|
288
|
+
sha256: "912fc1215c2dbff6499700534bd8d31253af01573861abbfc43afd1fab6cce5d",
|
|
289
|
+
bytes: 570727094
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "tokenizer.json",
|
|
293
|
+
url: bge("tokenizer.json"),
|
|
294
|
+
sha256: "8bf8afbfd11306bd872018c53bfdf2e160a56f8edbcf49933324404791c148d3",
|
|
295
|
+
bytes: 17082900
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "tokenizer_config.json",
|
|
299
|
+
url: bge("tokenizer_config.json"),
|
|
300
|
+
sha256: "b87c8703482b0300d3da30e201519aa641f6a450f5eb5bf1e624afbf70c74d80",
|
|
301
|
+
bytes: 1203
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
];
|
|
306
|
+
var DEFAULT_RERANK_MODEL = "mmarco";
|
|
307
|
+
var rerankModel = /* @__PURE__ */ __name((id) => {
|
|
308
|
+
const found = RERANK_MODELS.find((model) => model.id === id);
|
|
309
|
+
if (!found) {
|
|
310
|
+
throw new CliError("validation_error", `no reranker ${id} \u2014 one of: ${RERANK_MODELS.map((model) => model.id).join(", ")}`);
|
|
311
|
+
}
|
|
312
|
+
return found;
|
|
313
|
+
}, "rerankModel");
|
|
314
|
+
var vectorModelKey = /* @__PURE__ */ __name((model) => {
|
|
315
|
+
const weights = model.custom ? model.files.find(({ name }) => name === model.onnx)?.sha256.slice(0, 12) : void 0;
|
|
316
|
+
return `local:${model.id}${weights ? `@${weights}` : ""}:${model.dims}`;
|
|
317
|
+
}, "vectorModelKey");
|
|
318
|
+
var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
|
|
319
|
+
|
|
320
|
+
export {
|
|
321
|
+
DEFAULT_TEXT_MODEL,
|
|
322
|
+
PREVIOUS_DEFAULT_TEXT_MODEL,
|
|
323
|
+
CustomTextModelShape,
|
|
324
|
+
textModelsFile,
|
|
325
|
+
readTextModelsSection,
|
|
326
|
+
writeTextModelsSection,
|
|
327
|
+
textModels,
|
|
328
|
+
textModel,
|
|
329
|
+
chosenTextModel,
|
|
330
|
+
RERANK_MODELS,
|
|
331
|
+
DEFAULT_RERANK_MODEL,
|
|
332
|
+
rerankModel,
|
|
333
|
+
vectorModelKey,
|
|
334
|
+
meaningFloor
|
|
335
|
+
};
|