kf-sdk 3.0.2__tar.gz → 3.0.4__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.
Files changed (95) hide show
  1. kf_sdk-3.0.4/.github/workflows/publish.yml +75 -0
  2. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/.gitignore +5 -1
  3. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/Cargo.lock +39 -22
  4. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/Cargo.toml +2 -1
  5. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/PKG-INFO +9 -8
  6. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/README.en.md +8 -7
  7. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/README.md +8 -7
  8. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/README.md +22 -1
  9. kf_sdk-3.0.4/code_examples/benchmark_and_model_artifacts.py +208 -0
  10. kf_sdk-3.0.4/code_examples/bulk_mutation_and_version_build.py +169 -0
  11. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/bulk_upload.py +1 -1
  12. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/dataset_lifecycle_example.py +13 -1
  13. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/dataset_operations_example.py +1 -1
  14. kf_sdk-3.0.4/docs/Benchmarks.md +166 -0
  15. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/BuildAndPublish.md +1 -1
  16. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/Datasets.md +77 -8
  17. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/GettingStarted.md +3 -3
  18. kf_sdk-3.0.4/docs/KappaApkClient.md +238 -0
  19. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/README.md +2 -2
  20. kf_sdk-3.0.4/docs/ru/Benchmarks.md +166 -0
  21. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/BuildAndPublish.md +1 -1
  22. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/Datasets.md +43 -6
  23. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/GettingStarted.md +1 -1
  24. kf_sdk-3.0.4/docs/ru/KappaApkClient.md +236 -0
  25. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/README.md +1 -1
  26. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/kappa_apk.pyi +507 -25
  27. kf_sdk-3.0.4/src/benchmarks/benchmarks.rs +867 -0
  28. kf_sdk-3.0.4/src/benchmarks/benchmarks_api.rs +571 -0
  29. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/benchmarks/mod.rs +1 -0
  30. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/client.rs +862 -134
  31. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/compat.rs +6 -3
  32. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/datasets/datasets.rs +508 -14
  33. kf_sdk-3.0.4/src/inference_writer.rs +527 -0
  34. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/lib.rs +7 -2
  35. kf_sdk-3.0.4/src/model_artifacts.rs +1273 -0
  36. kf_sdk-3.0.4/src/models/benchmarks_model.rs +171 -0
  37. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/models/datasets_model.rs +388 -1
  38. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/models_api.rs +52 -95
  39. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/upload_limits.rs +1 -1
  40. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/mod.rs +1 -0
  41. kf_sdk-3.0.4/src/utils/package_download.rs +251 -0
  42. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/zip_utils.rs +5 -0
  43. kf_sdk-3.0.2/docs/Benchmarks.md +0 -76
  44. kf_sdk-3.0.2/docs/KappaApkClient.md +0 -141
  45. kf_sdk-3.0.2/docs/ru/Benchmarks.md +0 -76
  46. kf_sdk-3.0.2/docs/ru/KappaApkClient.md +0 -145
  47. kf_sdk-3.0.2/src/benchmarks/benchmarks.rs +0 -593
  48. kf_sdk-3.0.2/src/models/benchmarks_model.rs +0 -85
  49. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/.dockerignore +0 -0
  50. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/.github/workflows/ci.yml +0 -0
  51. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/.gitlab-ci.yml +0 -0
  52. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/Dockerfile +0 -0
  53. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/LICENSE.md +0 -0
  54. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/build_wheel.sh +0 -0
  55. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/http_client_authentication_example.py +0 -0
  56. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/mnist_kappa_training_example.py +0 -0
  57. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/requirements.txt +0 -0
  58. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/setup_venv.sh +0 -0
  59. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/upgrade_venv.sh +0 -0
  60. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/upload_kappa_helpers.py +0 -0
  61. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/code_examples/upload_torchvision_to_kappa_example.py +0 -0
  62. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docker-compose.yml +0 -0
  63. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/DataModels.md +0 -0
  64. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/LoadersAndTransforms.md +0 -0
  65. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/DataModels.md +0 -0
  66. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/docs/ru/LoadersAndTransforms.md +0 -0
  67. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/kappa-eng.png +0 -0
  68. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/kappa-rus.png +0 -0
  69. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/pyproject.toml +0 -0
  70. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/benchmarks/verifications.rs +0 -0
  71. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/datasets/dataloader_helper.rs +0 -0
  72. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/datasets/kappa_dataloader.rs +0 -0
  73. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/datasets/mod.rs +0 -0
  74. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/ml_tags.rs +0 -0
  75. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/models/login_models.rs +0 -0
  76. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/models/mod.rs +0 -0
  77. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/models/users_model.rs +0 -0
  78. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/traits.rs +0 -0
  79. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/transforms/audio.rs +0 -0
  80. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/transforms/mod.rs +0 -0
  81. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/transforms/text.rs +0 -0
  82. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/transforms/vision.rs +0 -0
  83. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/users/mod.rs +0 -0
  84. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/users/users.rs +0 -0
  85. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/file_utils.rs +0 -0
  86. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/git_utils.rs +0 -0
  87. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/metric_utils.rs +0 -0
  88. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/src/utils/python_json.rs +0 -0
  89. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/README.md +0 -0
  90. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/benchmark_verification_files.json +0 -0
  91. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/benchmark_verification_response.json +0 -0
  92. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/dataset_labels_string.json +0 -0
  93. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/dataset_labels_wrapped.json +0 -0
  94. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/user_profile_no_org.json +0 -0
  95. {kf_sdk-3.0.2 → kf_sdk-3.0.4}/tests/fixtures/user_profile_with_org.json +0 -0
