llm-batch-py 0.1.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.
- llm_batch_py-0.1.0/.gitattributes +2 -0
- llm_batch_py-0.1.0/.github/workflows/ci.yml +61 -0
- llm_batch_py-0.1.0/.github/workflows/publish.yml +205 -0
- llm_batch_py-0.1.0/.gitignore +14 -0
- llm_batch_py-0.1.0/.python-version +1 -0
- llm_batch_py-0.1.0/Cargo.lock +313 -0
- llm_batch_py-0.1.0/Cargo.toml +14 -0
- llm_batch_py-0.1.0/LICENSE +21 -0
- llm_batch_py-0.1.0/PKG-INFO +324 -0
- llm_batch_py-0.1.0/README.md +306 -0
- llm_batch_py-0.1.0/docs/batching.md +83 -0
- llm_batch_py-0.1.0/docs/locking.md +85 -0
- llm_batch_py-0.1.0/docs/prompt-building.md +166 -0
- llm_batch_py-0.1.0/docs/prompt-caching.md +159 -0
- llm_batch_py-0.1.0/docs/provider-configs.md +172 -0
- llm_batch_py-0.1.0/docs/result-cache.md +222 -0
- llm_batch_py-0.1.0/docs/streaming.md +177 -0
- llm_batch_py-0.1.0/pyproject.toml +51 -0
- llm_batch_py-0.1.0/scripts/benchmark_runner_perf.py +197 -0
- llm_batch_py-0.1.0/src/lib.rs +444 -0
- llm_batch_py-0.1.0/src/llm_batch_py/__init__.py +47 -0
- llm_batch_py-0.1.0/src/llm_batch_py/_core_wrapper.py +29 -0
- llm_batch_py-0.1.0/src/llm_batch_py/_py_core.py +174 -0
- llm_batch_py-0.1.0/src/llm_batch_py/catalog.py +225 -0
- llm_batch_py-0.1.0/src/llm_batch_py/jobs.py +334 -0
- llm_batch_py-0.1.0/src/llm_batch_py/pricing.py +19 -0
- llm_batch_py-0.1.0/src/llm_batch_py/prompt_cache.py +156 -0
- llm_batch_py-0.1.0/src/llm_batch_py/prompting.py +189 -0
- llm_batch_py-0.1.0/src/llm_batch_py/providers/__init__.py +4 -0
- llm_batch_py-0.1.0/src/llm_batch_py/providers/anthropic.py +312 -0
- llm_batch_py-0.1.0/src/llm_batch_py/providers/base.py +117 -0
- llm_batch_py-0.1.0/src/llm_batch_py/providers/openai.py +309 -0
- llm_batch_py-0.1.0/src/llm_batch_py/runner.py +1666 -0
- llm_batch_py-0.1.0/src/llm_batch_py/token_estimation.py +113 -0
- llm_batch_py-0.1.0/tests/__init__.py +0 -0
- llm_batch_py-0.1.0/tests/conftest.py +241 -0
- llm_batch_py-0.1.0/tests/fakes.py +3 -0
- llm_batch_py-0.1.0/tests/test_catalog.py +188 -0
- llm_batch_py-0.1.0/tests/test_core.py +29 -0
- llm_batch_py-0.1.0/tests/test_prompting.py +266 -0
- llm_batch_py-0.1.0/tests/test_providers.py +707 -0
- llm_batch_py-0.1.0/tests/test_runner.py +1228 -0
- llm_batch_py-0.1.0/tests/test_token_estimation.py +80 -0
- llm_batch_py-0.1.0/uv.lock +1958 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Check out repository
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Set up Rust
|
|
23
|
+
uses: dtolnay/rust-toolchain@stable
|
|
24
|
+
|
|
25
|
+
- name: Install tooling
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
python -m pip install "maturin==1.8.2" ruff pytest pytest-mock
|
|
29
|
+
|
|
30
|
+
- name: Run Ruff
|
|
31
|
+
run: python -m ruff check .
|
|
32
|
+
|
|
33
|
+
test:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
strategy:
|
|
36
|
+
fail-fast: false
|
|
37
|
+
matrix:
|
|
38
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Check out repository
|
|
42
|
+
uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v5
|
|
46
|
+
with:
|
|
47
|
+
python-version: ${{ matrix.python-version }}
|
|
48
|
+
|
|
49
|
+
- name: Set up Rust
|
|
50
|
+
uses: dtolnay/rust-toolchain@stable
|
|
51
|
+
|
|
52
|
+
- name: Install tooling
|
|
53
|
+
run: |
|
|
54
|
+
python -m pip install --upgrade pip
|
|
55
|
+
python -m pip install "maturin==1.8.2" pytest pytest-mock
|
|
56
|
+
|
|
57
|
+
- name: Build extension into environment
|
|
58
|
+
run: python -m pip install --no-build-isolation .
|
|
59
|
+
|
|
60
|
+
- name: Run tests
|
|
61
|
+
run: python -m pytest
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
validate-release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
outputs:
|
|
12
|
+
version: ${{ steps.version.outputs.version }}
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
|
|
23
|
+
- name: Validate tag matches package versions
|
|
24
|
+
id: version
|
|
25
|
+
shell: bash
|
|
26
|
+
run: |
|
|
27
|
+
set -euo pipefail
|
|
28
|
+
tag="${GITHUB_REF_NAME}"
|
|
29
|
+
version="${tag#v}"
|
|
30
|
+
|
|
31
|
+
pyproject_version="$(python - <<'PY'
|
|
32
|
+
import tomllib
|
|
33
|
+
with open("pyproject.toml", "rb") as f:
|
|
34
|
+
print(tomllib.load(f)["project"]["version"])
|
|
35
|
+
PY
|
|
36
|
+
)"
|
|
37
|
+
cargo_version="$(python - <<'PY'
|
|
38
|
+
import tomllib
|
|
39
|
+
with open("Cargo.toml", "rb") as f:
|
|
40
|
+
print(tomllib.load(f)["package"]["version"])
|
|
41
|
+
PY
|
|
42
|
+
)"
|
|
43
|
+
|
|
44
|
+
if [[ "${tag}" != v* ]]; then
|
|
45
|
+
echo "Tag must start with v, got: ${tag}" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if [[ "${version}" != "${pyproject_version}" ]]; then
|
|
50
|
+
echo "Tag version ${version} does not match pyproject.toml version ${pyproject_version}" >&2
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
if [[ "${version}" != "${cargo_version}" ]]; then
|
|
55
|
+
echo "Tag version ${version} does not match Cargo.toml version ${cargo_version}" >&2
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
echo "version=${version}" >> "${GITHUB_OUTPUT}"
|
|
60
|
+
|
|
61
|
+
build-wheels:
|
|
62
|
+
needs: validate-release
|
|
63
|
+
runs-on: ${{ matrix.os }}
|
|
64
|
+
strategy:
|
|
65
|
+
fail-fast: false
|
|
66
|
+
matrix:
|
|
67
|
+
include:
|
|
68
|
+
- os: ubuntu-latest
|
|
69
|
+
target: x86_64-unknown-linux-gnu
|
|
70
|
+
python-version: "3.10"
|
|
71
|
+
manylinux: "2014"
|
|
72
|
+
- os: ubuntu-latest
|
|
73
|
+
target: x86_64-unknown-linux-gnu
|
|
74
|
+
python-version: "3.11"
|
|
75
|
+
manylinux: "2014"
|
|
76
|
+
- os: ubuntu-latest
|
|
77
|
+
target: x86_64-unknown-linux-gnu
|
|
78
|
+
python-version: "3.12"
|
|
79
|
+
manylinux: "2014"
|
|
80
|
+
- os: ubuntu-latest
|
|
81
|
+
target: x86_64-unknown-linux-gnu
|
|
82
|
+
python-version: "3.13"
|
|
83
|
+
manylinux: "2014"
|
|
84
|
+
- os: windows-latest
|
|
85
|
+
target: x86_64-pc-windows-msvc
|
|
86
|
+
python-version: "3.10"
|
|
87
|
+
- os: windows-latest
|
|
88
|
+
target: x86_64-pc-windows-msvc
|
|
89
|
+
python-version: "3.11"
|
|
90
|
+
- os: windows-latest
|
|
91
|
+
target: x86_64-pc-windows-msvc
|
|
92
|
+
python-version: "3.12"
|
|
93
|
+
- os: windows-latest
|
|
94
|
+
target: x86_64-pc-windows-msvc
|
|
95
|
+
python-version: "3.13"
|
|
96
|
+
- os: macos-15-intel
|
|
97
|
+
target: x86_64-apple-darwin
|
|
98
|
+
python-version: "3.10"
|
|
99
|
+
- os: macos-15-intel
|
|
100
|
+
target: x86_64-apple-darwin
|
|
101
|
+
python-version: "3.11"
|
|
102
|
+
- os: macos-15-intel
|
|
103
|
+
target: x86_64-apple-darwin
|
|
104
|
+
python-version: "3.12"
|
|
105
|
+
- os: macos-15-intel
|
|
106
|
+
target: x86_64-apple-darwin
|
|
107
|
+
python-version: "3.13"
|
|
108
|
+
- os: macos-15
|
|
109
|
+
target: aarch64-apple-darwin
|
|
110
|
+
python-version: "3.10"
|
|
111
|
+
- os: macos-15
|
|
112
|
+
target: aarch64-apple-darwin
|
|
113
|
+
python-version: "3.11"
|
|
114
|
+
- os: macos-15
|
|
115
|
+
target: aarch64-apple-darwin
|
|
116
|
+
python-version: "3.12"
|
|
117
|
+
- os: macos-15
|
|
118
|
+
target: aarch64-apple-darwin
|
|
119
|
+
python-version: "3.13"
|
|
120
|
+
|
|
121
|
+
steps:
|
|
122
|
+
- name: Check out repository
|
|
123
|
+
uses: actions/checkout@v4
|
|
124
|
+
|
|
125
|
+
- name: Set up Python
|
|
126
|
+
uses: actions/setup-python@v5
|
|
127
|
+
with:
|
|
128
|
+
python-version: ${{ matrix.python-version }}
|
|
129
|
+
|
|
130
|
+
- name: Build Linux wheels
|
|
131
|
+
if: startsWith(matrix.os, 'ubuntu-')
|
|
132
|
+
uses: PyO3/maturin-action@v1
|
|
133
|
+
with:
|
|
134
|
+
target: ${{ matrix.target }}
|
|
135
|
+
manylinux: ${{ matrix.manylinux }}
|
|
136
|
+
maturin-version: "1.12.6"
|
|
137
|
+
args: >-
|
|
138
|
+
--release
|
|
139
|
+
--out dist
|
|
140
|
+
--compatibility pypi
|
|
141
|
+
-i python${{ matrix.python-version }}
|
|
142
|
+
|
|
143
|
+
- name: Build non-Linux wheels
|
|
144
|
+
if: ${{ !startsWith(matrix.os, 'ubuntu-') }}
|
|
145
|
+
uses: PyO3/maturin-action@v1
|
|
146
|
+
with:
|
|
147
|
+
target: ${{ matrix.target }}
|
|
148
|
+
maturin-version: "1.12.6"
|
|
149
|
+
args: >-
|
|
150
|
+
--release
|
|
151
|
+
--out dist
|
|
152
|
+
-i python
|
|
153
|
+
|
|
154
|
+
- name: Upload wheel artifacts
|
|
155
|
+
uses: actions/upload-artifact@v4
|
|
156
|
+
with:
|
|
157
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}-py${{ matrix.python-version }}
|
|
158
|
+
path: dist/*
|
|
159
|
+
|
|
160
|
+
build-sdist:
|
|
161
|
+
needs: validate-release
|
|
162
|
+
runs-on: ubuntu-latest
|
|
163
|
+
|
|
164
|
+
steps:
|
|
165
|
+
- name: Check out repository
|
|
166
|
+
uses: actions/checkout@v4
|
|
167
|
+
|
|
168
|
+
- name: Set up Python
|
|
169
|
+
uses: actions/setup-python@v5
|
|
170
|
+
with:
|
|
171
|
+
python-version: "3.12"
|
|
172
|
+
|
|
173
|
+
- name: Install maturin
|
|
174
|
+
run: |
|
|
175
|
+
python -m pip install --upgrade pip
|
|
176
|
+
python -m pip install "maturin==1.12.6"
|
|
177
|
+
|
|
178
|
+
- name: Build source distribution
|
|
179
|
+
run: python -m maturin sdist --out dist
|
|
180
|
+
|
|
181
|
+
- name: Upload sdist artifact
|
|
182
|
+
uses: actions/upload-artifact@v4
|
|
183
|
+
with:
|
|
184
|
+
name: sdist
|
|
185
|
+
path: dist/*
|
|
186
|
+
|
|
187
|
+
publish:
|
|
188
|
+
needs:
|
|
189
|
+
- validate-release
|
|
190
|
+
- build-wheels
|
|
191
|
+
- build-sdist
|
|
192
|
+
runs-on: ubuntu-latest
|
|
193
|
+
environment: pypi
|
|
194
|
+
permissions:
|
|
195
|
+
id-token: write
|
|
196
|
+
|
|
197
|
+
steps:
|
|
198
|
+
- name: Download release artifacts
|
|
199
|
+
uses: actions/download-artifact@v4
|
|
200
|
+
with:
|
|
201
|
+
path: dist
|
|
202
|
+
merge-multiple: true
|
|
203
|
+
|
|
204
|
+
- name: Publish to PyPI
|
|
205
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "block-buffer"
|
|
13
|
+
version = "0.10.4"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"generic-array",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "cfg-if"
|
|
22
|
+
version = "1.0.4"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "cpufeatures"
|
|
28
|
+
version = "0.2.17"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"libc",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "crypto-common"
|
|
37
|
+
version = "0.1.7"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"generic-array",
|
|
42
|
+
"typenum",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[[package]]
|
|
46
|
+
name = "digest"
|
|
47
|
+
version = "0.10.7"
|
|
48
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
49
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
50
|
+
dependencies = [
|
|
51
|
+
"block-buffer",
|
|
52
|
+
"crypto-common",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "generic-array"
|
|
57
|
+
version = "0.14.7"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
60
|
+
dependencies = [
|
|
61
|
+
"typenum",
|
|
62
|
+
"version_check",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "heck"
|
|
67
|
+
version = "0.5.0"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "indoc"
|
|
73
|
+
version = "2.0.7"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
76
|
+
dependencies = [
|
|
77
|
+
"rustversion",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "itoa"
|
|
82
|
+
version = "1.0.17"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
|
85
|
+
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "libc"
|
|
88
|
+
version = "0.2.183"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
|
|
91
|
+
|
|
92
|
+
[[package]]
|
|
93
|
+
name = "llm-batch-py-core"
|
|
94
|
+
version = "0.1.0"
|
|
95
|
+
dependencies = [
|
|
96
|
+
"pyo3",
|
|
97
|
+
"serde_json",
|
|
98
|
+
"sha2",
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
[[package]]
|
|
102
|
+
name = "memchr"
|
|
103
|
+
version = "2.8.0"
|
|
104
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
106
|
+
|
|
107
|
+
[[package]]
|
|
108
|
+
name = "memoffset"
|
|
109
|
+
version = "0.9.1"
|
|
110
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
111
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
112
|
+
dependencies = [
|
|
113
|
+
"autocfg",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "once_cell"
|
|
118
|
+
version = "1.21.3"
|
|
119
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
121
|
+
|
|
122
|
+
[[package]]
|
|
123
|
+
name = "portable-atomic"
|
|
124
|
+
version = "1.13.1"
|
|
125
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
126
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
127
|
+
|
|
128
|
+
[[package]]
|
|
129
|
+
name = "proc-macro2"
|
|
130
|
+
version = "1.0.106"
|
|
131
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
133
|
+
dependencies = [
|
|
134
|
+
"unicode-ident",
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "pyo3"
|
|
139
|
+
version = "0.23.5"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
|
|
142
|
+
dependencies = [
|
|
143
|
+
"cfg-if",
|
|
144
|
+
"indoc",
|
|
145
|
+
"libc",
|
|
146
|
+
"memoffset",
|
|
147
|
+
"once_cell",
|
|
148
|
+
"portable-atomic",
|
|
149
|
+
"pyo3-build-config",
|
|
150
|
+
"pyo3-ffi",
|
|
151
|
+
"pyo3-macros",
|
|
152
|
+
"unindent",
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
[[package]]
|
|
156
|
+
name = "pyo3-build-config"
|
|
157
|
+
version = "0.23.5"
|
|
158
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
159
|
+
checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
|
|
160
|
+
dependencies = [
|
|
161
|
+
"once_cell",
|
|
162
|
+
"target-lexicon",
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
[[package]]
|
|
166
|
+
name = "pyo3-ffi"
|
|
167
|
+
version = "0.23.5"
|
|
168
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
169
|
+
checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
|
|
170
|
+
dependencies = [
|
|
171
|
+
"libc",
|
|
172
|
+
"pyo3-build-config",
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
[[package]]
|
|
176
|
+
name = "pyo3-macros"
|
|
177
|
+
version = "0.23.5"
|
|
178
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
179
|
+
checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
|
|
180
|
+
dependencies = [
|
|
181
|
+
"proc-macro2",
|
|
182
|
+
"pyo3-macros-backend",
|
|
183
|
+
"quote",
|
|
184
|
+
"syn",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "pyo3-macros-backend"
|
|
189
|
+
version = "0.23.5"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
|
|
192
|
+
dependencies = [
|
|
193
|
+
"heck",
|
|
194
|
+
"proc-macro2",
|
|
195
|
+
"pyo3-build-config",
|
|
196
|
+
"quote",
|
|
197
|
+
"syn",
|
|
198
|
+
]
|
|
199
|
+
|
|
200
|
+
[[package]]
|
|
201
|
+
name = "quote"
|
|
202
|
+
version = "1.0.45"
|
|
203
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
204
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
205
|
+
dependencies = [
|
|
206
|
+
"proc-macro2",
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
[[package]]
|
|
210
|
+
name = "rustversion"
|
|
211
|
+
version = "1.0.22"
|
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
213
|
+
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "serde"
|
|
217
|
+
version = "1.0.228"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
220
|
+
dependencies = [
|
|
221
|
+
"serde_core",
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "serde_core"
|
|
226
|
+
version = "1.0.228"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
229
|
+
dependencies = [
|
|
230
|
+
"serde_derive",
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
[[package]]
|
|
234
|
+
name = "serde_derive"
|
|
235
|
+
version = "1.0.228"
|
|
236
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
237
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
238
|
+
dependencies = [
|
|
239
|
+
"proc-macro2",
|
|
240
|
+
"quote",
|
|
241
|
+
"syn",
|
|
242
|
+
]
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "serde_json"
|
|
246
|
+
version = "1.0.149"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
249
|
+
dependencies = [
|
|
250
|
+
"itoa",
|
|
251
|
+
"memchr",
|
|
252
|
+
"serde",
|
|
253
|
+
"serde_core",
|
|
254
|
+
"zmij",
|
|
255
|
+
]
|
|
256
|
+
|
|
257
|
+
[[package]]
|
|
258
|
+
name = "sha2"
|
|
259
|
+
version = "0.10.9"
|
|
260
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
262
|
+
dependencies = [
|
|
263
|
+
"cfg-if",
|
|
264
|
+
"cpufeatures",
|
|
265
|
+
"digest",
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
[[package]]
|
|
269
|
+
name = "syn"
|
|
270
|
+
version = "2.0.117"
|
|
271
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
272
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
273
|
+
dependencies = [
|
|
274
|
+
"proc-macro2",
|
|
275
|
+
"quote",
|
|
276
|
+
"unicode-ident",
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "target-lexicon"
|
|
281
|
+
version = "0.12.16"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
284
|
+
|
|
285
|
+
[[package]]
|
|
286
|
+
name = "typenum"
|
|
287
|
+
version = "1.19.0"
|
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
+
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
|
|
290
|
+
|
|
291
|
+
[[package]]
|
|
292
|
+
name = "unicode-ident"
|
|
293
|
+
version = "1.0.24"
|
|
294
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
295
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
296
|
+
|
|
297
|
+
[[package]]
|
|
298
|
+
name = "unindent"
|
|
299
|
+
version = "0.2.4"
|
|
300
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
301
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
302
|
+
|
|
303
|
+
[[package]]
|
|
304
|
+
name = "version_check"
|
|
305
|
+
version = "0.9.5"
|
|
306
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
307
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
308
|
+
|
|
309
|
+
[[package]]
|
|
310
|
+
name = "zmij"
|
|
311
|
+
version = "1.0.21"
|
|
312
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
313
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "llm-batch-py-core"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
name = "llm_batch_py_core"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = { version = "0.23.5", features = ["extension-module"] }
|
|
13
|
+
serde_json = "1.0.140"
|
|
14
|
+
sha2 = "0.10.8"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Zhang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|