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.7.0.tar.gz (83.4 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.7.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: juniper_cascor_client-0.7.0.tar.gz
  • Upload date:
  • Size: 83.4 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.7.0.tar.gz
Algorithm Hash digest
SHA256 f0786babaa8b448f2f741153a38ab6b3a14f8c482dfec1e9e94da963c7767bff
MD5 a786ffbac2847474a679312cd6191261
BLAKE2b-256 0cb93b6061f2e76b66608b688c2fa306e292e04ed42ec2e91537a20f31a08e9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_cascor_client-0.7.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.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_cascor_client-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da11d1289747ee7f21c9c889e46aa058fd0a67b5bf51c27bbfe9807d72600a0b
MD5 ea069e7d6c3d2964c43dae5935458448
BLAKE2b-256 10e238e2c79eb52b86b41e5c7266ae1920fb02a2211ac4803791d85ee87e9652

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_cascor_client-0.7.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