Skip to content

Data Model

The TensorZero Gateway stores inference and feedback data in ClickHouse. This data can be used for observability, experimentation, and optimization.

ChatInference

The ChatInference table stores information about inference requests for Chat Functions made to the TensorZero Gateway.

A ChatInference row can be associated with one or more ModelInference rows, depending on the variant’s type. For chat_completion, there will be a one-to-one relationship between rows in the two tables.

ColumnTypeNotes
idUUIDMust be a UUIDv7
function_nameString
variant_nameString
episode_idUUIDMust be a UUIDv7
inputString (JSON)input field in the /inference request body
outputString (JSON)Array of content blocks
tool_paramsString (JSON)Object with any tool parameters (e.g. tool_choice, available_tools) used for the inference
inference_paramsString (JSON)Object with any inference parameters per variant type (e.g. {"chat_completion": {"temperature": 0.5}})
processing_time_msUInt32
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)

JsonInference

The JsonInference table stores information about inference requests for JSON Functions made to the TensorZero Gateway.

A JsonInference row can be associated with one or more ModelInference rows, depending on the variant’s type. For chat_completion, there will be a one-to-one relationship between rows in the two tables.

ColumnTypeNotes
idUUIDMust be a UUIDv7
function_nameString
variant_nameString
episode_idUUIDMust be a UUIDv7
inputString (JSON)input field in the /inference request body
outputString (JSON)Object with parsed and raw fields
output_schemaString (JSON)Schema that the output must conform to
inference_paramsString (JSON)Object with any inference parameters per variant type (e.g. {"chat_completion": {"temperature": 0.5}})
processing_time_msUInt32
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)

ModelInference

The ModelInference table stores information about each inference request to a model provider. This is the inference request you’d make if you had called the model provider directly.

ColumnTypeNotes
idUUIDMust be a UUIDv7
inference_idUUIDMust be a UUIDv7
raw_requestStringRaw request as sent to the model provider (varies)
raw_responseStringRaw response from the model provider (varies)
model_nameStringName of the model used for the inference
model_provider_nameStringName of the model provider used for the inference
input_tokensUInt32
output_tokensUInt32
response_time_msUInt32
ttft_msNullable(UInt32)Only available in streaming inferences
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)

BooleanMetricFeedback

The BooleanMetricFeedback table stores feedback for metrics of type = "boolean".

ColumnTypeNotes
idUUIDMust be a UUIDv7
target_idUUIDMust be a UUIDv7 that is either inference_id or episode_id depending on level in metric config
metric_nameString
valueBool
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)

FloatMetricFeedback

The FloatMetricFeedback table stores feedback for metrics of type = "float".

ColumnTypeNotes
idUUIDMust be a UUIDv7
target_idUUIDMust be a UUIDv7 that is either inference_id or episode_id depending on level in metric config
metric_nameString
valueFloat32
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)

CommentFeedback

The CommentFeedback table stores feedback provided with metric_name of "comment". Comments are free-form text feedbacks.

ColumnTypeNotes
idUUIDMust be a UUIDv7
target_idUUIDMust be a UUIDv7 that is either inference_id or episode_id depending on level in metric config
target_typeEnum(inference, episode)
valueString
timestampDateTimeMaterialized from id (using UUIDv7ToDateTime function)