diff --git a/Cargo.lock b/Cargo.lock index 179359d..24ba30d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -400,7 +400,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror 2.0.18", - "tokenizers", + "tokenizers 0.21.4", "toml 0.8.23", ] @@ -480,12 +480,6 @@ dependencies = [ "cpufeatures 0.3.0", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -630,16 +624,15 @@ dependencies = [ [[package]] name = "candle-core" -version = "0.9.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15b675b80d994b2eadb20a4bbe434eabeb454eac3ee5e2b4cf6f147ee9be091" +checksum = "d11c8be87cfbaef9ebb62fb3f850d1fc8e00cc1d11d393fdbe55a4d5c2cdb325" dependencies = [ "accelerate-src", "byteorder", "candle-metal-kernels", - "candle-ug", "float8", - "gemm 0.19.0", + "gemm", "half", "libc", "libm", @@ -648,21 +641,25 @@ dependencies = [ "num_cpus", "objc2-foundation", "objc2-metal", + "parking_lot", "rand", "rand_distr", "rayon", - "safetensors 0.7.0", + "safetensors", "thiserror 2.0.18", - "yoke 0.8.3", + "tokenizers 0.23.2", + "yoke", + "zerocopy", "zip", ] [[package]] name = "candle-metal-kernels" -version = "0.9.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fdfe9d06de16ce49961e49084e5b79a75a9bdf157246e7c7b6328e87a7aa25d" +checksum = "6e9fdf9f3fb13fb677fec22802f85515e4bdf9a2b8fa153efb5454eced755932" dependencies = [ + "block2", "half", "objc2", "objc2-foundation", @@ -674,9 +671,9 @@ dependencies = [ [[package]] name = "candle-nn" -version = "0.9.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3045fa9e7aef8567d209a27d56b692f60b96f4d0569f4c3011f8ca6715c65e03" +checksum = "437fabe77547c2447c7bdf3cc946e19db29a2832440176b419f77c80b0a9a05e" dependencies = [ "accelerate-src", "candle-core", @@ -686,22 +683,22 @@ dependencies = [ "num-traits", "objc2-metal", "rayon", - "safetensors 0.7.0", + "safetensors", "serde", "thiserror 2.0.18", ] [[package]] name = "candle-transformers" -version = "0.9.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b538ec4aa807c416a2ddd3621044888f188827862e2a6fcacba4738e89795d01" +checksum = "2b1e1abeac23d7df4f94e8a3852b3dbb661d332e37c3bef479507bac867187b2" dependencies = [ "accelerate-src", "byteorder", "candle-core", "candle-nn", - "fancy-regex", + "fancy-regex 0.19.2", "num-traits", "rand", "rayon", @@ -711,16 +708,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "candle-ug" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d62be69068bf58987a45f690612739d8d2ea1bf508c1b87dc6815a019575d" -dependencies = [ - "ug", - "ug-metal", -] - [[package]] name = "cargo-platform" version = "0.1.9" @@ -942,16 +929,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -975,23 +952,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" dependencies = [ "bitflags 2.13.0", - "core-foundation 0.10.1", - "core-graphics-types 0.2.0", + "core-foundation", + "core-graphics-types", "foreign-types", "libc", ] -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "libc", -] - [[package]] name = "core-graphics-types" version = "0.2.0" @@ -999,7 +965,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ "bitflags 2.13.0", - "core-foundation 0.10.1", + "core-foundation", "libc", ] @@ -1130,6 +1096,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "daachorse" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5614204febbc33cc07a2806aa6440b904ac012b68eecc37f4493ea4a76455a3d" + [[package]] name = "darling" version = "0.20.11" @@ -1611,6 +1583,17 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "fancy-regex" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301f5bf187b3c295fce6468d3875037a0bccc5f6b151c63cac2f85babf21912" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + [[package]] name = "fastrand" version = "2.4.1" @@ -1666,9 +1649,9 @@ dependencies = [ [[package]] name = "float8" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719a903cc23e4a89e87962c2a80fdb45cdaad0983a89bd150bb57b4c8571a7d5" +checksum = "c2d1f04709a8ac06e8e8042875a3c466cc4832d3c1a18dbcb9dba3c6e83046bc" dependencies = [ "half", "num-traits", @@ -1922,26 +1905,6 @@ dependencies = [ "x11", ] -[[package]] -name = "gemm" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab96b703d31950f1aeddded248bc95543c9efc7ac9c4a21fda8703a83ee35451" -dependencies = [ - "dyn-stack", - "gemm-c32 0.18.2", - "gemm-c64 0.18.2", - "gemm-common 0.18.2", - "gemm-f16 0.18.2", - "gemm-f32 0.18.2", - "gemm-f64 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - [[package]] name = "gemm" version = "0.19.0" @@ -1949,27 +1912,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa0673db364b12263d103b68337a68fbecc541d6f6b61ba72fe438654709eacb" dependencies = [ "dyn-stack", - "gemm-c32 0.19.0", - "gemm-c64 0.19.0", - "gemm-common 0.19.0", - "gemm-f16 0.19.0", - "gemm-f32 0.19.0", - "gemm-f64 0.19.0", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - -[[package]] -name = "gemm-c32" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6db9fd9f40421d00eea9dd0770045a5603b8d684654816637732463f4073847" -dependencies = [ - "dyn-stack", - "gemm-common 0.18.2", + "gemm-c32", + "gemm-c64", + "gemm-common", + "gemm-f16", + "gemm-f32", + "gemm-f64", "num-complex", "num-traits", "paste", @@ -1984,22 +1932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "086936dbdcb99e37aad81d320f98f670e53c1e55a98bee70573e83f95beb128c" dependencies = [ "dyn-stack", - "gemm-common 0.19.0", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - -[[package]] -name = "gemm-c64" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcad8a3d35a43758330b635d02edad980c1e143dc2f21e6fd25f9e4eada8edf" -dependencies = [ - "dyn-stack", - "gemm-common 0.18.2", + "gemm-common", "num-complex", "num-traits", "paste", @@ -2014,33 +1947,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20c8aeeeec425959bda4d9827664029ba1501a90a0d1e6228e48bef741db3a3f" dependencies = [ "dyn-stack", - "gemm-common 0.19.0", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - -[[package]] -name = "gemm-common" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a352d4a69cbe938b9e2a9cb7a3a63b7e72f9349174a2752a558a8a563510d0f3" -dependencies = [ - "bytemuck", - "dyn-stack", - "half", - "libm", + "gemm-common", "num-complex", "num-traits", - "once_cell", "paste", - "pulp 0.21.5", "raw-cpuid", - "rayon", "seq-macro", - "sysctl", ] [[package]] @@ -2057,31 +1969,13 @@ dependencies = [ "num-traits", "once_cell", "paste", - "pulp 0.22.3", + "pulp", "raw-cpuid", "rayon", "seq-macro", "sysctl", ] -[[package]] -name = "gemm-f16" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff95ae3259432f3c3410eaa919033cd03791d81cebd18018393dc147952e109" -dependencies = [ - "dyn-stack", - "gemm-common 0.18.2", - "gemm-f32 0.18.2", - "half", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "rayon", - "seq-macro", -] - [[package]] name = "gemm-f16" version = "0.19.0" @@ -2089,8 +1983,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3df7a55202e6cd6739d82ae3399c8e0c7e1402859b30e4cb780e61525d9486e" dependencies = [ "dyn-stack", - "gemm-common 0.19.0", - "gemm-f32 0.19.0", + "gemm-common", + "gemm-f32", "half", "num-complex", "num-traits", @@ -2100,21 +1994,6 @@ dependencies = [ "seq-macro", ] -[[package]] -name = "gemm-f32" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8d3d4385393304f407392f754cd2dc4b315d05063f62cf09f47b58de276864" -dependencies = [ - "dyn-stack", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - [[package]] name = "gemm-f32" version = "0.19.0" @@ -2122,22 +2001,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02e0b8c9da1fbec6e3e3ab2ce6bc259ef18eb5f6f0d3e4edf54b75f9fd41a81c" dependencies = [ "dyn-stack", - "gemm-common 0.19.0", - "num-complex", - "num-traits", - "paste", - "raw-cpuid", - "seq-macro", -] - -[[package]] -name = "gemm-f64" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b2a4f76ce4b8b16eadc11ccf2e083252d8237c1b589558a49b0183545015bd" -dependencies = [ - "dyn-stack", - "gemm-common 0.18.2", + "gemm-common", "num-complex", "num-traits", "paste", @@ -2152,7 +2016,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "056131e8f2a521bfab322f804ccd652520c79700d81209e9d9275bbdecaadc6a" dependencies = [ "dyn-stack", - "gemm-common 0.19.0", + "gemm-common", "num-complex", "num-traits", "paste", @@ -2210,8 +2074,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi 6.0.0", + "wasm-bindgen", ] [[package]] @@ -2610,7 +2476,7 @@ dependencies = [ "displaydoc", "potential_utf", "utf8_iter", - "yoke 0.8.3", + "yoke", "zerofrom", "zerovec", ] @@ -2677,7 +2543,7 @@ dependencies = [ "displaydoc", "icu_locale_core", "writeable", - "yoke 0.8.3", + "yoke", "zerofrom", "zerotrie", "zerovec", @@ -2992,7 +2858,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" dependencies = [ "gtk-sys", - "libloading 0.7.4", + "libloading", "once_cell", ] @@ -3021,16 +2887,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libloading" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" -dependencies = [ - "cfg-if", - "windows-link 0.2.1", -] - [[package]] name = "libm" version = "0.2.16" @@ -3100,15 +2956,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30" -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - [[package]] name = "markup5ever" version = "0.38.0" @@ -3154,21 +3001,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "metal" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" -dependencies = [ - "bitflags 2.13.0", - "block", - "core-graphics-types 0.1.3", - "foreign-types", - "log", - "objc", - "paste", -] - [[package]] name = "mime" version = "0.3.17" @@ -3353,30 +3185,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-complex" version = "0.4.6" @@ -3393,37 +3201,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -3472,15 +3249,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - [[package]] name = "objc2" version = "0.6.4" @@ -4085,20 +3853,6 @@ dependencies = [ "unarray", ] -[[package]] -name = "pulp" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b86df24f0a7ddd5e4b95c94fc9ed8a98f1ca94d3b01bdce2824097e7835907" -dependencies = [ - "bytemuck", - "cfg-if", - "libm", - "num-complex", - "reborrow", - "version_check", -] - [[package]] name = "pulp" version = "0.22.3" @@ -4324,9 +4078,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" dependencies = [ "aho-corasick", "memchr", @@ -4466,9 +4220,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.41" +version = "0.23.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "log", "once_cell", @@ -4490,9 +4244,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -4525,23 +4279,15 @@ checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "safetensors" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44560c11236a6130a46ce36c836a62936dc81ebf8c36a37947423571be0e55b6" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "safetensors" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675656c1eabb620b921efea4f9199f97fc86e36dd6ffd1fbbe48d0f59a4987f5" +checksum = "79b079b829cb27a1c3c374341345ed2e8b2c0c839034522cee576c140bd7f846" dependencies = [ "hashbrown 0.16.1", + "libc", "serde", "serde_json", + "tempfile", ] [[package]] @@ -4617,7 +4363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags 2.13.0", - "core-foundation 0.10.1", + "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", @@ -5129,7 +4875,7 @@ checksum = "d1c93047acf68669466a34690ac58cca7010bd1b201e1ec86f1fd0a75d3dd4a9" dependencies = [ "bitflags 2.13.0", "block2", - "core-foundation 0.10.1", + "core-foundation", "core-graphics", "crossbeam-channel", "dbus", @@ -5661,6 +5407,39 @@ dependencies = [ "unicode_categories", ] +[[package]] +name = "tokenizers" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7afbf6e88718afcc138bad01d6ccc3051dbbc3b2ce9793d8b8a3aeb610969cfc" +dependencies = [ + "ahash", + "compact_str", + "daachorse", + "dary_heap", + "derive_builder", + "esaxx-rs", + "fancy-regex 0.17.0", + "getrandom 0.3.4", + "itertools", + "log", + "macro_rules_attribute", + "monostate", + "paste", + "rand", + "rayon", + "rayon-cond", + "regex", + "regex-syntax", + "serde", + "serde_json", + "spm_precompiled", + "thiserror 2.0.18", + "unicode-normalization-alignments", + "unicode-segmentation", + "unicode_categories", +] + [[package]] name = "tokio" version = "1.52.3" @@ -5999,9 +5778,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-path" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e" +checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" [[package]] name = "typeid" @@ -6026,41 +5805,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "ug" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b761acf8af3494640d826a8609e2265e19778fb43306c7f15379c78c9b05b0" -dependencies = [ - "gemm 0.18.2", - "half", - "libloading 0.8.9", - "memmap2", - "num", - "num-traits", - "num_cpus", - "rayon", - "safetensors 0.4.5", - "serde", - "thiserror 1.0.69", - "tracing", - "yoke 0.7.5", -] - -[[package]] -name = "ug-metal" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7adf545a99a086d362efc739e7cf4317c18cbeda22706000fd434d70ea3d95" -dependencies = [ - "half", - "metal", - "objc", - "serde", - "thiserror 1.0.69", - "ug", -] - [[package]] name = "unarray" version = "0.1.4" @@ -7176,18 +6920,6 @@ dependencies = [ "hashlink 0.11.1", ] -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive 0.7.5", - "zerofrom", -] - [[package]] name = "yoke" version = "0.8.3" @@ -7195,22 +6927,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", - "yoke-derive 0.8.2", + "yoke-derive", "zerofrom", ] -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", - "synstructure", -] - [[package]] name = "yoke-derive" version = "0.8.2" @@ -7338,7 +7058,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", - "yoke 0.8.3", + "yoke", "zerofrom", ] @@ -7348,7 +7068,7 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ - "yoke 0.8.3", + "yoke", "zerofrom", "zerovec-derive", ] @@ -7366,14 +7086,18 @@ dependencies = [ [[package]] name = "zip" -version = "7.2.0" +version = "9.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e33efc22a0650c311c2ef19115ce232583abbe80850bc8b66509ebef02de0" +checksum = "23f17fbc870bfac28c6228aed7d6e6df352e26bf7015c4313727e16a7a01ce5e" dependencies = [ "crc32fast", + "getrandom 0.4.3", "indexmap 2.14.0", + "libc", "memchr", + "nix", "typed-path", + "windows-sys 0.61.2", ] [[package]] diff --git a/README.md b/README.md index 9814bab..5e7590a 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ B2_VAULT_PATH=~/notes make app # open the desktop app on a folder of Markdow Point it at an existing Obsidian vault or any folder of `.md` files. Without `B2_VAULT_PATH`, the app asks you to pick a folder and remembers it. For chat, install -[Ollama](https://ollama.com) and run `ollama pull llama3.2`. +[Ollama](https://ollama.com) and run `ollama pull gemma4:e2b`. The same engine runs from the terminal: diff --git a/crates/b2-cli/src/args.rs b/crates/b2-cli/src/args.rs index 63f62a1..ed04f5b 100644 --- a/crates/b2-cli/src/args.rs +++ b/crates/b2-cli/src/args.rs @@ -230,8 +230,8 @@ pub struct LlmArgs { #[arg(long = "llm-url", value_name = "URL")] pub llm_url: Option, /// The chat model id, as the server names it - /// [env: B2_LLM_MODEL, default: llama3.2]. Pull it first, e.g. `ollama pull - /// llama3.2`. + /// [env: B2_LLM_MODEL, default: gemma4:e2b]. Pull it first, e.g. `ollama pull + /// gemma4:e2b`. #[arg(long = "llm-model", value_name = "MODEL")] pub llm_model: Option, } diff --git a/crates/b2-embed/Cargo.toml b/crates/b2-embed/Cargo.toml index e909a91..53f14a2 100644 --- a/crates/b2-embed/Cargo.toml +++ b/crates/b2-embed/Cargo.toml @@ -10,9 +10,9 @@ description = "B2's real local embedder — candle-backed inference behind the b [dependencies] b2-core = { path = "../b2-core" } -candle-core = "0.9" -candle-nn = "0.9" -candle-transformers = "0.9" +candle-core = "0.11" +candle-nn = "0.11" +candle-transformers = "0.11" # Download seam for `b2 init`. No default features (GH #174): the `tokio` default pulls the # whole async HTTP stack for an API B2 never calls (we use `hf_hub::api::sync`). This also # drops `native-tls`, so TLS is ureq's rustls + webpki-roots rather than the OS trust store: @@ -29,9 +29,9 @@ thiserror = "2.0.18" # On macOS, link Accelerate for candle's CPU matmuls; without it bge-base inference is # ~10-100× slower. Other targets are unaffected. [target.'cfg(target_os = "macos")'.dependencies] -candle-core = { version = "0.9", features = ["accelerate"] } -candle-nn = { version = "0.9", features = ["accelerate"] } -candle-transformers = { version = "0.9", features = ["accelerate"] } +candle-core = { version = "0.11", features = ["accelerate"] } +candle-nn = { version = "0.11", features = ["accelerate"] } +candle-transformers = { version = "0.11", features = ["accelerate"] } # Run the forward pass on the Metal GPU (GH #40), additive over `accelerate`, with a CPU # fallback (`model.rs::select_device`). Switching device is a model swap (the model id gains diff --git a/crates/b2-llm/src/lib.rs b/crates/b2-llm/src/lib.rs index 204a446..fc80292 100644 --- a/crates/b2-llm/src/lib.rs +++ b/crates/b2-llm/src/lib.rs @@ -55,9 +55,10 @@ pub fn probed_provider(config: LlmConfig) -> Result, LlmErr /// Ollama's OpenAI-compatible surface, the guided default (GH #151). pub const DEFAULT_BASE_URL: &str = "http://localhost:11434/v1"; -/// The default chat model: a 3B-class model that runs on the smallest supported (8 GB) -/// machine. Never downloaded by B2; an absent model is an error the adapters phrase (E4). -pub const DEFAULT_MODEL: &str = "llama3.2"; +/// The default chat model: Gemma 4 E2B (about 2B active parameters), which runs on the +/// smallest supported (8 GB) machine and cleared `make eval-chat` on every question. Never +/// downloaded by B2; an absent model is an error the adapters phrase (E4). +pub const DEFAULT_MODEL: &str = "gemma4:e2b"; /// Environment variable naming the OpenAI-compatible base URL. pub const ENV_URL: &str = "B2_LLM_URL"; @@ -114,7 +115,7 @@ pub enum ApiKeySource { pub struct LlmConfig { /// The OpenAI-compatible base URL, e.g. `http://localhost:11434/v1`. pub base_url: String, - /// The model id as the server names it, e.g. `llama3.2`. + /// The model id as the server names it, e.g. `gemma4:e2b`. pub model: String, /// Bearer token for a cloud endpoint; `None` for a local runtime. pub api_key: Option, diff --git a/crates/b2-llm/src/setup.rs b/crates/b2-llm/src/setup.rs index 56aca02..a256d37 100644 --- a/crates/b2-llm/src/setup.rs +++ b/crates/b2-llm/src/setup.rs @@ -127,24 +127,18 @@ pub struct ModelTier { /// The tiers, smallest first. Illustrative and non-binding: a starting point, not a /// hardware floor. -pub const MODEL_TIERS: [ModelTier; 3] = [ +pub const MODEL_TIERS: [ModelTier; 2] = [ ModelTier { min_ram_gb: 0, ram: "8 GB", - size: "3–4B (4-bit)", - model: "llama3.2", + size: "2–4B (4-bit)", + model: "gemma4:e2b", }, ModelTier { min_ram_gb: 16, - ram: "16 GB", + ram: "16 GB or more", size: "7–8B", - model: "llama3.1:8b", - }, - ModelTier { - min_ram_gb: 32, - ram: "32 GB or more", - size: "12–14B and up", - model: "gemma3:12b", + model: "gemma4:e4b", }, ]; @@ -589,7 +583,7 @@ mod tests { assert_eq!(tier_for_ram(15).model, MODEL_TIERS[0].model); assert_eq!(tier_for_ram(16).model, MODEL_TIERS[1].model); assert_eq!(tier_for_ram(24).model, MODEL_TIERS[1].model); - assert_eq!(tier_for_ram(64).model, MODEL_TIERS[2].model); + assert_eq!(tier_for_ram(64).model, MODEL_TIERS[1].model); assert_eq!(tier_for_ram(0).model, MODEL_TIERS[0].model); } diff --git a/docs/evals.md b/docs/evals.md index 4f2ad8e..677b495 100644 --- a/docs/evals.md +++ b/docs/evals.md @@ -310,7 +310,7 @@ moved or changed meaning. ## `make eval-chat`: the grounded-chat scores -Needs a model server (`ollama serve` + `ollama pull llama3.2`, or `B2_LLM_URL` / +Needs a model server (`ollama serve` + `ollama pull gemma4:e2b`, or `B2_LLM_URL` / `B2_LLM_MODEL` at any OpenAI-compatible endpoint). Builds a throwaway vault from the retrieval eval's corpus (chat is scored over notes whose retrieval behavior is already characterized, so a surprise is attributable) and asks the labelled questions in diff --git a/docs/quickstart.md b/docs/quickstart.md index 35e5872..dde8242 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -333,7 +333,7 @@ in your Markdown. `b2 ask` streams an answer grounded in your own notes. B2 retrieves the most relevant passages with the same hybrid search as step 6, hands the model only those, and the answer cites them by `[n]`. It needs a model server: Ollama by default (`ollama serve`, then -`ollama pull llama3.2`); any OpenAI-compatible endpoint works via `--llm-url`/`--llm-model`. +`ollama pull gemma4:e2b`); any OpenAI-compatible endpoint works via `--llm-url`/`--llm-model`. ```console $ b2 ask "why does spacing out reviews beat cramming?" @@ -486,7 +486,7 @@ they are, `search` refuses rather than mixing embedding spaces. | `B2_VAULT_PATH` | Vault root, so commands find it without `-C`. An explicit `-C`/`--vault` overrides it. Read-only commands fall back to the current dir; commands that write (`reindex`/`add`/`write`/`mv`/`rm`/`link`) require it explicitly | | `B2_EMBEDDER=fake` | Offline mode: deterministic non-semantic embedder. Search runs keyword-only | | `HF_ENDPOINT` | The standard Hugging Face mirror setting: the endpoint `b2 init` downloads from when the config's `source` names none | -| `B2_LLM_URL` / `B2_LLM_MODEL` | The OpenAI-compatible chat endpoint + model for `ask`/`chat` (defaults: `http://localhost:11434/v1`, Ollama's, and `llama3.2`). The `--llm-url`/`--llm-model` flags beat the env, which beats the default | +| `B2_LLM_URL` / `B2_LLM_MODEL` | The OpenAI-compatible chat endpoint + model for `ask`/`chat` (defaults: `http://localhost:11434/v1`, Ollama's, and `gemma4:e2b`). The `--llm-url`/`--llm-model` flags beat the env, which beats the default | | `B2_LLM_API_KEY` | Bearer token for a cloud chat endpoint. An env var, never a flag, because a key in a flag is a key in `ps`. The desktop stores its key in the macOS Keychain instead | | `B2_LLM=fake` | The deterministic chat provider: `B2_EMBEDDER=fake`'s sibling for `ask`/`chat` | | `B2_LLM_MAX_TOOL_CALLS` | The most tool calls one model reply may carry in `b2 why` (default 64, allowed 1 to 4096). A reply over the cap fails with its own message rather than being cut short. An invalid value keeps the default and logs a warning. The desktop's Settings → Chat field overrides it | diff --git a/ui/package-lock.json b/ui/package-lock.json index 7846b4f..69b0f46 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1761,9 +1761,9 @@ "license": "MIT" }, "node_modules/dompurify": { - "version": "3.4.13", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.13.tgz", - "integrity": "sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ==", + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", + "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" @@ -2226,9 +2226,9 @@ } }, "node_modules/undici": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.0.tgz", - "integrity": "sha512-dkrQXeHSaoamnItlYbmzG0wFYrM0ZwDxCIg0A7aKjTyyhh9svRzCNFEzV+Vm05/yehjCzjDZ31KXfGEjYSztDQ==", + "version": "7.30.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz", + "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==", "dev": true, "license": "MIT", "engines": { @@ -2243,9 +2243,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", - "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.5.tgz", + "integrity": "sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/ui/src/settingsview.ts b/ui/src/settingsview.ts index 5ebc9f9..7e8a740 100644 --- a/ui/src/settingsview.ts +++ b/ui/src/settingsview.ts @@ -168,7 +168,7 @@ function chatModelFieldHtml(state: AppState, setup: ChatSetup | null): string { : ""; return ` ${pick}`; }