Skip to main content

OneXMonitor parameters

ParameterTypeDescription
endpointstringIngestion base URL. Determines which platform environment receives your logs (sandbox, development, production). Fetch environment-specific endpoints from the OneX Observability Dashboard.
api_keystringAPI key for authentication (from the same dashboard).
enable_loggingboolWhen true, enables SDK logging at INFO level (framework detection, signal export, etc.). Use for local debugging. Default: false.
sample_ratefloatFraction of requests to export (0.0–1.0). 1.0 = 100%, 0.1 = 10%. Reduces volume in high-traffic production. Default: 1.0.
max_requests_per_minuteint | NoneCap on batch export requests per minute to avoid overloading the platform. None = no cap. Default: None.

Config options

KeyTypeDefaultDescription
hidden_state_sample_tokensint4Number of tokens sampled per hidden-state payload.
hidden_state_sample_featuresint32Number of features sampled per token.
hidden_state_precisionint6Decimal precision for rounded tensor samples (use -1 to disable rounding).
capture_full_hidden_stateboolfalseSet true to include the entire hidden-state tensor (use cautiously).
payload_sample_itemsint5Max items serialized per list/dict when exporting request payloads.
payload_tensor_sampleint32Flat element sample size for tensor summaries in request payloads.
payload_max_depthint2Maximum depth for nested request payload serialization.
request_metadatadict{}Extra metadata appended to every request payload/response event.
request_payload_endpointstringderivedOverride for the payload ingestion endpoint (defaults to /api/requests/payload).
request_response_endpointstringderivedOverride for the response ingestion endpoint (defaults to /api/requests/response).
capture_request_payloadbooltrueWhen false, request payloads (model inputs and raw context) are not sent to the platform. Neural signals still go to /api/signals/batch.
capture_response_payloadbooltrueWhen false, response payloads (model outputs and application responses) are not sent. Neural signals still go to /api/signals/batch.
enable_loggingboolfalseWhen true, enables SDK logging at INFO level for debugging. Can also be passed as a top-level parameter to OneXMonitor.
sample_ratefloat1.0Fraction of requests to export (0.0–1.0). Per-request sampling; can also be passed as a top-level parameter.
max_requests_per_minuteint | NoneNoneCap on batch export requests per minute. Can also be passed as a top-level parameter.
capture_logitsboolfalseWhen true, model logits are extracted from the forward output and included in the response payload (shape + sample). For Uncertainty, Calibration, and Confidence assessments.
capture_probabilitiesboolfalseWhen true, probabilities (softmax of logits) are computed and included in the response payload (shape + sample). Requires logits to be present in the model output.
logits_sample_sizeint64Max number of values to include in the logits/probabilities sample (flattened). Limits payload size.

Sampling and throughput control

  • Sample rate: When sample_rate is less than 1.0, the SDK exports only a fraction of requests. The decision is made once per request (by request_id), so either all signals for a request are exported or none. Use this in high-traffic production to reduce volume while keeping representative coverage (e.g. sample_rate=0.1 for 10% of requests).
  • Max requests per minute: When set, the exporter limits how many batch HTTP requests it sends to the platform per 60-second sliding window. Batches are sent as soon as possible under this cap. Use this to avoid overloading the ingestion API when many models or processes export concurrently.
Example:
monitor = OneXMonitor(
    api_key="your-api-key",
    endpoint="onex-ingestion-endpoint",
    sample_rate=0.1,                  # export 10% of requests
    max_requests_per_minute=120,      # cap at 120 batch requests per minute
)

Logits and probabilities capture

For Uncertainty, Calibration, and Confidence assessments, the platform can use model logits and/or probabilities. By default they are not captured (privacy and payload size).
  • capture_logits: When true, the SDK extracts the logits tensor from the model forward output (e.g. HuggingFace CausalLMOutputWithPast.logits) and adds a logits field to the response payload with shape, sample (first N values), and numel.
  • capture_probabilities: When true, the SDK computes softmax(logits) and adds a probabilities field with the same structure. Requires the model output to expose logits (e.g. .logits attribute or first element of a tuple).
  • logits_sample_size: Caps how many values are included in the sample (default 64). Use a higher value for small classification heads; keep lower for large vocabularies.
When either option is enabled, the main output field in the response is serialized without the raw logits tensor so you avoid duplicating data and control size via the sampled fields. Example:
monitor = OneXMonitor(
    api_key="your-api-key",
    endpoint="onex-ingestion-endpoint",
    config={
        "capture_logits": True,
        "capture_probabilities": True,
        "logits_sample_size": 128,
    },
)