v2

latestOpenAPI 3.1.02026-08-05267431678.1 KB
inference

Run Inference

Run inference on a fine-tuned or base Pioneer model.

Supports both encoder tasks (NER, classification, JSON extraction) and decoder tasks (text generation). The task field discriminates the request type automatically, and the response type field indicates the result shape.

All wire-format translation, routing, dispatch, persistence, and error mapping live in :func:services.inference.adapters.native.run_native_inference. The router keeps only the HTTP-shaped concerns: route declaration, authentication, rate limiting, geo-compliance gating, global admission control, and the deprecation-header injection that flags legacy encoder task shapes before the body is rendered.

Args: request: FastAPI request object (required by SlowAPI key extraction). inference_request: Discriminated union -- either encoder or decoder payload. response: FastAPI response object -- used to set deprecation headers on legacy encoder task shapes before the body is rendered. auth: Authenticated request context.

Returns: :class:schemas.inference.EncoderInferenceResponse for encoder requests, :class:schemas.inference.GenerateInferenceResponse for decoder requests.

Raises: HTTPException: If the model is not found, the inference fails, or the request payload is invalid. See the adapter for the full error-mapping ladder.

post/inference

Request body

OR

Response

Successful Response

OR