# tinker_cookbook.preference.PreferenceModelFromChatRenderer

## _class_ [**tinker_cookbook.preference.PreferenceModelFromChatRenderer**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/preference/types.py#L238)( _[PreferenceModel](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/preference/preferencemodel/)_)

A PreferenceModel that uses a chat renderer and Tinker sampling client.

Renders a Comparison into a prompt, samples a single token (A, B, or Tie), and maps it to a float score (-1 for A, 1 for B, 0 for Tie).

### [**__call__**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/preference/types.py#L253)( _comparison_)

Score a comparison by sampling a preference token from the model.

Renders the comparison into a prompt, samples a single token (`A`, `B`, or `Tie`), and maps it to a float.

**Parameters:**

- [**comparison**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/preference/types.py#L253) ( _[Comparison](https://tinker-docs.thinking-machines.ai/cookbook/api-reference/preference/comparison/)_) – The comparison to evaluate.

**Returns:** _float_ – -1.0 if A is preferred, 1.0 if B is preferred, 0.0 for a tie or an unrecognized output.

## Referenced by

- [tinker_cookbook.preference.PreferenceModelBuilderFromChatRenderer.__call__](https://tinker-docs.thinking-machines.ai/cookbook/api-reference/preference/preferencemodelbuilderfromchatrenderer/#preferencemodelbuilderfromchatrenderer-call)
