Optionaloptions: MLSidecarOptionsStatic ReadonlyDefaultDefault per-request timeout (ms) — training can be slow.
Static ReadonlyDefaultDefault startup timeout (ms) for the managed Python process.
Static ReadonlyPythonEnv var naming an explicit interpreter for the managed sidecar (and its test runners).
Static ReadonlyTrainerSeconds the trainer transport waits beyond a run's own timeoutSeconds before giving up on the sidecar.
Whether this client is in remote (connect-only) mode.
Whether the sidecar is reachable: remote always counts; managed needs a live child.
The port the managed Python service is listening on, or null (remote / not started).
Check sidecar liveness via GET /health.
Score 1..N rows by POSTing the artifact + frozen preprocessing to /predict.
Optionalsignal: AbortSignalRun one protocol-driven training by POSTing a TrainerRequest to /trainer. The transport timeout is the
request's own timeoutSeconds plus a 60 s margin. The sidecar checks timeoutSeconds between steps (snapshot
load, leakage audit, each inner-CV fold, the finalist refit, baselines and the holdout) and answers failed at stage
timeout at the first check past it; a step already running is not interrupted, so one fit can run past the
timeout. The client only times out when the sidecar process is gone or wedged, or a single step overruns the
margin. The answer
is checked against the contract before it is returned, never cast.
when a 2xx answer is not a TrainerResult
Start the sidecar.
/health against the configured URL.If already running, this is a no-op.
Stop the managed Python service. Resolves once the process has exited. In remote mode this is a no-op (the client never owned the process).
StaticResolvePick the managed sidecar's interpreter: the explicit pythonPath option, then PREDICTIVE_STUDIO_PYTHON,
then the package's bundled .venv, then python3. Blank strings count as absent at every step.
Self-managing TypeScript client for the Predictive Studio Python ML sidecar.
Two topologies, chosen automatically:
src/python/server.py) on 127.0.0.1 with an ephemeral port, readsPREDICTIVE_STUDIO_SIDECAR_PORT=<n>from its stdout, polls/healthuntil ready, and registers SIGINT/SIGTERM/exit cleanup. On macOS it injectsDYLD_LIBRARY_PATH=/opt/homebrew/opt/libomp/libso xgboost/lightgbm load.urloption is given ORPREDICTIVE_STUDIO_SIDECAR_URLis 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.Example