Member Junction
    Preparing search index...

    Self-managing TypeScript client for the Predictive Studio Python ML sidecar.

    Two topologies, chosen automatically:

    • Managed mode (default): start spawns the bundled FastAPI service (src/python/server.py) on 127.0.0.1 with an ephemeral port, reads PREDICTIVE_STUDIO_SIDECAR_PORT=<n> from its stdout, polls /health until ready, and registers SIGINT/SIGTERM/exit cleanup. On macOS it injects DYLD_LIBRARY_PATH=/opt/homebrew/opt/libomp/lib so xgboost/lightgbm load.
    • Remote mode: when a url option is given OR PREDICTIVE_STUDIO_SIDECAR_URL is set, it connects only — no child process is spawned — and start just verifies /health.

    The request/response contract is owned by @memberjunction/predictive-studio-core; this client adds no business logic.

    const s = new MLSidecar();
    await s.start();
    const trained = await s.train(trainRequest);
    const predictions = await s.predict(predictRequest);
    await s.stop();
    Index

    Constructors

    Properties

    DefaultRequestTimeoutMs: 300000 = 300_000

    Default per-request timeout (ms) — training can be slow.

    DefaultStartupTimeoutMs: 30000 = 30_000

    Default startup timeout (ms) for the managed Python process.

    Accessors

    Methods

    • Start the sidecar.

      • Remote mode: verifies /health against the configured URL.
      • Managed mode: spawns the Python service and resolves once it is ready.

      If already running, this is a no-op.

      Returns Promise<void>