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 GrowableModelgrow_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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juniper_model_core-0.3.1.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juniper_model_core-0.3.1-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file juniper_model_core-0.3.1.tar.gz.

File metadata

  • Download URL: juniper_model_core-0.3.1.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for juniper_model_core-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b1627b7ad3e6e07ecc54fb8d3f6975209ee4893deca7432db7deb5c1f05dae0e
MD5 0b2406675a1eb51c38e3e44a281d1589
BLAKE2b-256 22e0ae42d08e964cd5ff390cb9cca6e949042a4103e04d0ca976a8ca6aeee4de

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_model_core-0.3.1.tar.gz:

Publisher: publish-model-core.yml on pcalnon/juniper-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file juniper_model_core-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_model_core-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1b926a00479ad908fe679ae80edf2d397cfce1483621c4e3d83adcec68de9a
MD5 4fa1d2b1505441a5d26b770edd467b61
BLAKE2b-256 ae8a3398a4d0a0e1b55ffaaab961f46d4f5b9b1f829929182a47c29b045965af

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_model_core-0.3.1-py3-none-any.whl:

Publisher: publish-model-core.yml on pcalnon/juniper-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.2

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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