Skip to main content

juniper-cascor-client

PyPI Python 3.12+ License: MIT

Python HTTP and WebSocket client for the juniper-cascor training service.

juniper-cascor-client is the REST and async-WebSocket client for juniper-cascor, the Cascade-Correlation training service. The synchronous JuniperCascorClient covers network lifecycle, training control, snapshots, metrics, and distributed-worker monitoring; two async WebSocket streams cover live monitoring (/ws/training, inbound events) and runtime control (/ws/control, outbound commands). It's the same client juniper-canopy uses to drive and observe a cascor backend.

Part of the Juniper platform. juniper-cascor-client is the HTTP/WebSocket client for the juniper-cascor training service in Juniper — a multi-package ML research platform built around constructive (Cascade-Correlation) and recurrent neural networks.

Install

pip install juniper-cascor-client

Optional extras: [observability] adds Prometheus counters for WebSocket frame validation; [test] and [dev] install the test and lint/type-check toolchains.

Quick start

REST:

from juniper_cascor_client import JuniperCascorClient

with JuniperCascorClient("http://localhost:8200") as client:
    client.create_network(input_size=2, output_size=2)
    client.start_training(
        dataset={"source": "inline"},
        inline_data={"train_x": [[0, 0], [1, 0], [0, 1], [1, 1]],
                     "train_y": [[1, 0], [0, 1], [0, 1], [1, 0]]},
        epochs=100,
    )
    print(client.get_training_status()["data"]["training_active"])

Live training stream (async):

import asyncio
from juniper_cascor_client import CascorTrainingStream

async def monitor():
    async with CascorTrainingStream("ws://localhost:8200") as stream:
        async for msg in stream:
            if msg["type"] == "metrics":
                print(msg["data"]["epoch"], msg["data"]["train_loss"])

asyncio.run(monitor())

Control stream (async): CascorControlStream(...).command("start", {"epochs": 200}).

API

JuniperCascorClient (synchronous REST): health_check / is_alive / is_ready / wait_for_ready; create_network / get_network / delete_network / get_topology / get_statistics; start_training / stop_training / pause_training / resume_training / reset_training; get_training_status / get_training_params / update_params; get_metrics / get_metrics_history; get_dataset / get_dataset_data / get_decision_boundary; list_snapshots / get_snapshot / save_snapshot / load_snapshot; list_workers / get_worker / get_worker_stats.

CascorTrainingStream (async, /ws/training): yields inbound JSON frames; raw iteration (async for) or callbacks (on_metrics, on_state, on_topology, on_cascade_add, on_candidate_progress, on_event, on_disconnect).

CascorControlStream (async, /ws/control): command(command, params) / set_params(params) with per-request correlation.

Status

Live on PyPI. The current version is shown by the badge above; see CHANGELOG.md. The WebSocket streams do not auto-reconnect — wrap reconnection logic around the stream context manager for long-running consumers.

Documentation

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_cascor_client-0.6.0.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

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

juniper_cascor_client-0.6.0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file juniper_cascor_client-0.6.0.tar.gz.

File metadata

  • Download URL: juniper_cascor_client-0.6.0.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for juniper_cascor_client-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f140c9c5543a45e5d2f4977123057666f264b08f50e6ada6a1680753dda61d0c
MD5 beb749b7f86ea6222056f1527e653fbc
BLAKE2b-256 fa3509e1d67a2760742fe604ead6691350d21ffd069d36ae10e0e24778bc0af5

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_cascor_client-0.6.0.tar.gz:

Publisher: publish.yml on pcalnon/juniper-cascor-client

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_cascor_client-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_cascor_client-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f322eb5335efd239685810774408c88a4a164c9cd4ccfb83eefe610561258fca
MD5 d612cf88f77ffa54120db0a18b20467f
BLAKE2b-256 1e2ed146a97bd619b367c729994fe552ba7c7088432525d8152a4a84ca537c0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_cascor_client-0.6.0-py3-none-any.whl:

Publisher: publish.yml on pcalnon/juniper-cascor-client

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page