@@ -0,0 +1,75 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build_wheels:
10
+ name: Wheels (${{ matrix.os }})
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest, macos-14]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up QEMU
21
+ if: runner.os == 'Linux'
22
+ uses: docker/setup-qemu-action@v3
23
+ with:
24
+ platforms: all
25
+
26
+ - uses: pypa/cibuildwheel@v2.22.1
27
+ env:
28
+ # Override pyproject "auto" — publish all supported Linux arches via QEMU.
29
+ CIBW_ARCHS_LINUX: x86_64 aarch64
30
+
31
+ - uses: actions/upload-artifact@v4
32
+ with:
33
+ name: wheels-${{ matrix.os }}
34
+ path: ./wheelhouse/*.whl
35
+
36
+ build_sdist:
37
+ name: Source distribution
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: "3.11"
45
+
46
+ - name: Build sdist
47
+ run: pip install maturin && maturin sdist -o dist
48
+
49
+ - uses: actions/upload-artifact@v4
50
+ with:
51
+ name: sdist
52
+ path: dist/*.tar.gz
53
+
54
+ publish:
55
+ name: Upload to PyPI
56
+ needs: [build_wheels, build_sdist]
57
+ runs-on: ubuntu-latest
58
+ environment: pypi
59
+ permissions:
60
+ id-token: write
61
+ steps:
62
+ - uses: actions/download-artifact@v4
63
+ with:
64
+ pattern: wheels-*
65
+ merge-multiple: true
66
+ path: dist
67
+
68
+ - uses: actions/download-artifact@v4
69
+ with:
70
+ name: sdist
71
+ path: dist
72
+
73
+ - uses: pypa/gh-action-pypi-publish@release/v1
74
+ with:
75
+ packages-dir: dist
@@ -194,4 +194,8 @@ Thumbs.db
194
194
  internal_services/
195
195
 
196
196
  # Maintainer-only docs (local paths, sync notes, backend mapping) — keep on disk, never publish
197
- internal_docs/
197
+ internal_docs/
198
+
199
+ # Ignore local test files
200
+ local_tests/
201
+ .kappa_uploads/
@@ -72,9 +72,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
72
72
 
73
73
  [[package]]
74
74
  name = "bytes"
75
- version = "1.12.1"
75
+ version = "1.12.0"
76
76
  source = "registry+https://github.com/rust-lang/crates.io-index"
77
- checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
77
+ checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593"
78
78
 
79
79
  [[package]]
80
80
  name = "bzip2"
@@ -98,9 +98,9 @@ dependencies = [
98
98
 
99
99
  [[package]]
100
100
  name = "cc"
101
- version = "1.2.66"
101
+ version = "1.2.65"
102
102
  source = "registry+https://github.com/rust-lang/crates.io-index"
103
- checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996"
103
+ checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96"
104
104
  dependencies = [
105
105
  "find-msvc-tools",
106
106
  "jobserver",
@@ -166,9 +166,9 @@ dependencies = [
166
166
 
167
167
  [[package]]
168
168
  name = "crossbeam-utils"
169
- version = "0.8.22"
169
+ version = "0.8.21"
170
170
  source = "registry+https://github.com/rust-lang/crates.io-index"
171
- checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
171
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
172
172
 
173
173
  [[package]]
174
174
  name = "crypto-common"
@@ -368,13 +368,14 @@ dependencies = [
368
368
 
369
369
  [[package]]
370
370
  name = "getrandom"
371
- version = "0.4.3"
371
+ version = "0.3.4"
372
372
  source = "registry+https://github.com/rust-lang/crates.io-index"
373
- checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
373
+ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
374
374
  dependencies = [
375
375
  "cfg-if",
376
376
  "libc",
377
377
  "r-efi",
378
+ "wasip2",
378
379
  ]
379
380
 
380
381
  [[package]]
@@ -634,11 +635,11 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
634
635
 
635
636
  [[package]]
636
637
  name = "jobserver"
637
- version = "0.1.35"
638
+ version = "0.1.34"
638
639
  source = "registry+https://github.com/rust-lang/crates.io-index"
639
- checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
640
+ checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
640
641
  dependencies = [
641
- "getrandom 0.4.3",
642
+ "getrandom 0.3.4",
642
643
  "libc",
643
644
  ]
644
645
 
@@ -655,7 +656,7 @@ dependencies = [
655
656
 
656
657
  [[package]]
657
658
  name = "kf-sdk"
658
- version = "3.0.2"
659
+ version = "3.0.4"
659
660
  dependencies = [
660
661
  "dirs",
661
662
  "futures-util",
@@ -665,6 +666,7 @@ dependencies = [
665
666
  "serde",
666
667
  "serde_json",
667
668
  "sha1",
669
+ "sha2",
668
670
  "tokio",
669
671
  "tokio-util",
670
672
  "urlencoding",
@@ -711,9 +713,9 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
711
713
 
712
714
  [[package]]
713
715
  name = "memchr"
714
- version = "2.8.3"
716
+ version = "2.8.2"
715
717
  source = "registry+https://github.com/rust-lang/crates.io-index"
716
- checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
718
+ checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4"
717
719
 
718
720
  [[package]]
719
721
  name = "memoffset"
@@ -955,9 +957,9 @@ dependencies = [
955
957
 
956
958
  [[package]]
957
959
  name = "r-efi"
958
- version = "6.0.0"
960
+ version = "5.3.0"
959
961
  source = "registry+https://github.com/rust-lang/crates.io-index"
960
- checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
962
+ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
961
963
 
962
964
  [[package]]
963
965
  name = "rand"
@@ -1100,9 +1102,9 @@ dependencies = [
1100
1102
 
1101
1103
  [[package]]
1102
1104
  name = "rustversion"
1103
- version = "1.0.23"
1105
+ version = "1.0.22"
1104
1106
  source = "registry+https://github.com/rust-lang/crates.io-index"
1105
- checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
1107
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
1106
1108
 
1107
1109
  [[package]]
1108
1110
  name = "ryu"
@@ -1549,6 +1551,15 @@ version = "0.11.1+wasi-snapshot-preview1"
1549
1551
  source = "registry+https://github.com/rust-lang/crates.io-index"
1550
1552
  checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1551
1553
 
1554
+ [[package]]
1555
+ name = "wasip2"
1556
+ version = "1.0.4+wasi-0.2.12"
1557
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1558
+ checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
1559
+ dependencies = [
1560
+ "wit-bindgen",
1561
+ ]
1562
+
1552
1563
  [[package]]
1553
1564
  name = "wasm-bindgen"
1554
1565
  version = "0.2.126"
@@ -1806,6 +1817,12 @@ dependencies = [
1806
1817
  "windows-sys 0.48.0",
1807
1818
  ]
1808
1819
 
1820
+ [[package]]
1821
+ name = "wit-bindgen"
1822
+ version = "0.57.1"
1823
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1824
+ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
1825
+
1809
1826
  [[package]]
1810
1827
  name = "writeable"
1811
1828
  version = "0.6.3"
@@ -1837,18 +1854,18 @@ dependencies = [
1837
1854
 
1838
1855
  [[package]]
1839
1856
  name = "zerocopy"
1840
- version = "0.8.53"
1857
+ version = "0.8.52"
1841
1858
  source = "registry+https://github.com/rust-lang/crates.io-index"
1842
- checksum = "75726053136156d419e285b9b7eddaaea9e3fea6ce32eed44a89901f0bd98de1"
1859
+ checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f"
1843
1860
  dependencies = [
1844
1861
  "zerocopy-derive",
1845
1862
  ]
1846
1863
 
1847
1864
  [[package]]
1848
1865
  name = "zerocopy-derive"
1849
- version = "0.8.53"
1866
+ version = "0.8.52"
1850
1867
  source = "registry+https://github.com/rust-lang/crates.io-index"
1851
- checksum = "4714fd92cf900833d49538023a9b3915155210801d1c1169eba513b2addefd71"
1868
+ checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
1852
1869
  dependencies = [
1853
1870
  "proc-macro2",
1854
1871
  "quote",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "kf-sdk"
3
- version = "3.0.2"
3
+ version = "3.0.4"
4
4
  edition = "2024"
5
5
  description = "Python client SDK for the Kappa-framework ML/AI platform"
6
6
  license = "BSD-3-Clause"
@@ -25,6 +25,7 @@ futures-util = "0.3"
25
25
  dirs = "5.0"
26
26
  rand = "0.8"
27
27
  sha1 = "0.10.6"
28
+ sha2 = "0.10"
28
29
  walkdir = "2"
29
30
  zeroize = { version = "1", features = ["zeroize_derive"] }
30
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kf-sdk
3
- Version: 3.0.2
3
+ Version: 3.0.4
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: Science/Research
@@ -27,8 +27,9 @@ Project-URL: Repository, https://github.com/nsu-ai/kappa
27
27
 
28
28
  [![License BSD 3.0](https://img.shields.io/github/license/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/blob/main/LICENSE.md)
29
29
  ![Python 3.9–3.13](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-green.svg)
30
- [![PyPI Downloads](https://pypi.org/project/kf-sdk/)](https://pypi.org/project/kf-sdk/)
31
- ![Releases](https://img.shields.io/github/release/nsu-ai/kappa.svg)
30
+ [![PyPI version](https://img.shields.io/pypi/v/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
31
+ [![PyPI downloads](https://img.shields.io/pypi/dm/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
32
+ [![GitHub release](https://img.shields.io/github/v/release/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/releases)
32
33
 
33
34
  Python-клиент SDK для **Kappa-framework** — самостоятельно развёртываемой микросервисной платформы для исследовательских ML/AI рабочих процессов.
34
35
 
@@ -38,15 +39,15 @@ Python-клиент SDK для **Kappa-framework** — самостоятель
38
39
 
39
40
  | | |
40
41
  |---|---|
41
- | **Версия** | 3.0.2 |
42
- | **Требует Kappa** | **≥ 2.10.0** (`min_backend_version()`) |
42
+ | **Версия** | 3.0.4 |
43
+ | **Требует Kappa** | **≥ 2.11.0** (`min_backend_version()`) |
43
44
  | **Python** | 3.9+ |
44
45
  | **Rust edition** | 2024 |
45
46
  | **Лицензия** | BSD-3-Clause ([LICENSE.md](LICENSE.md)) |
46
47
 
47
48
  ---
48
49
 
49
- # Каппа — ϰ-фреймворк управления датасетами и моделями, версия 3.0.2
50
+ # Каппа — ϰ-фреймворк управления датасетами и моделями, версия 3.0.4
50
51
 
51
52
  Каппа — набор концептуального и программного обеспечения (фреймворк) для осуществления функций курации датасетов и моделей ([Исследовательский центр](https://nsu.ru/n/ai-center) в сфере искусственного интеллекта по направлению «Строительство и городская среда» НГУ, Новосибирск).
52
53
 
@@ -162,8 +163,8 @@ with KappaApkClient(base_url, "user@example.com", "secret") as client:
162
163
  page = client.list_datasets(size=50)
163
164
  print(page["items"])
164
165
 
165
- # Загрузка архива версии датасета (кэшируется на диске)
166
- info = client.download_dataset_version_archive(
166
+ # Загрузка версии датасета (шардированный пакет, кэшируется на диске)
167
+ info = client.download_dataset_version_package(
167
168
  dataset_id=582,
168
169
  version_no="1.0.0",
169
170
  )
@@ -2,8 +2,9 @@
2
2
 
3
3
  [![License BSD 3.0](https://img.shields.io/github/license/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/blob/main/LICENSE.md)
4
4
  ![Python 3.9–3.13](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-green.svg)
5
- [![PyPI Downloads](https://pypi.org/project/kf-sdk/)](https://pypi.org/project/kf-sdk/)
6
- ![Releases](https://img.shields.io/github/release/nsu-ai/kappa.svg)
5
+ [![PyPI version](https://img.shields.io/pypi/v/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
6
+ [![PyPI downloads](https://img.shields.io/pypi/dm/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
7
+ [![GitHub release](https://img.shields.io/github/v/release/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/releases)
7
8
 
8
9
  Python client SDK for **Kappa-framework** — a self-hosted microservices platform for ML/AI research workflows.
9
10
 
@@ -13,15 +14,15 @@ Built with Rust + [PyO3](https://pyo3.rs). **PyPI:** `kf-sdk` · **import:** `im
13
14
 
14
15
  | | |
15
16
  |---|---|
16
- | **Version** | 3.0.2 |
17
- | **Requires Kappa** | **≥ 2.10.0** (`min_backend_version()`) |
17
+ | **Version** | 3.0.4 |
18
+ | **Requires Kappa** | **≥ 2.11.0** (`min_backend_version()`) |
18
19
  | **Python** | 3.9+ |
19
20
  | **Rust edition** | 2024 |
20
21
  | **License** | BSD-3-Clause ([LICENSE.md](LICENSE.md)) |
21
22
 
22
23
  ---
23
24
 
24
- # Kappa — ϰ-framework for dataset and model management, version 3.0.2
25
+ # Kappa — ϰ-framework for dataset and model management, version 3.0.4
25
26
 
26
27
  Kappa is a conceptual and software framework for dataset curation and model lifecycle management, developed at the [AI Research Center](https://nsu.ru/n/ai-center) for Construction and Urban Environment, Novosibirsk State University.
27
28
 
@@ -137,8 +138,8 @@ with KappaApkClient(base_url, "user@example.com", "secret") as client:
137
138
  page = client.list_datasets(size=50)
138
139
  print(page["items"])
139
140
 
140
- # Download a dataset version archive (cached on disk)
141
- info = client.download_dataset_version_archive(
141
+ # Download a dataset version (sharded package, cached on disk)
142
+ info = client.download_dataset_version_package(
142
143
  dataset_id=582,
143
144
  version_no="1.0.0",
144
145
  )
@@ -2,8 +2,9 @@
2
2
 
3
3
  [![License BSD 3.0](https://img.shields.io/github/license/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/blob/main/LICENSE.md)
4
4
  ![Python 3.9–3.13](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-green.svg)
5
- [![PyPI Downloads](https://pypi.org/project/kf-sdk/)](https://pypi.org/project/kf-sdk/)
6
- ![Releases](https://img.shields.io/github/release/nsu-ai/kappa.svg)
5
+ [![PyPI version](https://img.shields.io/pypi/v/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
6
+ [![PyPI downloads](https://img.shields.io/pypi/dm/kf-sdk.svg)](https://pypi.org/project/kf-sdk/)
7
+ [![GitHub release](https://img.shields.io/github/v/release/nsu-ai/kappa.svg)](https://github.com/nsu-ai/kappa/releases)
7
8
 
8
9
  Python-клиент SDK для **Kappa-framework** — самостоятельно развёртываемой микросервисной платформы для исследовательских ML/AI рабочих процессов.
9
10
 
@@ -13,15 +14,15 @@ Python-клиент SDK для **Kappa-framework** — самостоятель
13
14
 
14
15
  | | |
15
16
  |---|---|
16
- | **Версия** | 3.0.2 |
17
- | **Требует Kappa** | **≥ 2.10.0** (`min_backend_version()`) |
17
+ | **Версия** | 3.0.4 |
18
+ | **Требует Kappa** | **≥ 2.11.0** (`min_backend_version()`) |
18
19
  | **Python** | 3.9+ |
19
20
  | **Rust edition** | 2024 |
20
21
  | **Лицензия** | BSD-3-Clause ([LICENSE.md](LICENSE.md)) |
21
22
 
22
23
  ---
23
24
 
24
- # Каппа — ϰ-фреймворк управления датасетами и моделями, версия 3.0.2
25
+ # Каппа — ϰ-фреймворк управления датасетами и моделями, версия 3.0.4
25
26
 
26
27
  Каппа — набор концептуального и программного обеспечения (фреймворк) для осуществления функций курации датасетов и моделей ([Исследовательский центр](https://nsu.ru/n/ai-center) в сфере искусственного интеллекта по направлению «Строительство и городская среда» НГУ, Новосибирск).
27
28
 
@@ -137,8 +138,8 @@ with KappaApkClient(base_url, "user@example.com", "secret") as client:
137
138
  page = client.list_datasets(size=50)
138
139
  print(page["items"])
139
140
 
140
- # Загрузка архива версии датасета (кэшируется на диске)
141
- info = client.download_dataset_version_archive(
141
+ # Загрузка версии датасета (шардированный пакет, кэшируется на диске)
142
+ info = client.download_dataset_version_package(
142
143
  dataset_id=582,
143
144
  version_no="1.0.0",
144
145
  )
@@ -66,7 +66,7 @@ python3 code_examples/http_client_authentication_example.py
66
66
 
67
67
  ### `bulk_upload.py`
68
68
 
69
- **Purpose**: Async bulk entity upload (CSV ≤ 2 GB client / BE default 50 MB, or zip ≤ 50 GB) with transfer % and job polling (`BulkUploadJob`). Requires Kappa-framework **≥ 2.10.0**.
69
+ **Purpose**: Async bulk entity upload (CSV ≤ 2 GB client / BE default 50 MB, or zip ≤ 50 GB) with transfer % and job polling (`BulkUploadJob`). Requires Kappa-framework **≥ 2.11.0**.
70
70
 
71
71
  Archive `input_output` needs `dataset_schema.inputDataPath` (use `--input-data-path`).
72
72
 
@@ -79,6 +79,27 @@ python code_examples/bulk_upload.py --dataset-id 42 --file ./data.zip \
79
79
  --upload-type archive --archive-layout input_output --input-data-path input
80
80
  ```
81
81
 
82
+ ### `bulk_mutation_and_version_build.py`
83
+
84
+ **Purpose**: Async bulk mutations (mark-labeled / self-verify / auto-verify) and version archive builds (create → wait → publish / package download). Requires Kappa-framework **≥ 2.11.0**.
85
+
86
+ ```bash
87
+ python code_examples/bulk_mutation_and_version_build.py --dataset-id 42 --mark-labeled-all
88
+ python code_examples/bulk_mutation_and_version_build.py --dataset-id 42 --create-version --download-package
89
+ ```
90
+
91
+ ### `benchmark_and_model_artifacts.py`
92
+
93
+ **Purpose**: Benchmark evaluation-set download (package → benchmark proxy → legacy zip), submitting predictions with artifact upload and inference linking, report PDF download, schema-driven `write_model_inference()`, and artifact upload/download including the resumable multipart session used for large weights. Requires Kappa-framework **≥ 2.11.0**.
94
+
95
+ ```bash
96
+ python code_examples/benchmark_and_model_artifacts.py --benchmark-id <uuid> --run --model-path ./model
97
+ python code_examples/benchmark_and_model_artifacts.py --benchmark-id <uuid> --report report.pdf --report-lang ru
98
+ python code_examples/benchmark_and_model_artifacts.py --model-id <uuid> --write-inference --model-path ./model
99
+ python code_examples/benchmark_and_model_artifacts.py --model-id <uuid> --inference-id 12 \
100
+ --upload ./llm-70b --file-category 3 --download-artifacts ./artifacts
101
+ ```
102
+
82
103
  ### `dataset_operations_example.py`
83
104
 
84
105
  **Purpose**: End-to-end dataset scripting flow — create/lookup dataset, labels, single entity (`file_category` + `split`), filter, version, optional publish, RBAC check.
@@ -0,0 +1,208 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright 2026 Kappa-Apk @nsu.ru
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ """Benchmark run + model artifact example (Kappa-framework ≥ 2.11.0).
5
+
6
+ Demonstrates:
7
+
8
+ 1. Benchmark lookup and evaluation-set download (package → proxy → legacy zip)
9
+ 2. Submitting predictions, uploading the model files, and linking the inference
10
+ 3. Report metadata + PDF download
11
+ 4. Writing an inference straight from predictions with ``write_model_inference``
12
+ 5. Artifact upload (large files switch to a resumable multipart session) and package download
13
+
14
+ Usage::
15
+
16
+ export KAPPA_URL=http://127.0.0.1:8060
17
+ export KAPPA_USER=admin
18
+ export KAPPA_PASSWORD='***'
19
+ python code_examples/benchmark_and_model_artifacts.py --benchmark-id <uuid> --run \
20
+ --model-path ./model
21
+ python code_examples/benchmark_and_model_artifacts.py --benchmark-id <uuid> --report report.pdf
22
+ python code_examples/benchmark_and_model_artifacts.py --model-id <uuid> \
23
+ --write-inference --model-path ./model
24
+ python code_examples/benchmark_and_model_artifacts.py \
25
+ --model-id <uuid> --inference-id 12 --upload ./llm-70b --file-category 3
26
+ """
27
+
28
+ from __future__ import annotations
29
+
30
+ import argparse
31
+ import os
32
+ from typing import Any, Optional
33
+
34
+ from kappa_apk import KappaApkClient, min_backend_version, version
35
+
36
+
37
+ def _env(name: str) -> str:
38
+ value = os.environ.get(name, "").strip()
39
+ if not value:
40
+ raise SystemExit(f"Set environment variable {name}")
41
+ return value
42
+
43
+
44
+ def on_file_progress(name: str, sent: int, total: int, percent: int) -> None:
45
+ print(f" {name}: {percent}% ({sent}/{total} bytes)")
46
+
47
+
48
+ def run_benchmark(
49
+ client: KappaApkClient,
50
+ benchmark_id: str,
51
+ model_path: Optional[str],
52
+ ) -> None:
53
+ detail = client.get_benchmark(benchmark_id)
54
+ print(
55
+ "benchmark", benchmark_id,
56
+ "| status", detail.get("benchmarkStatus"),
57
+ "| dataset", detail.get("datasetId"), detail.get("datasetVersionNo"),
58
+ )
59
+
60
+ bm = client.load_benchmark(benchmark_id)
61
+ try:
62
+ data = bm.dataset()
63
+ except RuntimeError as exc:
64
+ # The version archive build has not reached buildStatus=ready yet.
65
+ print("evaluation set not ready:", exc)
66
+ return
67
+ except PermissionError as exc:
68
+ print("download not permitted (approval may be pending):", exc)
69
+ return
70
+ print("loaded", len(data), "samples")
71
+
72
+ predictions = [
73
+ {"entity_id": item.entity_id, "original": item.annotations,
74
+ "predicted": {"class_name": "unknown", "confidence": 0.0}}
75
+ for item in data
76
+ ]
77
+ bm.save_benchmark(predictions, {"accuracy": 0.0}, model_path=model_path)
78
+ # complete_inference (default) also links the inference to the benchmark,
79
+ # which is what moves it from Pending Inference to Inference Completed.
80
+ # The link needs a model version: pass model_version_id, or let create_version
81
+ # (default) version the inference that was just written.
82
+ # upload_artifacts stores the files under model_path on that inference.
83
+ response = bm.submit_benchmark(
84
+ strict=False,
85
+ upload_artifacts=bool(model_path),
86
+ on_progress=on_file_progress,
87
+ )
88
+ print("submitted:", response)
89
+
90
+
91
+ def write_inference(
92
+ client: KappaApkClient,
93
+ model_id: str,
94
+ model_path: Optional[str],
95
+ ) -> None:
96
+ """One call: shape the result per the model's schema, validate, create, upload."""
97
+ schema = client.get_model_inference_schema(model_id)
98
+ print("effective schema:", schema.get("source"), schema.get("kind"))
99
+
100
+ written = client.write_model_inference(
101
+ model_id,
102
+ predictions=[
103
+ {"entityId": "sample-1", "predicted": {"class_name": "pizza", "confidence": 0.98}},
104
+ # A bare label works too — it is wrapped into the key the schema requires.
105
+ {"entityId": "sample-2", "predicted": "sushi"},
106
+ ],
107
+ metrics={"accuracy": 0.93},
108
+ artifacts=[model_path] if model_path else None,
109
+ on_progress=on_file_progress,
110
+ )
111
+ print("inference", written["inferenceId"], "artifacts:", len(written["artifacts"]))
112
+
113
+
114
+ def show_report(client: KappaApkClient, benchmark_id: str, dest_path: str, lang: str) -> None:
115
+ report = client.get_benchmark_report(benchmark_id)
116
+ print("report:", report)
117
+ path = client.download_benchmark_report(benchmark_id, dest_path, lang=lang)
118
+ print("report written to", path)
119
+
120
+
121
+ def upload_artifact(
122
+ client: KappaApkClient,
123
+ model_id: str,
124
+ inference_id: int,
125
+ path: str,
126
+ file_category: Optional[int],
127
+ ) -> None:
128
+ """Upload a file or a whole directory of weight shards.
129
+
130
+ Each file picks its own transport: the plain upload for sidecars, a resumable
131
+ multipart session past the server's sync cap. Re-running skips what is already
132
+ attached, so an interrupted 100 GB upload can simply be started again.
133
+ """
134
+ print(f"uploading {path}")
135
+ results: list[dict[str, Any]] = client.upload_model_artifacts(
136
+ model_id, inference_id, path,
137
+ file_category=file_category,
138
+ on_progress=on_file_progress,
139
+ )
140
+ for item in results:
141
+ print(f" {item['fileName']}: {item['transport']} ({item['bytes']} bytes)")
142
+
143
+
144
+ def download_artifacts(
145
+ client: KappaApkClient,
146
+ model_id: str,
147
+ inference_id: int,
148
+ dest_dir: str,
149
+ ) -> None:
150
+ manifest = client.get_model_inference_artifacts_package(model_id, inference_id)
151
+ print(
152
+ "artifacts:", manifest.get("fileCount"),
153
+ "files,", manifest.get("totalBytes"), "bytes",
154
+ )
155
+ paths = client.download_model_inference_artifacts_package(
156
+ model_id, inference_id, dest_dir,
157
+ )
158
+ for path in paths:
159
+ print(" ", path)
160
+
161
+
162
+ def main() -> int:
163
+ parser = argparse.ArgumentParser(description=__doc__)
164
+ parser.add_argument("--benchmark-id")
165
+ parser.add_argument("--run", action="store_true", help="download set, submit predictions")
166
+ parser.add_argument("--report", help="write the benchmark report PDF to this path")
167
+ parser.add_argument("--report-lang", default="en", choices=["en", "ru"])
168
+ parser.add_argument("--model-id")
169
+ parser.add_argument("--inference-id", type=int)
170
+ parser.add_argument("--model-path", help="directory with the model files to upload")
171
+ parser.add_argument(
172
+ "--write-inference",
173
+ action="store_true",
174
+ help="write an inference (and --model-path artifacts) for --model-id",
175
+ )
176
+ parser.add_argument("--upload", help="artifact file or directory to upload")
177
+ parser.add_argument("--file-category", type=int, help="1 Training 2 Inference 3 Model 4 Data 5 Other")
178
+ parser.add_argument("--download-artifacts", help="directory for per-file artifact download")
179
+ args = parser.parse_args()
180
+
181
+ print("SDK", version(), "| min backend", min_backend_version())
182
+
183
+ client = KappaApkClient(_env("KAPPA_URL"), _env("KAPPA_USER"), _env("KAPPA_PASSWORD"))
184
+ client.connect()
185
+ try:
186
+ if args.benchmark_id and args.run:
187
+ run_benchmark(client, args.benchmark_id, args.model_path)
188
+ if args.benchmark_id and args.report:
189
+ show_report(client, args.benchmark_id, args.report, args.report_lang)
190
+ if args.model_id and args.write_inference:
191
+ write_inference(client, args.model_id, args.model_path)
192
+
193
+ artifacts_target = args.model_id and args.inference_id is not None
194
+ if artifacts_target and args.upload:
195
+ upload_artifact(
196
+ client, args.model_id, args.inference_id, args.upload, args.file_category,
197
+ )
198
+ if artifacts_target and args.download_artifacts:
199
+ download_artifacts(
200
+ client, args.model_id, args.inference_id, args.download_artifacts,
201
+ )
202
+ finally:
203
+ client.close()
204
+ return 0
205
+
206
+
207
+ if __name__ == "__main__":
208
+ raise SystemExit(main())