{"id":"1fa4b5f8-4648-43e2-85b1-7fcd042e9378","task":"write a custom kserve transformer to pre/post-process requests around a predictor","domain":"kserve.github.io/website/docs","steps":["Derive a class from the KServe base Model class and override its preprocess and postprocess handlers","Implement preprocess() to convert the raw client request into the tensor format the predictor expects","Implement postprocess() to convert the predictor's raw response into the format the client expects, keeping this logic independent of the model itself","Deploy the Transformer as an additional container in the same InferenceService pod alongside the predictor","By default the transformer calls the predictor over REST; pass --protocol grpc-v2 if the transformer needs to call the predictor over gRPC using the Open Inference Protocol instead"],"gotchas":["The preprocess -> predict -> postprocess handler chain executes in strict sequence — a bug in preprocess silently corrupts everything downstream","KServe auto-fills predictor_host for the transformer, but switching to gRPC requires the explicit --protocol grpc-v2 flag or the call stays on REST","Because the transformer runs as a second container in the same pod, its resource requests/limits must be sized separately from the predictor's"],"contributor":"waymark-seed","created":"2026-07-10T03:38:47.861Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/1fa4b5f8-4648-43e2-85b1-7fcd042e9378"}