@trace decorator and provider wrappers used in
Instrument your code do not apply. Instead, you publish your model’s
predictions directly to an inference pipeline.
You can do this in two ways — pick the one that matches how your system runs:
- Stream predictions as they happen (online serving, one request at a time).
- Batch upload predictions periodically (a scheduled scoring job, or a backfill).
Prerequisites:
- A project with monitoring mode enabled, and an inference pipeline in it.
- An Openlayer API key.
- The Openlayer Python SDK installed.
Define the config for your task type
Import the config class matching your project’s task type fromopenlayer.types.inference_pipelines.data_stream_params:
*_column_name values declared in the config.
Option A — Stream predictions as they happen
Useclient.inference_pipelines.data.stream(...) to publish one or a few rows per call, right after
your model scores a request:
Python
Option B — Upload predictions in batches
For a scheduled scoring job or a backfill, score a whole DataFrame and upload it at once withupload_batch_inferences:
Python
Add ground truth later
When the true labels/targets arrive after you have already published predictions, patch them in by correlating on theinference_id you set above:
Python

