Shared model-contract interfaces (TrainableModel / GrowableModel ABCs, the TrainingEvent vocabulary, ModelSerializer, the describe_topology() schema) plus a reusable conformance test kit for the Juniper ML platform.
Project description
juniper-model-core
The shared model-contract template for the Juniper ML research platform: the minimal interface the Juniper service layer needs from any learning model, plus a reusable conformance test kit that proves a model is pluggable.
It is the linchpin of the model/middleware refactor — the seam that lets a new neural-network model drop into the ecosystem (data → training → monitoring → serving) without the service layer knowing the model type. The contract is derived from two real implementers — the Cascade-Correlation network (a growable classifier) and the Δt-native Legendre Memory Unit (a fixed-order regressor) — never from one model alone.
Install
pip install juniper-model-core # the contract (no third-party runtime deps)
pip install "juniper-model-core[conformance]" # + numpy/pytest, to run the conformance kit
import juniper_model_core pulls no third-party runtime dependency: the contract
references numpy only in type annotations. numpy is needed only to run the conformance
kit.
The contract
| Element | What it is |
|---|---|
TrainableModel (ABC) |
fit / predict / metrics / describe_topology + task_type, input_shape, output_shape. numpy at the boundary; no argmax/accuracy in the generic surface. |
GrowableModel(TrainableModel) |
adds n_units / grow_step / freeze for constructive models (Cascade-Correlation, RCC, Growing-ESN). Fixed-topology models implement only TrainableModel. |
TrainingEvent |
the model-agnostic event vocabulary (training_start/end, epoch_end, unit_added, phase_change) every model maps its native events onto. |
ModelSerializer (ABC) |
a save/load strategy decoupled from the model; round-trips must be lossless. |
describe_topology() |
a model-agnostic {nodes, edges, meta} graph the front-end renders without knowing the model type. |
juniper_model_core.conformance |
the reusable pytest kit any implementer subclasses to prove compliance. |
Shared behavior (metric/topology/event validation) lives in juniper_model_core.validation
as inspectable free functions — the ABCs themselves are interface-only (first-principles, no
black-box base classes).
Using the conformance kit
from juniper_model_core.conformance import TrainableModelConformance, tiny_regression_3d
class TestMyModelConformance(TrainableModelConformance):
def make_model(self): return MyModel(task_type="regression")
def make_dataset(self): return tiny_regression_3d()
def make_serializer(self): return MySerializer()
pytest then runs every contract assertion (interface compliance, fit→predict→metrics,
task-type-consistent metrics, renderable topology, lossless serialization, legal event
order, and — for GrowableModel — grow_step incrementing n_units) against your model.
Design
See notes/JUNIPER_MODEL_CORE_INTERFACE_DESIGN_2026-06-14.md and
notes/JUNIPER_MODEL_MIDDLEWARE_REFACTOR_DESIGN_AND_PLAN_2026-05-31.md (§2.3, §3.3) in the
juniper-ml repository.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file juniper_model_core-0.3.0.tar.gz.
File metadata
- Download URL: juniper_model_core-0.3.0.tar.gz
- Upload date:
- Size: 33.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32befc25b69b341e66129da9b08cb4fff19aa470c073c521b8c995ceb756fe43
|
|
| MD5 |
20d780e01cdfab325f112f3ddb71a109
|
|
| BLAKE2b-256 |
828aa7c7bcf4d37facce1b1f443fd24f8b2b36aa459f5064fbd5e3bfda56ee0a
|
Provenance
The following attestation bundles were made for juniper_model_core-0.3.0.tar.gz:
Publisher:
publish-model-core.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_model_core-0.3.0.tar.gz -
Subject digest:
32befc25b69b341e66129da9b08cb4fff19aa470c073c521b8c995ceb756fe43 - Sigstore transparency entry: 1875319158
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@857dec2439d717dd3aaf92d99133b52e075a8350 -
Branch / Tag:
refs/tags/juniper-model-core-v0.3.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-model-core.yml@857dec2439d717dd3aaf92d99133b52e075a8350 -
Trigger Event:
push
-
Statement type:
File details
Details for the file juniper_model_core-0.3.0-py3-none-any.whl.
File metadata
- Download URL: juniper_model_core-0.3.0-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2042bdcb2681ce29639fcbefa8677684ad73da997d026c754925614e95a965fc
|
|
| MD5 |
c5554bfd1fba338dc7d45b142151b507
|
|
| BLAKE2b-256 |
ba56c8b5e8b8541458e47aba8f42edfba060d79a447df4abef3bd0beeba5baa4
|
Provenance
The following attestation bundles were made for juniper_model_core-0.3.0-py3-none-any.whl:
Publisher:
publish-model-core.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_model_core-0.3.0-py3-none-any.whl -
Subject digest:
2042bdcb2681ce29639fcbefa8677684ad73da997d026c754925614e95a965fc - Sigstore transparency entry: 1875319401
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@857dec2439d717dd3aaf92d99133b52e075a8350 -
Branch / Tag:
refs/tags/juniper-model-core-v0.3.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-model-core.yml@857dec2439d717dd3aaf92d99133b52e075a8350 -
Trigger Event:
push
-
Statement type: