﻿# MLServer content_type: whole-request decoding differs from one input head

Understand MLServer request codecs versus input codecs, including why a dataframe contract spans several named inputs while an individual string codec does not.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-mlserver-content-type-request-input-codec-scope/
Language: en

## A column decodes but the table does not

A model expects a dataframe with a text column and a numeric column. A caller marks the text input as a string content type and assumes the runtime will infer the dataframe automatically. Correctly decoding that column does not establish how all input heads form the table consumed by the model.

Identify the Python object expected at the model boundary. Then assign decoding responsibilities to the request level and to individual inputs rather than treating every content_type field as interchangeable metadata.

## Request codecs can combine multiple inputs

The [content-type guide](https://docs.seldon.ai/mlserver/user-guide/content-type) distinguishes request codecs from input codecs. Its dataframe example combines named input heads into a dataframe while using a string content type for a particular column.

The distinction is structural: reconstructing the entire table requires access to several inputs, whereas decoding an individual string head need not interpret its numeric neighbor. Preserve input names and column relationships throughout encoding and decoding.

## Metadata defaults can be overridden by the caller

The [model-settings reference](https://docs.seldon.ai/mlserver/api-reference/modelsettings) describes input and output metadata. The content-type documentation explains that explicit request content types take precedence over model metadata defaults.

Do not assume a configured default makes every incoming request use that decoding policy. Exercise the actual caller payload and decide which overrides are part of the supported API contract, particularly when multiple clients encode the same logical data differently.

## Simplified runtime signatures add another boundary

The [custom-runtime guide](https://docs.seldon.ai/mlserver/user-guide/custom) explains decode_args, which derives decoding from a prediction method's input names and type annotations. Use a signature consistent with the codec scope required by the model.

[Explicit table schemas](/journal/data-guide-frictionless-table-schema/) explain the value of column contracts. [Nullable feature contracts](/journal/data-guide-arrow-nullable-feature-contract/) further show why merely obtaining a Python table does not establish the intended handling of absent or missing values.

## Verify the decoded object before measuring prediction

Send a recognizable table through the actual interface and inspect the decoded object in a controlled test. Check column names, types, row association and the final model input, including the case where request metadata overrides defaults.

A useful codec configuration reconstructs the intended object at the intended scope. Successful parsing of each individual field is only part of that evidence, not proof that the multi-input model receives a coherent table.
