seldon-runtime 0.1.1.dev2__tar.gz → 0.1.1.dev3__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 (70) hide show
  1. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/CHANGELOG.md +29 -1
  2. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/PKG-INFO +48 -28
  3. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/README.md +47 -27
  4. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/pyproject.toml +1 -1
  5. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/runtime_modules.txt +2 -0
  6. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/schemas/compiler-artifact-v1.json +64 -3
  7. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/__init__.py +1 -1
  8. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/artifact.py +53 -14
  9. seldon_runtime-0.1.1.dev3/seldon_runtime/native_adapter.py +160 -0
  10. seldon_runtime-0.1.1.dev3/seldon_runtime/system_one.py +180 -0
  11. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime.egg-info/PKG-INFO +48 -28
  12. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime.egg-info/SOURCES.txt +3 -0
  13. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_artifact.py +3 -2
  14. seldon_runtime-0.1.1.dev3/tests/test_native_artifact.py +249 -0
  15. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/LICENSE +0 -0
  16. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/MANIFEST.in +0 -0
  17. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/NOTICE +0 -0
  18. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/THIRD_PARTY_NOTICES.md +0 -0
  19. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/scripts/export_artifact_schema.py +0 -0
  20. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/attempt_bound.py +0 -0
  21. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/components.py +0 -0
  22. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/conditional.py +0 -0
  23. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/contract_versions.py +0 -0
  24. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/contracts.py +0 -0
  25. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/data/o200k_base.tiktoken +0 -0
  26. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/data/provenance.json +0 -0
  27. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/deadline.py +0 -0
  28. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/executor.py +0 -0
  29. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/gliner_normalize.py +0 -0
  30. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/instruction_envelope.py +0 -0
  31. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/json_pointer.py +0 -0
  32. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/local.py +0 -0
  33. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/local_models.py +0 -0
  34. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/local_telemetry.py +0 -0
  35. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/native_schema.py +0 -0
  36. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/output_budget.py +0 -0
  37. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/program_validation.py +0 -0
  38. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/provider_error.py +0 -0
  39. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/research_kernels.py +0 -0
  40. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/runner.py +0 -0
  41. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/semantic.py +0 -0
  42. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/telemetry.py +0 -0
  43. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/templates.py +0 -0
  44. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/tokenizer.py +0 -0
  45. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime/tool_wire.py +0 -0
  46. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime.egg-info/dependency_links.txt +0 -0
  47. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime.egg-info/requires.txt +0 -0
  48. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/seldon_runtime.egg-info/top_level.txt +0 -0
  49. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/setup.cfg +0 -0
  50. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/compiler-artifact/manifest.json +0 -0
  51. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/compiler-artifact-dev1/manifest.json +0 -0
  52. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/digest_goldens.json +0 -0
  53. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/local_gliner_raw.json +0 -0
  54. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/serving_compat/function-plan-v1.json +0 -0
  55. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/serving_compat/function-plan-v2.json +0 -0
  56. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/serving_compat/function-plan-v3.json +0 -0
  57. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/serving_compat/function-plan-v4.json +0 -0
  58. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/serving_compat/function-plan-v5.json +0 -0
  59. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/fixtures/tokenizer_goldens.json +0 -0
  60. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/installed_local_probe.py +0 -0
  61. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_contracts.py +0 -0
  62. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_correctness_repairs.py +0 -0
  63. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_gliner_normalize.py +0 -0
  64. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_import_closure.py +0 -0
  65. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_install.py +0 -0
  66. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_local.py +0 -0
  67. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_runner.py +0 -0
  68. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/test_tokenizer.py +0 -0
  69. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/tokenizer_cases.py +0 -0
  70. {seldon_runtime-0.1.1.dev2 → seldon_runtime-0.1.1.dev3}/tests/wheel_probe.py +0 -0
@@ -1,6 +1,34 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1.dev2 — unreleased
3
+ ## 0.1.1.dev3 — unreleased
4
+
5
+ - Accept native System One `choice` and Fastino GLiNER `extract` plans in standalone
6
+ compiler artifacts. The old artifact boundary rejected these operations even
7
+ though the interpreter already executed them for hosted bundles.
8
+ - Freeze native protocol, upstream model/revision, modes, answer types and host
9
+ wire profile in artifact requirements; validate them against both plan operations
10
+ and caller bindings before dispatch. Reuse GLiNER normalization and the extracted
11
+ System One wire implementation; generated kernels remain unsupported.
12
+ - Require dev3 for native manifests while keeping original dev1/dev2 chat artifacts
13
+ readable without mutation. Regenerate the public artifact schema.
14
+ - Add nonconstant classification and grounded-span artifact execution tests with
15
+ deterministic provider callbacks, and rejection coverage for mode/identity/profile
16
+ mismatches. This does not qualify live providers, publish a release or change hosted
17
+ bundle eligibility/refresh behavior.
18
+
19
+ ## 0.1.1.dev2 — published 2026-11-30
20
+
21
+ Published revision `5d30a44` through [Runtime Publish](https://github.com/Deep-Insight-Labs/seldon-runtime/actions/runs/46427361111):
22
+ all three Linux compatibility jobs, artifact build, installed-TestPyPI probe and
23
+ PyPI publication succeeded. This release does not deploy hosted Seldon or publish
24
+ the standalone compiler.
25
+
26
+ Local qualification passed 213 runtime tests with current dependencies and again
27
+ with Python 3.11, Pydantic 2.2.0 and tiktoken 0.7.0. Linux containers with networking
28
+ disabled passed 213 runtime tests and 205 staged compiler tests. The compiler
29
+ check used a candidate runtime dependency override; it establishes consumer
30
+ compatibility, not installation or publication of a compiler release. No new
31
+ live-model qualification or production deployment is claimed.
4
32
 
5
33
  - Bundle the immutable o200k_base rank data and construct its encoding locally.
6
34
  Token budgets and both historical/UTF-8 chunk boundaries previously depended on
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seldon-runtime
3
- Version: 0.1.1.dev2
3
+ Version: 0.1.1.dev3
4
4
  Summary: Standalone Seldon Functions interpreter and local execution client
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Source, https://github.com/Deep-Insight-Labs/seldon-runtime
@@ -31,15 +31,22 @@ for eligible Seldon Functions. The package name is **`seldon-runtime`**, and the
31
31
  Python import is `seldon_runtime`. This project is separate from SeldonIO.
32
32
 
33
33
  A single generic runtime executes authorized Function bundles on your hardware.
34
- Optimization and hosted comparison happen on Seldon. The runtime contains no
34
+ Compile with the public [Seldon Compiler](https://github.com/Deep-Insight-Labs/seldon-compiler)
35
+ or use a private Seldon deployment. The runtime contains no
35
36
  optimizer, billing service, dashboard or server infrastructure. Its first local
36
37
  model adapter uses pinned GLiNER2 open weights for extraction and classification.
37
38
 
38
- The current preview, [`0.1.1.dev1`](https://pypi.org/project/seldon-runtime/0.1.1.dev1/),
39
+ The current preview, [`0.1.1.dev2`](https://pypi.org/project/seldon-runtime/0.1.1.dev2/),
39
40
  is available on PyPI. Hosted bundle execution requires a Seldon deployment with
40
41
  bundle delivery enabled for your workspace. The separate standalone artifact reader
41
- uses caller-supplied model bindings without a Seldon service; its compiler exporter
42
- is still in development.
42
+ uses caller-supplied model bindings without a Seldon service. The public compiler
43
+ CLI can compile Functions, produce comparison reports and explicitly export
44
+ selected artifacts today; it requires no platform account. This standalone path is separate from hosted Runner bundle
45
+ eligibility and fallback.
46
+
47
+ The source checkout targets **0.1.1.dev3 (unreleased)**, adding standalone native
48
+ artifact bindings. Install this checkout with `python -m pip install .` to use
49
+ that capability; the published dev2 package does not accept native artifacts.
43
50
 
44
51
  ## Install
45
52
 
@@ -51,14 +58,14 @@ On Linux, install CPU PyTorch explicitly to avoid downloading CUDA dependencies:
51
58
 
52
59
  ```sh
53
60
  python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
54
- python -m pip install 'seldon-runtime[gliner]==0.1.1.dev1'
61
+ python -m pip install 'seldon-runtime[gliner]==0.1.1.dev2'
55
62
  ```
56
63
 
57
64
  On macOS:
58
65
 
59
66
  ```sh
60
67
  python -m pip install torch
61
- python -m pip install 'seldon-runtime[gliner]==0.1.1.dev1'
68
+ python -m pip install 'seldon-runtime[gliner]==0.1.1.dev2'
62
69
  ```
63
70
 
64
71
  In a uv environment, use `uv pip install` for the same commands. In a Linux uv
@@ -66,22 +73,21 @@ project, persist the dedicated torch index:
66
73
 
67
74
  ```sh
68
75
  uv add torch --index pytorch=https://download.pytorch.org/whl/cpu
69
- uv add 'seldon-runtime[gliner]==0.1.1.dev1'
76
+ uv add 'seldon-runtime[gliner]==0.1.1.dev2'
70
77
  ```
71
78
 
72
- The model weights and tokenizer files download on first use. Cache the pinned
73
- snapshot in advance for restricted networks. Token-chunked plans also need the
74
- tiktoken BPE cache (`TIKTOKEN_CACHE_DIR`). Model weights are not bundled in the wheel.
79
+ Optional GLiNER model weights and their tokenizer files download on first use.
80
+ Cache the pinned snapshot in advance for restricted networks; these model assets
81
+ are not bundled in the wheel.
75
82
 
76
- The unreleased `0.1.1.dev2` candidate removes the separate tiktoken cache prerequisite:
77
- its wheel and source distribution include the fixed `o200k_base` vocabulary used
78
- for Seldon token budgets and chunking. The runtime verifies its hash and constructs
83
+ Since `0.1.1.dev2`, the wheel and source distribution include the fixed `o200k_base`
84
+ vocabulary used for Seldon token budgets and chunking. The runtime verifies its hash and constructs
79
85
  the encoding directly; it never downloads or repairs missing/corrupt tokenizer
80
86
  data. No network or writable cache is required for these operations. Optional
81
87
  GLiNER weights and their own tokenizer files still require advance preparation.
82
88
  See [third-party notices](THIRD_PARTY_NOTICES.md) and
83
89
  [asset provenance](seldon_runtime/data/provenance.json) for sources and license basis.
84
- The published dev1 installation commands above retain their original prerequisites.
90
+ Older dev1 installations still require a prepared tiktoken BPE cache.
85
91
 
86
92
  ## Run a Function locally
87
93
 
@@ -151,12 +157,12 @@ Always close the runner to stop background tasks and attempt a bounded flush.
151
157
 
152
158
  ## Development
153
159
 
154
- ### Standalone compiler artifacts (unreleased)
160
+ ### Standalone compiler artifacts (preview)
155
161
 
156
162
  The separate compiler-artifact reader executes locally compiled user-owned plans.
157
163
  It does not use `Runner.load`, hosted Function IDs, a Seldon API key, refresh or
158
- telemetry. This reader is under development; a public compiler/exporter is not yet
159
- available. The existing hosted-bundle instructions above remain unchanged.
164
+ telemetry. The public compiler CLI produces these artifacts. The existing
165
+ hosted-bundle instructions above remain unchanged.
160
166
 
161
167
  An export directory contains one `manifest.json`, at most 2 MiB. Plan and spec are
162
168
  inline; no file paths, URLs, credentials or executable Python are supported. The
@@ -169,10 +175,10 @@ a development environment with `python -m pip install '.[schema]'` followed by
169
175
  that generator's `--check` mode, independently of the runtime compatibility matrix.
170
176
 
171
177
  The manifest freezes the compiler version and an explicit runtime version. New
172
- exports target the current producer version (`0.1.1.dev2` in this unreleased
173
- candidate). The dev2 reader accepts the reviewed set `0.1.1.dev1` and `0.1.1.dev2`;
174
- original dev1 manifests retain their pin and hashes. This packaging fix preserves
175
- token and plan semantics. dev0 and future versions are rejected until explicitly
178
+ exports target the source runtime version (`0.1.1.dev3`). Its reader accepts
179
+ the reviewed set `0.1.1.dev1`, `0.1.1.dev2` and `0.1.1.dev3`; original manifests retain
180
+ their pin and hashes. Native artifacts must declare dev3; older runtime contracts
181
+ remain chat/deterministic-only. dev0 and future versions are rejected until explicitly
176
182
  reviewed; there is no version-prefix or range-based compatibility inference.
177
183
  The manifest also freezes the optimizer contract (v1–v8), evaluation semantics,
178
184
  instruction envelope, conditional
@@ -209,16 +215,30 @@ policy before invoking a provider; your transport still owns TLS, credential ori
209
215
  binding, response-size limits and protocol decoding. Known transport failures use
210
216
  `ProviderError`; untyped failures stop without automatic fallback or retry.
211
217
 
212
- This initial handoff supports OpenAI-compatible chat steps and supported deterministic
213
- operators, including versioned chunking/conditional graphs. Native `choice`/`extract`
214
- adapters and research `generated_kernel` steps are explicitly rejected. A model
218
+ The source dev3 handoff supports OpenAI-compatible chat, native `choice`/`extract`
219
+ and deterministic operators, including versioned chunking/conditional graphs.
220
+ Native bindings declare `protocol="system_one"` with `capabilities=("choice",)` or
221
+ `protocol="fastino_gliner"` with `capabilities=("extract",)`, a nonempty `upstream_model`
222
+ and `revision`, and explicit `native_modes`. Supported modes are `legacy`/`pairs`
223
+ for System One and `legacy`/`spans`/`records` for GLiNER. System One also declares
224
+ `native_answers` (`choice`, `boolean`, `noul`, `score`) and `native_max_levels` (2–10).
225
+ `native_profile` carries only the host's reviewed wire-shape options under `host`;
226
+ it cannot carry endpoints or credentials. These identities must match the caller's
227
+ binding; unsupported operations and modes fail before provider dispatch.
228
+
229
+ The runtime supplies `native_adapter.native_request(model, payload)` and
230
+ `normalize_native(model, payload, raw)` for transports. The binding still returns
231
+ normalized output and owns its HTTP or local-model execution; the artifact never
232
+ downloads model weights or contacts an endpoint on its own. Context fitting uses
233
+ the native wire body and the frozen output policy, including GLiNER encoder rules.
234
+ Research `generated_kernel` steps remain explicitly rejected. A model
215
235
  revision is an operator-supplied identity, not proof of immutable upstream weights.
216
236
  Artifacts may contain sensitive prompts/spec text. Digest checks detect corruption,
217
237
  not malicious replacement of both the content and its digest; trust the producer
218
238
  separately. Linux/macOS filesystem APIs are used; Windows is not qualified.
219
239
 
220
240
  The standalone fixture in `tests/fixtures/compiler-artifact` is generated from the
221
- runtime test factory, pending a real compiler producer. Installed wheel/sdist probes
241
+ runtime test factory. Installed wheel/sdist probes
222
242
  exercise its nonconstant execution through the real interpreter with a deterministic
223
243
  provider callback. They do not qualify a live model, compiler selection quality or
224
244
  the complete compiler-to-runtime lifecycle.
@@ -264,8 +284,8 @@ Linux ARM64 CPU; other hardware and Windows are not claimed as qualified.
264
284
  ## Releases
265
285
 
266
286
  The publishing workflow is `.github/workflows/runtime-publish.yml` in
267
- `Deep-Insight-Labs/seldon-runtime`. Register project `seldon-runtime` as a trusted
268
- publisher on TestPyPI with environment `testpypi`, and on PyPI with environment
287
+ `Deep-Insight-Labs/seldon-runtime`. Trusted publishers are configured for project
288
+ `seldon-runtime` on TestPyPI with environment `testpypi` and PyPI with environment
269
289
  `pypi`. A `runtime-v<version>` tag must match `pyproject.toml` and `__version__`.
270
290
 
271
291
  Publication is disabled unless `SELDON_RUNTIME_TESTPYPI_PUBLISH_ENABLED` and
@@ -5,15 +5,22 @@ for eligible Seldon Functions. The package name is **`seldon-runtime`**, and the
5
5
  Python import is `seldon_runtime`. This project is separate from SeldonIO.
6
6
 
7
7
  A single generic runtime executes authorized Function bundles on your hardware.
8
- Optimization and hosted comparison happen on Seldon. The runtime contains no
8
+ Compile with the public [Seldon Compiler](https://github.com/Deep-Insight-Labs/seldon-compiler)
9
+ or use a private Seldon deployment. The runtime contains no
9
10
  optimizer, billing service, dashboard or server infrastructure. Its first local
10
11
  model adapter uses pinned GLiNER2 open weights for extraction and classification.
11
12
 
12
- The current preview, [`0.1.1.dev1`](https://pypi.org/project/seldon-runtime/0.1.1.dev1/),
13
+ The current preview, [`0.1.1.dev2`](https://pypi.org/project/seldon-runtime/0.1.1.dev2/),
13
14
  is available on PyPI. Hosted bundle execution requires a Seldon deployment with
14
15
  bundle delivery enabled for your workspace. The separate standalone artifact reader
15
- uses caller-supplied model bindings without a Seldon service; its compiler exporter
16
- is still in development.
16
+ uses caller-supplied model bindings without a Seldon service. The public compiler
17
+ CLI can compile Functions, produce comparison reports and explicitly export
18
+ selected artifacts today; it requires no platform account. This standalone path is separate from hosted Runner bundle
19
+ eligibility and fallback.
20
+
21
+ The source checkout targets **0.1.1.dev3 (unreleased)**, adding standalone native
22
+ artifact bindings. Install this checkout with `python -m pip install .` to use
23
+ that capability; the published dev2 package does not accept native artifacts.
17
24
 
18
25
  ## Install
19
26
 
@@ -25,14 +32,14 @@ On Linux, install CPU PyTorch explicitly to avoid downloading CUDA dependencies:
25
32
 
26
33
  ```sh
27
34
  python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
28
- python -m pip install 'seldon-runtime[gliner]==0.1.1.dev1'
35
+ python -m pip install 'seldon-runtime[gliner]==0.1.1.dev2'
29
36
  ```
30
37
 
31
38
  On macOS:
32
39
 
33
40
  ```sh
34
41
  python -m pip install torch
35
- python -m pip install 'seldon-runtime[gliner]==0.1.1.dev1'
42
+ python -m pip install 'seldon-runtime[gliner]==0.1.1.dev2'
36
43
  ```
37
44
 
38
45
  In a uv environment, use `uv pip install` for the same commands. In a Linux uv
@@ -40,22 +47,21 @@ project, persist the dedicated torch index:
40
47
 
41
48
  ```sh
42
49
  uv add torch --index pytorch=https://download.pytorch.org/whl/cpu
43
- uv add 'seldon-runtime[gliner]==0.1.1.dev1'
50
+ uv add 'seldon-runtime[gliner]==0.1.1.dev2'
44
51
  ```
45
52
 
46
- The model weights and tokenizer files download on first use. Cache the pinned
47
- snapshot in advance for restricted networks. Token-chunked plans also need the
48
- tiktoken BPE cache (`TIKTOKEN_CACHE_DIR`). Model weights are not bundled in the wheel.
53
+ Optional GLiNER model weights and their tokenizer files download on first use.
54
+ Cache the pinned snapshot in advance for restricted networks; these model assets
55
+ are not bundled in the wheel.
49
56
 
50
- The unreleased `0.1.1.dev2` candidate removes the separate tiktoken cache prerequisite:
51
- its wheel and source distribution include the fixed `o200k_base` vocabulary used
52
- for Seldon token budgets and chunking. The runtime verifies its hash and constructs
57
+ Since `0.1.1.dev2`, the wheel and source distribution include the fixed `o200k_base`
58
+ vocabulary used for Seldon token budgets and chunking. The runtime verifies its hash and constructs
53
59
  the encoding directly; it never downloads or repairs missing/corrupt tokenizer
54
60
  data. No network or writable cache is required for these operations. Optional
55
61
  GLiNER weights and their own tokenizer files still require advance preparation.
56
62
  See [third-party notices](THIRD_PARTY_NOTICES.md) and
57
63
  [asset provenance](seldon_runtime/data/provenance.json) for sources and license basis.
58
- The published dev1 installation commands above retain their original prerequisites.
64
+ Older dev1 installations still require a prepared tiktoken BPE cache.
59
65
 
60
66
  ## Run a Function locally
61
67
 
@@ -125,12 +131,12 @@ Always close the runner to stop background tasks and attempt a bounded flush.
125
131
 
126
132
  ## Development
127
133
 
128
- ### Standalone compiler artifacts (unreleased)
134
+ ### Standalone compiler artifacts (preview)
129
135
 
130
136
  The separate compiler-artifact reader executes locally compiled user-owned plans.
131
137
  It does not use `Runner.load`, hosted Function IDs, a Seldon API key, refresh or
132
- telemetry. This reader is under development; a public compiler/exporter is not yet
133
- available. The existing hosted-bundle instructions above remain unchanged.
138
+ telemetry. The public compiler CLI produces these artifacts. The existing
139
+ hosted-bundle instructions above remain unchanged.
134
140
 
135
141
  An export directory contains one `manifest.json`, at most 2 MiB. Plan and spec are
136
142
  inline; no file paths, URLs, credentials or executable Python are supported. The
@@ -143,10 +149,10 @@ a development environment with `python -m pip install '.[schema]'` followed by
143
149
  that generator's `--check` mode, independently of the runtime compatibility matrix.
144
150
 
145
151
  The manifest freezes the compiler version and an explicit runtime version. New
146
- exports target the current producer version (`0.1.1.dev2` in this unreleased
147
- candidate). The dev2 reader accepts the reviewed set `0.1.1.dev1` and `0.1.1.dev2`;
148
- original dev1 manifests retain their pin and hashes. This packaging fix preserves
149
- token and plan semantics. dev0 and future versions are rejected until explicitly
152
+ exports target the source runtime version (`0.1.1.dev3`). Its reader accepts
153
+ the reviewed set `0.1.1.dev1`, `0.1.1.dev2` and `0.1.1.dev3`; original manifests retain
154
+ their pin and hashes. Native artifacts must declare dev3; older runtime contracts
155
+ remain chat/deterministic-only. dev0 and future versions are rejected until explicitly
150
156
  reviewed; there is no version-prefix or range-based compatibility inference.
151
157
  The manifest also freezes the optimizer contract (v1–v8), evaluation semantics,
152
158
  instruction envelope, conditional
@@ -183,16 +189,30 @@ policy before invoking a provider; your transport still owns TLS, credential ori
183
189
  binding, response-size limits and protocol decoding. Known transport failures use
184
190
  `ProviderError`; untyped failures stop without automatic fallback or retry.
185
191
 
186
- This initial handoff supports OpenAI-compatible chat steps and supported deterministic
187
- operators, including versioned chunking/conditional graphs. Native `choice`/`extract`
188
- adapters and research `generated_kernel` steps are explicitly rejected. A model
192
+ The source dev3 handoff supports OpenAI-compatible chat, native `choice`/`extract`
193
+ and deterministic operators, including versioned chunking/conditional graphs.
194
+ Native bindings declare `protocol="system_one"` with `capabilities=("choice",)` or
195
+ `protocol="fastino_gliner"` with `capabilities=("extract",)`, a nonempty `upstream_model`
196
+ and `revision`, and explicit `native_modes`. Supported modes are `legacy`/`pairs`
197
+ for System One and `legacy`/`spans`/`records` for GLiNER. System One also declares
198
+ `native_answers` (`choice`, `boolean`, `noul`, `score`) and `native_max_levels` (2–10).
199
+ `native_profile` carries only the host's reviewed wire-shape options under `host`;
200
+ it cannot carry endpoints or credentials. These identities must match the caller's
201
+ binding; unsupported operations and modes fail before provider dispatch.
202
+
203
+ The runtime supplies `native_adapter.native_request(model, payload)` and
204
+ `normalize_native(model, payload, raw)` for transports. The binding still returns
205
+ normalized output and owns its HTTP or local-model execution; the artifact never
206
+ downloads model weights or contacts an endpoint on its own. Context fitting uses
207
+ the native wire body and the frozen output policy, including GLiNER encoder rules.
208
+ Research `generated_kernel` steps remain explicitly rejected. A model
189
209
  revision is an operator-supplied identity, not proof of immutable upstream weights.
190
210
  Artifacts may contain sensitive prompts/spec text. Digest checks detect corruption,
191
211
  not malicious replacement of both the content and its digest; trust the producer
192
212
  separately. Linux/macOS filesystem APIs are used; Windows is not qualified.
193
213
 
194
214
  The standalone fixture in `tests/fixtures/compiler-artifact` is generated from the
195
- runtime test factory, pending a real compiler producer. Installed wheel/sdist probes
215
+ runtime test factory. Installed wheel/sdist probes
196
216
  exercise its nonconstant execution through the real interpreter with a deterministic
197
217
  provider callback. They do not qualify a live model, compiler selection quality or
198
218
  the complete compiler-to-runtime lifecycle.
@@ -238,8 +258,8 @@ Linux ARM64 CPU; other hardware and Windows are not claimed as qualified.
238
258
  ## Releases
239
259
 
240
260
  The publishing workflow is `.github/workflows/runtime-publish.yml` in
241
- `Deep-Insight-Labs/seldon-runtime`. Register project `seldon-runtime` as a trusted
242
- publisher on TestPyPI with environment `testpypi`, and on PyPI with environment
261
+ `Deep-Insight-Labs/seldon-runtime`. Trusted publishers are configured for project
262
+ `seldon-runtime` on TestPyPI with environment `testpypi` and PyPI with environment
243
263
  `pypi`. A `runtime-v<version>` tag must match `pyproject.toml` and `__version__`.
244
264
 
245
265
  Publication is disabled unless `SELDON_RUNTIME_TESTPYPI_PUBLISH_ENABLED` and
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "seldon-runtime"
7
- version = "0.1.1.dev2"
7
+ version = "0.1.1.dev3"
8
8
  description = "Standalone Seldon Functions interpreter and local execution client"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -21,3 +21,5 @@ local_models
21
21
  local_telemetry
22
22
  artifact
23
23
  tokenizer
24
+ native_adapter
25
+ system_one
@@ -771,7 +771,11 @@
771
771
  "description": "Execution capabilities, not endpoint discovery or proof of model quality.",
772
772
  "properties": {
773
773
  "protocol": {
774
- "const": "openai-chat-completions",
774
+ "enum": [
775
+ "openai-chat-completions",
776
+ "fastino_gliner",
777
+ "system_one"
778
+ ],
775
779
  "title": "Protocol",
776
780
  "type": "string"
777
781
  },
@@ -780,7 +784,9 @@
780
784
  "enum": [
781
785
  "chat",
782
786
  "structured_output",
783
- "tools"
787
+ "tools",
788
+ "choice",
789
+ "extract"
784
790
  ],
785
791
  "type": "string"
786
792
  },
@@ -812,6 +818,60 @@
812
818
  }
813
819
  ],
814
820
  "title": "Revision"
821
+ },
822
+ "upstream_model": {
823
+ "anyOf": [
824
+ {
825
+ "maxLength": 256,
826
+ "minLength": 1,
827
+ "type": "string"
828
+ },
829
+ {
830
+ "type": "null"
831
+ }
832
+ ],
833
+ "default": null,
834
+ "title": "Upstream Model"
835
+ },
836
+ "native_modes": {
837
+ "default": [],
838
+ "items": {
839
+ "enum": [
840
+ "legacy",
841
+ "pairs",
842
+ "spans",
843
+ "records"
844
+ ],
845
+ "type": "string"
846
+ },
847
+ "title": "Native Modes",
848
+ "type": "array"
849
+ },
850
+ "native_answers": {
851
+ "default": [],
852
+ "items": {
853
+ "enum": [
854
+ "choice",
855
+ "boolean",
856
+ "noul",
857
+ "score"
858
+ ],
859
+ "type": "string"
860
+ },
861
+ "title": "Native Answers",
862
+ "type": "array"
863
+ },
864
+ "native_max_levels": {
865
+ "default": 10,
866
+ "maximum": 10,
867
+ "minimum": 2,
868
+ "title": "Native Max Levels",
869
+ "type": "integer"
870
+ },
871
+ "native_profile": {
872
+ "additionalProperties": true,
873
+ "title": "Native Profile",
874
+ "type": "object"
815
875
  }
816
876
  },
817
877
  "required": [
@@ -1578,7 +1638,8 @@
1578
1638
  "runtime_version": {
1579
1639
  "enum": [
1580
1640
  "0.1.1.dev1",
1581
- "0.1.1.dev2"
1641
+ "0.1.1.dev2",
1642
+ "0.1.1.dev3"
1582
1643
  ],
1583
1644
  "title": "Runtime Version",
1584
1645
  "type": "string"
@@ -1,3 +1,3 @@
1
1
  """Standalone Seldon Functions interpreter and local execution client."""
2
2
 
3
- __version__ = "0.1.1.dev2"
3
+ __version__ = "0.1.1.dev3"
@@ -16,18 +16,20 @@ from dataclasses import dataclass
16
16
  from pathlib import Path
17
17
  from typing import Any, Literal, Protocol
18
18
 
19
- from pydantic import BaseModel, ConfigDict, Field, ValidationError
19
+ from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_validator
20
20
 
21
21
  from .contracts import FunctionSpec, Plan, digest
22
22
  from .executor import Execution, execute
23
+ from .native_adapter import native_request, validate_native_config, validate_native_model
24
+ from .native_schema import NATIVE_CONTRACT_ERRORS
23
25
  from .output_budget import resolve
24
26
  from .program_validation import validate_program
25
27
  from .provider_error import ProviderError
26
28
 
27
29
  MAX_ARTIFACT_BYTES = 2 * 1024 * 1024
28
- RUNTIME_VERSION = "0.1.1.dev2"
30
+ RUNTIME_VERSION = "0.1.1.dev3"
29
31
  _SHA256 = r"^[0-9a-f]{64}$"
30
- Capability = Literal["chat", "structured_output", "tools"]
32
+ Capability = Literal["chat", "structured_output", "tools", "choice", "extract"]
31
33
  OptimizerContract = Literal[
32
34
  "optimizer-correctness-v1",
33
35
  "optimizer-correctness-v2",
@@ -51,11 +53,25 @@ class _Data(BaseModel):
51
53
  class ModelRequirements(_Data):
52
54
  """Execution capabilities, not endpoint discovery or proof of model quality."""
53
55
 
54
- protocol: Literal["openai-chat-completions"]
56
+ protocol: Literal["openai-chat-completions", "fastino_gliner", "system_one"]
55
57
  capabilities: tuple[Capability, ...] = Field(min_length=1, max_length=3)
56
58
  context_length: int = Field(strict=True, ge=1, le=100_000_000)
57
59
  max_output_tokens: int = Field(strict=True, ge=1, le=10_000_000)
58
60
  revision: str | None = Field(max_length=256)
61
+ upstream_model: str | None = Field(default=None, min_length=1, max_length=256)
62
+ native_modes: tuple[Literal["legacy", "pairs", "spans", "records"], ...] = ()
63
+ native_answers: tuple[Literal["choice", "boolean", "noul", "score"], ...] = ()
64
+ native_max_levels: int = Field(default=10, strict=True, ge=2, le=10)
65
+ native_profile: dict[str, Any] = Field(default_factory=dict)
66
+
67
+ @model_validator(mode="after")
68
+ def valid_native_contract(self):
69
+ validate_native_model(self)
70
+ return self
71
+
72
+ @property
73
+ def upstream_model_name(self):
74
+ return self.upstream_model
59
75
 
60
76
 
61
77
  class Evidence(_Data):
@@ -70,8 +86,8 @@ class ArtifactManifest(_Data):
70
86
  version: Literal["compiler-artifact-v1"]
71
87
  compiler_version: str = Field(min_length=1, max_length=64, pattern=r"^[a-zA-Z0-9.+_-]+$")
72
88
  # Explicit reviewed reader compatibility, never a version-prefix/range guess.
73
- # dev2 changes asset delivery only; dev1's token and plan semantics are frozen.
74
- runtime_version: Literal["0.1.1.dev1", "0.1.1.dev2"]
89
+ # dev3 adds explicit native bindings; older artifacts retain their restrictions.
90
+ runtime_version: Literal["0.1.1.dev1", "0.1.1.dev2", "0.1.1.dev3"]
75
91
  optimizer_contract_version: OptimizerContract
76
92
  instruction_envelope: Literal["instruction-envelope-v1"] | None
77
93
  conditional: bool = Field(strict=True)
@@ -124,6 +140,8 @@ def _required_capabilities(plan: Plan, spec: FunctionSpec) -> dict[str, set[str]
124
140
  for step in plan.steps:
125
141
  if step.op == "llm":
126
142
  add(step.model, calls[step.call], output_schema=step.output_schema)
143
+ elif step.op in {"choice", "extract"}:
144
+ required.setdefault(step.model, set()).add(step.op)
127
145
  if plan.fallback:
128
146
  for call in spec.calls:
129
147
  add(call.model, call)
@@ -141,11 +159,13 @@ def _parse(data: bytes) -> ArtifactManifest:
141
159
  if raw.get("spec", {}).get("reference_binding") is not None:
142
160
  raise ValueError
143
161
  if any(
144
- step.get("op") in {"generated_kernel", "choice", "extract"}
145
- for step in raw.get("plan", {}).get("steps", [])
162
+ step.get("op") == "generated_kernel" for step in raw.get("plan", {}).get("steps", [])
146
163
  ):
147
164
  raise ValueError
148
165
  manifest = ArtifactManifest.model_validate(raw)
166
+ native = [step for step in manifest.plan.steps if step.op in {"choice", "extract"}]
167
+ if native and manifest.runtime_version != RUNTIME_VERSION:
168
+ raise ValueError
149
169
  if (
150
170
  digest({k: v for k, v in raw.items() if k != "manifest_digest"})
151
171
  != manifest.manifest_digest
@@ -178,6 +198,8 @@ def _parse(data: bytes) -> ArtifactManifest:
178
198
  raise ValueError
179
199
  if len(set(model.capabilities)) != len(model.capabilities):
180
200
  raise ValueError
201
+ for step in native:
202
+ validate_native_config(manifest.models[step.model], step.op, step.config)
181
203
  return manifest
182
204
  except ArtifactError:
183
205
  raise
@@ -196,6 +218,11 @@ def _bindings(manifest, bindings):
196
218
  if not isinstance(actual, ModelRequirements) or (
197
219
  actual.protocol != required.protocol
198
220
  or actual.revision != required.revision
221
+ or actual.upstream_model != required.upstream_model
222
+ or actual.native_profile != required.native_profile
223
+ or actual.native_max_levels != required.native_max_levels
224
+ or not set(required.native_modes) <= set(actual.native_modes)
225
+ or not set(required.native_answers) <= set(actual.native_answers)
199
226
  or actual.context_length < required.context_length
200
227
  # Omitted max_tokens preserves endpoint-default behavior, so an
201
228
  # enlarged endpoint output ceiling cannot silently enlarge the bound.
@@ -233,18 +260,21 @@ class Artifact:
233
260
 
234
261
  async def provider(model, payload):
235
262
  required = manifest.models[model]
236
- needed = {"chat"}
237
- if payload.get("tools"):
263
+ primitive = payload.get("primitive")
264
+ needed = {primitive["kind"]} if isinstance(primitive, dict) else {"chat"}
265
+ if not primitive and payload.get("tools"):
238
266
  needed.add("tools")
239
- if payload.get("response_format"):
267
+ if not primitive and payload.get("response_format"):
240
268
  needed.add("structured_output")
241
- if "primitive" in payload or not needed <= set(required.capabilities):
269
+ if not needed <= set(required.capabilities):
242
270
  raise ArtifactError("model_capability_mismatch")
271
+ if primitive:
272
+ native_request(required, payload)
243
273
  bounded, _, _ = resolve(
244
274
  payload,
245
275
  required,
246
276
  manifest.spec.output_token_policy,
247
- body=lambda value, _: value,
277
+ body=lambda value, _: native_request(required, value)[1] if primitive else value,
248
278
  estimator_for=lambda _: None,
249
279
  )
250
280
  try:
@@ -275,6 +305,10 @@ class Artifact:
275
305
  upstream_status=429 if exc.upstream_status == 429 else None,
276
306
  provider_dispatched=exc.provider_dispatched,
277
307
  ) from None
308
+ except ValueError as exc:
309
+ if str(exc) in NATIVE_CONTRACT_ERRORS | {"invalid_provider_output"}:
310
+ raise ValueError(str(exc)) from None
311
+ raise ArtifactError("execution_failed") from None
278
312
  except Exception:
279
313
  raise ArtifactError("execution_failed") from None
280
314
 
@@ -297,7 +331,12 @@ class Artifact:
297
331
  except asyncio.CancelledError:
298
332
  raise
299
333
  except Exception as exc:
300
- safe = {"token_limit", "context_unverified", "output_schema", "invalid_provider_output"}
334
+ safe = NATIVE_CONTRACT_ERRORS | {
335
+ "token_limit",
336
+ "context_unverified",
337
+ "output_schema",
338
+ "invalid_provider_output",
339
+ }
301
340
  code = (
302
341
  str(exc) if isinstance(exc, ValueError) and str(exc) in safe else "execution_failed"
303
342
  )