Skip to main content

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_2026-06-14_JUNIPER-ML_MODEL-CORE-INTERFACE-DESIGN.md and notes/JUNIPER_2026-05-31_JUNIPER-ECOSYSTEM_MODEL-MIDDLEWARE-REFACTOR-DESIGN-AND-PLAN.md (§2.3, §3.3) in the juniper-ml repository.

License

MIT — see LICENSE.

Metadata

Release files for juniper-model-core 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for juniper-model-core 0.3.2
File Size Uploaded Provenance Actions
juniper_model_core-0.3.2.tar.gz 34.5 kB With provenance Details for juniper_model_core-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for juniper-model-core 0.3.2
File Interpreter ABI Platform Actions
juniper_model_core-0.3.2-py3-none-any.whl Python 3 none any Details for juniper_model_core-0.3.2-py3-none-any.whl

Total release size: 65.5 kB

Release files / juniper_model_core-0.3.2.tar.gz

Download URL juniper_model_core-0.3.2.tar.gz
Size 34.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fe2685de75997e017606210b082687da60cce3e36055f065ce22707f0e9c55d7
BLAKE2b-256 checksum
How to use checksums
c55c81ad4679ea99bfebbc1a34138a03b86aa9bf8dd491bb770e646bd1e76d8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / juniper_model_core-0.3.2-py3-none-any.whl

Download URL juniper_model_core-0.3.2-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9f6dd843b3ece2bbb444ffe84c7707d613e022c177a51e3c66121e0323a0234
BLAKE2b-256 checksum
How to use checksums
f60419309657477691ef03d13e1561d38893bd0ff6c063bd379281097f017984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for juniper-model-core 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for juniper_model_core-0.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page