tokenfold 0.5.3__tar.gz → 0.6.0__tar.gz
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.
- {tokenfold-0.5.3 → tokenfold-0.6.0}/Cargo.lock +226 -11
- {tokenfold-0.5.3 → tokenfold-0.6.0}/Cargo.toml +3 -3
- tokenfold-0.6.0/PKG-INFO +75 -0
- tokenfold-0.6.0/README.md +52 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/Cargo.toml +14 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/README.md +37 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/dedup.rs +599 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/fit_request.rs +458 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/lib.rs +418 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/manifest.rs +646 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/observation.rs +1019 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/select.rs +686 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/select_runtime.rs +1084 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/semantic.rs +559 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/session.rs +582 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/src/tools.rs +618 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/tests/fit_request.rs +627 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/tests/resident_fake.py +52 -0
- tokenfold-0.6.0/crates/tokenfold-adapters/tests/select_runtime.rs +712 -0
- tokenfold-0.6.0/crates/tokenfold-core/src/fit/receipt.rs +330 -0
- tokenfold-0.6.0/crates/tokenfold-core/src/fit/request.rs +545 -0
- tokenfold-0.6.0/crates/tokenfold-core/src/fit.rs +1109 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/lib.rs +1 -0
- tokenfold-0.6.0/crates/tokenfold-core/tests/fit.rs +1115 -0
- tokenfold-0.6.0/crates/tokenfold-core/tests/fit_boundary.rs +96 -0
- tokenfold-0.6.0/crates/tokenfold-core/tests/fit_resource_bounds.rs +72 -0
- tokenfold-0.6.0/crates/tokenfold-core/tests/fit_selection.rs +828 -0
- tokenfold-0.6.0/crates/tokenfold-core/tests/fit_without_assets.rs +15 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-py/Cargo.toml +5 -3
- tokenfold-0.6.0/crates/tokenfold-py/LICENSE +201 -0
- tokenfold-0.6.0/crates/tokenfold-py/README.md +52 -0
- tokenfold-0.6.0/crates/tokenfold-py/src/fit.rs +423 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-py/src/lib.rs +3 -1
- {tokenfold-0.5.3 → tokenfold-0.6.0}/pyproject.toml +10 -8
- tokenfold-0.6.0/python/tokenfold/__init__.py +25 -0
- tokenfold-0.6.0/python/tokenfold/_native.pyi +36 -0
- tokenfold-0.6.0/python/tokenfold/accounting.py +58 -0
- tokenfold-0.6.0/python/tokenfold/client.py +201 -0
- tokenfold-0.6.0/python/tokenfold/errors.py +17 -0
- tokenfold-0.6.0/python/tokenfold/lowlevel.py +6 -0
- tokenfold-0.6.0/python/tokenfold/lowlevel.pyi +80 -0
- tokenfold-0.6.0/python/tokenfold/py.typed +0 -0
- tokenfold-0.6.0/python/tokenfold/types.py +234 -0
- tokenfold-0.5.3/PKG-INFO +0 -932
- tokenfold-0.5.3/README.md +0 -909
- {tokenfold-0.5.3 → tokenfold-0.6.0}/LICENSE +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/Cargo.toml +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/README.md +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/benches/THRESHOLDS.toml +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/benches/compression_bench.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/allocation.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/budget.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/codec.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/errors.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/filters.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/holdout.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/input.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/measurement.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/modes.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/pipeline/mod.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/pipeline/tests.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/profiles.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/report.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/retrieval_store.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/safety.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/stats.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/status.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/token_estimator.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/diff.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/json.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/json_dict.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/json_fold.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/json_prune.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/log_fold.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/logs.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/mod.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/redaction.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/src/transforms/schema.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/tests/golden.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/tests/integration.rs +0 -0
- {tokenfold-0.5.3 → tokenfold-0.6.0}/crates/tokenfold-core/tests/property_tests.rs +0 -0
|
@@ -242,6 +242,15 @@ version = "0.9.6"
|
|
|
242
242
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
243
|
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
|
|
244
244
|
|
|
245
|
+
[[package]]
|
|
246
|
+
name = "convert_case"
|
|
247
|
+
version = "0.12.0"
|
|
248
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
+
checksum = "1af709f1f33454bf52eadfc8c78b3b9ef9cb26fb54d16dc9cd9a7299f899fd1b"
|
|
250
|
+
dependencies = [
|
|
251
|
+
"unicode-segmentation",
|
|
252
|
+
]
|
|
253
|
+
|
|
245
254
|
[[package]]
|
|
246
255
|
name = "cpufeatures"
|
|
247
256
|
version = "0.2.17"
|
|
@@ -261,6 +270,12 @@ dependencies = [
|
|
|
261
270
|
"typenum",
|
|
262
271
|
]
|
|
263
272
|
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "ctor"
|
|
275
|
+
version = "1.0.13"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"
|
|
278
|
+
|
|
264
279
|
[[package]]
|
|
265
280
|
name = "ctrlc"
|
|
266
281
|
version = "3.5.2"
|
|
@@ -406,6 +421,94 @@ version = "1.0.7"
|
|
|
406
421
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
407
422
|
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
|
408
423
|
|
|
424
|
+
[[package]]
|
|
425
|
+
name = "futures"
|
|
426
|
+
version = "0.3.34"
|
|
427
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
428
|
+
checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
|
|
429
|
+
dependencies = [
|
|
430
|
+
"futures-channel",
|
|
431
|
+
"futures-core",
|
|
432
|
+
"futures-executor",
|
|
433
|
+
"futures-io",
|
|
434
|
+
"futures-sink",
|
|
435
|
+
"futures-task",
|
|
436
|
+
"futures-util",
|
|
437
|
+
]
|
|
438
|
+
|
|
439
|
+
[[package]]
|
|
440
|
+
name = "futures-channel"
|
|
441
|
+
version = "0.3.34"
|
|
442
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
443
|
+
checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
|
|
444
|
+
dependencies = [
|
|
445
|
+
"futures-core",
|
|
446
|
+
"futures-sink",
|
|
447
|
+
]
|
|
448
|
+
|
|
449
|
+
[[package]]
|
|
450
|
+
name = "futures-core"
|
|
451
|
+
version = "0.3.34"
|
|
452
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
453
|
+
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
|
454
|
+
|
|
455
|
+
[[package]]
|
|
456
|
+
name = "futures-executor"
|
|
457
|
+
version = "0.3.34"
|
|
458
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
459
|
+
checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
|
|
460
|
+
dependencies = [
|
|
461
|
+
"futures-core",
|
|
462
|
+
"futures-task",
|
|
463
|
+
"futures-util",
|
|
464
|
+
]
|
|
465
|
+
|
|
466
|
+
[[package]]
|
|
467
|
+
name = "futures-io"
|
|
468
|
+
version = "0.3.34"
|
|
469
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
470
|
+
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
|
|
471
|
+
|
|
472
|
+
[[package]]
|
|
473
|
+
name = "futures-macro"
|
|
474
|
+
version = "0.3.34"
|
|
475
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
476
|
+
checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
|
477
|
+
dependencies = [
|
|
478
|
+
"proc-macro2",
|
|
479
|
+
"quote",
|
|
480
|
+
"syn 3.0.4",
|
|
481
|
+
]
|
|
482
|
+
|
|
483
|
+
[[package]]
|
|
484
|
+
name = "futures-sink"
|
|
485
|
+
version = "0.3.34"
|
|
486
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
487
|
+
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
|
|
488
|
+
|
|
489
|
+
[[package]]
|
|
490
|
+
name = "futures-task"
|
|
491
|
+
version = "0.3.34"
|
|
492
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
493
|
+
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
|
494
|
+
|
|
495
|
+
[[package]]
|
|
496
|
+
name = "futures-util"
|
|
497
|
+
version = "0.3.34"
|
|
498
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
499
|
+
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
|
500
|
+
dependencies = [
|
|
501
|
+
"futures-channel",
|
|
502
|
+
"futures-core",
|
|
503
|
+
"futures-io",
|
|
504
|
+
"futures-macro",
|
|
505
|
+
"futures-sink",
|
|
506
|
+
"futures-task",
|
|
507
|
+
"memchr",
|
|
508
|
+
"pin-project-lite",
|
|
509
|
+
"slab",
|
|
510
|
+
]
|
|
511
|
+
|
|
409
512
|
[[package]]
|
|
410
513
|
name = "generic-array"
|
|
411
514
|
version = "0.14.7"
|
|
@@ -518,6 +621,16 @@ version = "0.2.186"
|
|
|
518
621
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
519
622
|
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
520
623
|
|
|
624
|
+
[[package]]
|
|
625
|
+
name = "libloading"
|
|
626
|
+
version = "0.9.0"
|
|
627
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
628
|
+
checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60"
|
|
629
|
+
dependencies = [
|
|
630
|
+
"cfg-if",
|
|
631
|
+
"windows-link",
|
|
632
|
+
]
|
|
633
|
+
|
|
521
634
|
[[package]]
|
|
522
635
|
name = "linux-raw-sys"
|
|
523
636
|
version = "0.12.1"
|
|
@@ -536,6 +649,64 @@ version = "2.8.3"
|
|
|
536
649
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
537
650
|
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
538
651
|
|
|
652
|
+
[[package]]
|
|
653
|
+
name = "napi"
|
|
654
|
+
version = "3.16.1"
|
|
655
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
656
|
+
checksum = "907ff7366fb7182e28edd0f08ef8ac5d6b13b8d65a3c0b3a10bf3ac092437d6b"
|
|
657
|
+
dependencies = [
|
|
658
|
+
"bitflags",
|
|
659
|
+
"ctor",
|
|
660
|
+
"futures",
|
|
661
|
+
"libc",
|
|
662
|
+
"napi-build",
|
|
663
|
+
"napi-sys",
|
|
664
|
+
"nohash-hasher",
|
|
665
|
+
"rustc-hash 2.1.3",
|
|
666
|
+
]
|
|
667
|
+
|
|
668
|
+
[[package]]
|
|
669
|
+
name = "napi-build"
|
|
670
|
+
version = "2.6.0"
|
|
671
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
672
|
+
checksum = "b899b545d3aa6dca985939059f258c5488d34e4ecf39c274e20009748f4b846d"
|
|
673
|
+
|
|
674
|
+
[[package]]
|
|
675
|
+
name = "napi-derive"
|
|
676
|
+
version = "3.7.0"
|
|
677
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
678
|
+
checksum = "d32eb00f92f84cf462fc328f49082b29c2a7d2eebeb1d447d19c1f9fdd9f89ee"
|
|
679
|
+
dependencies = [
|
|
680
|
+
"convert_case",
|
|
681
|
+
"ctor",
|
|
682
|
+
"napi-derive-backend",
|
|
683
|
+
"proc-macro2",
|
|
684
|
+
"quote",
|
|
685
|
+
"syn 3.0.4",
|
|
686
|
+
]
|
|
687
|
+
|
|
688
|
+
[[package]]
|
|
689
|
+
name = "napi-derive-backend"
|
|
690
|
+
version = "7.0.0"
|
|
691
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
692
|
+
checksum = "d1fe28c64d8fc12e69f9b817d0febdbe7914555760f1e353106281b8ff99cc90"
|
|
693
|
+
dependencies = [
|
|
694
|
+
"convert_case",
|
|
695
|
+
"proc-macro2",
|
|
696
|
+
"quote",
|
|
697
|
+
"semver",
|
|
698
|
+
"syn 3.0.4",
|
|
699
|
+
]
|
|
700
|
+
|
|
701
|
+
[[package]]
|
|
702
|
+
name = "napi-sys"
|
|
703
|
+
version = "3.4.1"
|
|
704
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
705
|
+
checksum = "d153beb7d5c973f4b9395be8a83054a28968b61188f1dd1a2cc2321af22daea2"
|
|
706
|
+
dependencies = [
|
|
707
|
+
"libloading",
|
|
708
|
+
]
|
|
709
|
+
|
|
539
710
|
[[package]]
|
|
540
711
|
name = "nix"
|
|
541
712
|
version = "0.31.3"
|
|
@@ -548,6 +719,12 @@ dependencies = [
|
|
|
548
719
|
"libc",
|
|
549
720
|
]
|
|
550
721
|
|
|
722
|
+
[[package]]
|
|
723
|
+
name = "nohash-hasher"
|
|
724
|
+
version = "0.2.0"
|
|
725
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
726
|
+
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
|
727
|
+
|
|
551
728
|
[[package]]
|
|
552
729
|
name = "num-traits"
|
|
553
730
|
version = "0.2.19"
|
|
@@ -590,6 +767,12 @@ version = "2.3.2"
|
|
|
590
767
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
591
768
|
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
|
592
769
|
|
|
770
|
+
[[package]]
|
|
771
|
+
name = "pin-project-lite"
|
|
772
|
+
version = "0.2.17"
|
|
773
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
774
|
+
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
775
|
+
|
|
593
776
|
[[package]]
|
|
594
777
|
name = "pkcs8"
|
|
595
778
|
version = "0.10.2"
|
|
@@ -823,6 +1006,12 @@ version = "1.1.0"
|
|
|
823
1006
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
824
1007
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
825
1008
|
|
|
1009
|
+
[[package]]
|
|
1010
|
+
name = "rustc-hash"
|
|
1011
|
+
version = "2.1.3"
|
|
1012
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1013
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
1014
|
+
|
|
826
1015
|
[[package]]
|
|
827
1016
|
name = "rustc_version"
|
|
828
1017
|
version = "0.4.1"
|
|
@@ -977,6 +1166,12 @@ dependencies = [
|
|
|
977
1166
|
"rand_core 0.6.4",
|
|
978
1167
|
]
|
|
979
1168
|
|
|
1169
|
+
[[package]]
|
|
1170
|
+
name = "slab"
|
|
1171
|
+
version = "0.4.12"
|
|
1172
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1173
|
+
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
1174
|
+
|
|
980
1175
|
[[package]]
|
|
981
1176
|
name = "spki"
|
|
982
1177
|
version = "0.7.3"
|
|
@@ -1092,7 +1287,7 @@ dependencies = [
|
|
|
1092
1287
|
"fancy-regex",
|
|
1093
1288
|
"lazy_static",
|
|
1094
1289
|
"regex",
|
|
1095
|
-
"rustc-hash",
|
|
1290
|
+
"rustc-hash 1.1.0",
|
|
1096
1291
|
]
|
|
1097
1292
|
|
|
1098
1293
|
[[package]]
|
|
@@ -1109,7 +1304,7 @@ dependencies = [
|
|
|
1109
1304
|
|
|
1110
1305
|
[[package]]
|
|
1111
1306
|
name = "tokenfold-adapters"
|
|
1112
|
-
version = "0.
|
|
1307
|
+
version = "0.6.0"
|
|
1113
1308
|
dependencies = [
|
|
1114
1309
|
"serde",
|
|
1115
1310
|
"serde_json",
|
|
@@ -1118,7 +1313,7 @@ dependencies = [
|
|
|
1118
1313
|
|
|
1119
1314
|
[[package]]
|
|
1120
1315
|
name = "tokenfold-admin"
|
|
1121
|
-
version = "0.
|
|
1316
|
+
version = "0.6.0"
|
|
1122
1317
|
dependencies = [
|
|
1123
1318
|
"ed25519-dalek",
|
|
1124
1319
|
"serde",
|
|
@@ -1128,7 +1323,7 @@ dependencies = [
|
|
|
1128
1323
|
|
|
1129
1324
|
[[package]]
|
|
1130
1325
|
name = "tokenfold-cli"
|
|
1131
|
-
version = "0.
|
|
1326
|
+
version = "0.6.0"
|
|
1132
1327
|
dependencies = [
|
|
1133
1328
|
"clap",
|
|
1134
1329
|
"serde",
|
|
@@ -1143,7 +1338,7 @@ dependencies = [
|
|
|
1143
1338
|
|
|
1144
1339
|
[[package]]
|
|
1145
1340
|
name = "tokenfold-core"
|
|
1146
|
-
version = "0.
|
|
1341
|
+
version = "0.6.0"
|
|
1147
1342
|
dependencies = [
|
|
1148
1343
|
"proptest",
|
|
1149
1344
|
"regex",
|
|
@@ -1158,25 +1353,38 @@ dependencies = [
|
|
|
1158
1353
|
|
|
1159
1354
|
[[package]]
|
|
1160
1355
|
name = "tokenfold-image"
|
|
1161
|
-
version = "0.
|
|
1356
|
+
version = "0.6.0"
|
|
1162
1357
|
|
|
1163
1358
|
[[package]]
|
|
1164
1359
|
name = "tokenfold-learn"
|
|
1165
|
-
version = "0.
|
|
1360
|
+
version = "0.6.0"
|
|
1361
|
+
dependencies = [
|
|
1362
|
+
"tokenfold-core",
|
|
1363
|
+
]
|
|
1364
|
+
|
|
1365
|
+
[[package]]
|
|
1366
|
+
name = "tokenfold-node"
|
|
1367
|
+
version = "0.6.0"
|
|
1166
1368
|
dependencies = [
|
|
1369
|
+
"napi",
|
|
1370
|
+
"napi-build",
|
|
1371
|
+
"napi-derive",
|
|
1372
|
+
"serde",
|
|
1373
|
+
"serde_json",
|
|
1374
|
+
"tokenfold-adapters",
|
|
1167
1375
|
"tokenfold-core",
|
|
1168
1376
|
]
|
|
1169
1377
|
|
|
1170
1378
|
[[package]]
|
|
1171
1379
|
name = "tokenfold-output"
|
|
1172
|
-
version = "0.
|
|
1380
|
+
version = "0.6.0"
|
|
1173
1381
|
dependencies = [
|
|
1174
1382
|
"tokenfold-core",
|
|
1175
1383
|
]
|
|
1176
1384
|
|
|
1177
1385
|
[[package]]
|
|
1178
1386
|
name = "tokenfold-proxy"
|
|
1179
|
-
version = "0.
|
|
1387
|
+
version = "0.6.0"
|
|
1180
1388
|
dependencies = [
|
|
1181
1389
|
"clap",
|
|
1182
1390
|
"ctrlc",
|
|
@@ -1190,16 +1398,17 @@ dependencies = [
|
|
|
1190
1398
|
|
|
1191
1399
|
[[package]]
|
|
1192
1400
|
name = "tokenfold-py"
|
|
1193
|
-
version = "0.
|
|
1401
|
+
version = "0.6.0"
|
|
1194
1402
|
dependencies = [
|
|
1195
1403
|
"pyo3",
|
|
1196
1404
|
"serde_json",
|
|
1405
|
+
"tokenfold-adapters",
|
|
1197
1406
|
"tokenfold-core",
|
|
1198
1407
|
]
|
|
1199
1408
|
|
|
1200
1409
|
[[package]]
|
|
1201
1410
|
name = "tokenfold-rag"
|
|
1202
|
-
version = "0.
|
|
1411
|
+
version = "0.6.0"
|
|
1203
1412
|
dependencies = [
|
|
1204
1413
|
"tokenfold-core",
|
|
1205
1414
|
]
|
|
@@ -1275,6 +1484,12 @@ version = "1.0.24"
|
|
|
1275
1484
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1276
1485
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
1277
1486
|
|
|
1487
|
+
[[package]]
|
|
1488
|
+
name = "unicode-segmentation"
|
|
1489
|
+
version = "1.13.3"
|
|
1490
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1491
|
+
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
|
|
1492
|
+
|
|
1278
1493
|
[[package]]
|
|
1279
1494
|
name = "untrusted"
|
|
1280
1495
|
version = "0.9.0"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[workspace]
|
|
2
2
|
resolver = "2"
|
|
3
|
-
members = ["crates/tokenfold-core", "crates/tokenfold-py"]
|
|
3
|
+
members = ["crates/tokenfold-core", "crates/tokenfold-py", "crates/tokenfold-adapters"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.
|
|
6
|
+
version = "0.6.0"
|
|
7
7
|
edition = "2024"
|
|
8
8
|
rust-version = "1.98"
|
|
9
9
|
license = "Apache-2.0"
|
|
@@ -11,7 +11,7 @@ repository = "https://github.com/snchimata/tokenfold"
|
|
|
11
11
|
|
|
12
12
|
[workspace.dependencies]
|
|
13
13
|
serde = { version = "1", features = ["derive"] }
|
|
14
|
-
serde_json = { version = "1", features = ["preserve_order"] }
|
|
14
|
+
serde_json = { version = "1", features = ["preserve_order", "float_roundtrip"] }
|
|
15
15
|
thiserror = "1"
|
|
16
16
|
regex = "1"
|
|
17
17
|
clap = { version = "4", features = ["derive"] }
|
tokenfold-0.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tokenfold
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
7
|
+
Classifier: Programming Language :: Rust
|
|
8
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Topic :: Text Processing
|
|
14
|
+
Requires-Dist: tokenfold-select-runtime==0.6.0 ; extra == 'select'
|
|
15
|
+
Provides-Extra: select
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Summary: Token-compression toolkit for LLM payloads (Python binding over the tokenfold-core Rust crate)
|
|
18
|
+
Keywords: llm,tokens,compression,tokenizer,openai,json,prompt-engineering,cli,token-optimization
|
|
19
|
+
License-Expression: Apache-2.0
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
22
|
+
|
|
23
|
+
# Tokenfold Python SDK
|
|
24
|
+
|
|
25
|
+
Offline native request fitting. Python 3.12 or newer is required by the replacement
|
|
26
|
+
SDK. Experimental Select uses a separately approved, explicitly configured runtime;
|
|
27
|
+
base import and Core fitting never load models or download assets.
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from tokenfold import fit
|
|
31
|
+
|
|
32
|
+
result = fit("Keep this text unchanged.", target_tokens=32)
|
|
33
|
+
text = result.require_met()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Advanced compression, decoding, retrieval and historical compression report readers
|
|
37
|
+
are available under `tokenfold.lowlevel`. Fit receipts are a separate schema.
|
|
38
|
+
|
|
39
|
+
`fit` never sends a request. Text is opaque and unchanged; `Data(value)` renders
|
|
40
|
+
compact JSON. `Data(value, representation="folded")` explicitly opts into the
|
|
41
|
+
reversible Tokenfold codec: the consumer must understand that syntax (or decode
|
|
42
|
+
with `tokenfold.lowlevel.decode`). Typed JSON normalizes safe integral floats and
|
|
43
|
+
signed zero in Rust; default JSON preserves insertion order, while explicit folded
|
|
44
|
+
JSON may normalize per-object key order. Opaque text is byte-preserved.
|
|
45
|
+
|
|
46
|
+
Provider `Request.openai(...)` / `Request.anthropic(...)` payloads are full request
|
|
47
|
+
objects, not bare message lists. The default encoding counter cannot establish
|
|
48
|
+
provider framing and returns unavailable. Supply a complete-request counter, or
|
|
49
|
+
explicitly choose the historical `ProviderCounter.openai(model="gpt-4o-2024-08-06")`
|
|
50
|
+
local **estimate**. Estimates never become `met`: strict `require_met()` rejects
|
|
51
|
+
them; per-fit `budget_mode="best_effort"` permits `require_fit()` only when the
|
|
52
|
+
finite estimate fits. This offline recipe is not proof of billing or model availability.
|
|
53
|
+
|
|
54
|
+
A client owns independent fitting sessions and supports `with`, `async with` and
|
|
55
|
+
`await client.afit(...)`. Custom counters are synchronous and must support concurrent,
|
|
56
|
+
deterministic calls; async fitting runs them off-loop. Blocking application callbacks
|
|
57
|
+
cannot be forcibly preempted, so no bounded whole-call/close deadline is promised
|
|
58
|
+
across them. Cancellation waits for native inference cleanup before raising.
|
|
59
|
+
|
|
60
|
+
Selection is experimental and unqualified. It requires **both** an approved runtime
|
|
61
|
+
(`SelectRuntime(config_path, experimental=True)`) configured on `Tokenfold` and
|
|
62
|
+
`allow_selection=True` on that individual fit. Group annotations alone are not
|
|
63
|
+
consent. Required groups and the query are retained; callers must bundle semantic
|
|
64
|
+
dependencies themselves. `warmup()` only loads that configured runtime; import and
|
|
65
|
+
already-fitting Core requests never start it. Provisioning the optional runtime and
|
|
66
|
+
acquiring its pinned local model are separate explicit setup actions.
|
|
67
|
+
|
|
68
|
+
Install with `pip install tokenfold==0.6.0`. The exact
|
|
69
|
+
`tokenfold[select]` extra adds only `tokenfold-select-runtime==0.6.0`, not ML packages.
|
|
70
|
+
Prebuilt targets: Linux GNU x64/arm64, macOS x64/arm64, Windows x64, gated by installed
|
|
71
|
+
artifact CI before release. See the [migration guide](https://github.com/snchimata/tokenfold/blob/main/docs/sdk-migration.md)
|
|
72
|
+
for provisioning, grouping recipes and queue/cold-start limits. The pinned tokenizer
|
|
73
|
+
may refuse long valid inputs with AccountingError (and its own panic diagnostic);
|
|
74
|
+
there is no heuristic/zero fallback.
|
|
75
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Tokenfold Python SDK
|
|
2
|
+
|
|
3
|
+
Offline native request fitting. Python 3.12 or newer is required by the replacement
|
|
4
|
+
SDK. Experimental Select uses a separately approved, explicitly configured runtime;
|
|
5
|
+
base import and Core fitting never load models or download assets.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from tokenfold import fit
|
|
9
|
+
|
|
10
|
+
result = fit("Keep this text unchanged.", target_tokens=32)
|
|
11
|
+
text = result.require_met()
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Advanced compression, decoding, retrieval and historical compression report readers
|
|
15
|
+
are available under `tokenfold.lowlevel`. Fit receipts are a separate schema.
|
|
16
|
+
|
|
17
|
+
`fit` never sends a request. Text is opaque and unchanged; `Data(value)` renders
|
|
18
|
+
compact JSON. `Data(value, representation="folded")` explicitly opts into the
|
|
19
|
+
reversible Tokenfold codec: the consumer must understand that syntax (or decode
|
|
20
|
+
with `tokenfold.lowlevel.decode`). Typed JSON normalizes safe integral floats and
|
|
21
|
+
signed zero in Rust; default JSON preserves insertion order, while explicit folded
|
|
22
|
+
JSON may normalize per-object key order. Opaque text is byte-preserved.
|
|
23
|
+
|
|
24
|
+
Provider `Request.openai(...)` / `Request.anthropic(...)` payloads are full request
|
|
25
|
+
objects, not bare message lists. The default encoding counter cannot establish
|
|
26
|
+
provider framing and returns unavailable. Supply a complete-request counter, or
|
|
27
|
+
explicitly choose the historical `ProviderCounter.openai(model="gpt-4o-2024-08-06")`
|
|
28
|
+
local **estimate**. Estimates never become `met`: strict `require_met()` rejects
|
|
29
|
+
them; per-fit `budget_mode="best_effort"` permits `require_fit()` only when the
|
|
30
|
+
finite estimate fits. This offline recipe is not proof of billing or model availability.
|
|
31
|
+
|
|
32
|
+
A client owns independent fitting sessions and supports `with`, `async with` and
|
|
33
|
+
`await client.afit(...)`. Custom counters are synchronous and must support concurrent,
|
|
34
|
+
deterministic calls; async fitting runs them off-loop. Blocking application callbacks
|
|
35
|
+
cannot be forcibly preempted, so no bounded whole-call/close deadline is promised
|
|
36
|
+
across them. Cancellation waits for native inference cleanup before raising.
|
|
37
|
+
|
|
38
|
+
Selection is experimental and unqualified. It requires **both** an approved runtime
|
|
39
|
+
(`SelectRuntime(config_path, experimental=True)`) configured on `Tokenfold` and
|
|
40
|
+
`allow_selection=True` on that individual fit. Group annotations alone are not
|
|
41
|
+
consent. Required groups and the query are retained; callers must bundle semantic
|
|
42
|
+
dependencies themselves. `warmup()` only loads that configured runtime; import and
|
|
43
|
+
already-fitting Core requests never start it. Provisioning the optional runtime and
|
|
44
|
+
acquiring its pinned local model are separate explicit setup actions.
|
|
45
|
+
|
|
46
|
+
Install with `pip install tokenfold==0.6.0`. The exact
|
|
47
|
+
`tokenfold[select]` extra adds only `tokenfold-select-runtime==0.6.0`, not ML packages.
|
|
48
|
+
Prebuilt targets: Linux GNU x64/arm64, macOS x64/arm64, Windows x64, gated by installed
|
|
49
|
+
artifact CI before release. See the [migration guide](https://github.com/snchimata/tokenfold/blob/main/docs/sdk-migration.md)
|
|
50
|
+
for provisioning, grouping recipes and queue/cold-start limits. The pinned tokenizer
|
|
51
|
+
may refuse long valid inputs with AccountingError (and its own panic diagnostic);
|
|
52
|
+
there is no heuristic/zero fallback.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "tokenfold-adapters"
|
|
3
|
+
version.workspace = true
|
|
4
|
+
edition.workspace = true
|
|
5
|
+
rust-version.workspace = true
|
|
6
|
+
license.workspace = true
|
|
7
|
+
repository.workspace = true
|
|
8
|
+
description = "Explicit, model-free provider observation adapters for Tokenfold."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
tokenfold-core = { version = "0.6.0", path = "../tokenfold-core" }
|
|
13
|
+
serde = { version = "1", features = ["derive"] }
|
|
14
|
+
serde_json = { version = "1", features = ["preserve_order"] }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# tokenfold-adapters
|
|
2
|
+
|
|
3
|
+
Explicit provider-wire adapters for Tokenfold. No provider SDK or model runtime is required.
|
|
4
|
+
|
|
5
|
+
- `compress_for` and `verify_shape_parity`: OpenAI/Anthropic wire-shape checks.
|
|
6
|
+
- `observation`: opt-in OpenAI tool-result JSON compression with envelope validation,
|
|
7
|
+
protected content, thresholds and no-growth fallback.
|
|
8
|
+
- `session`: in-process commitments or opt-in locked, bounded fingerprint snapshots
|
|
9
|
+
for restart-safe observation idempotence; not durable history compaction.
|
|
10
|
+
- `dedup`: conservative duplicate encoding with public-decoder byte round-trip checks.
|
|
11
|
+
- `manifest::build_task_manifest`: caller-declared task/revision and required state;
|
|
12
|
+
missing provenance, conflicting facts or exceeded limits reject the manifest.
|
|
13
|
+
- `tools::select_tools_for_query`: deterministic lexical ranking, preserved JSON values
|
|
14
|
+
and key order, forced/companion tools and a caller-owned discovery tool.
|
|
15
|
+
- `select`: experimental text/ID mapping, approved direct-child scorer invocation with
|
|
16
|
+
deadline/cancellation, strict score validation, whole-group selection and prompt recount.
|
|
17
|
+
No model runtime is bundled and auxiliary model files remain caller-owned.
|
|
18
|
+
- `semantic`: experimental claim-backed literal extraction, **not** a verified generative
|
|
19
|
+
summarizer. Its synchronous strategy interface cannot enforce a hard inference deadline.
|
|
20
|
+
|
|
21
|
+
Policies are disabled by default. Callers own task association, authorized catalogs,
|
|
22
|
+
discovery execution, prompt insertion and recovery. No host hooks are installed.
|
|
23
|
+
Framework names denote compatible wire shapes, not independently qualified SDK integrations.
|
|
24
|
+
JSON value preservation does not promise preservation of original JSON whitespace.
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
use tokenfold_adapters::{compress_for, AdapterFormat};
|
|
28
|
+
use tokenfold_core::CompressionPolicy;
|
|
29
|
+
|
|
30
|
+
let policy = CompressionPolicy::builder().build()?;
|
|
31
|
+
let result = compress_for(AdapterFormat::OpenAiChat,
|
|
32
|
+
br#"{"messages":[{"role":"user","content":"Hello"}]}"#, &policy)?;
|
|
33
|
+
# Ok::<(), tokenfold_core::TokenFoldError>(())
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Experimental helpers have not established live task-quality or cache non-inferiority.
|
|
37
|
+
Do not silently substitute them for default presets.
|