Table of Contents

Class ModelPreferences

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents a server's preferences for model selection, requested of the client during sampling.

public class ModelPreferences
Inheritance
ModelPreferences
Inherited Members

Remarks

Because LLMs can vary along multiple dimensions, choosing the "best" model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This class allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case.

These preferences are always advisory. The client may ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.

See the schema for details.

Properties

CostPriority

Gets or sets how much to prioritize cost when selecting a model.

[JsonPropertyName("costPriority")]
public float? CostPriority { get; init; }

Property Value

float?

Remarks

A value of 0 means cost is not important, while a value of 1 means cost is the most important factor.

Hints

Gets or sets optional hints to use for model selection.

[JsonPropertyName("hints")]
public IReadOnlyList<ModelHint>? Hints { get; init; }

Property Value

IReadOnlyList<ModelHint>

IntelligencePriority

Gets or sets how much to prioritize intelligence and capabilities when selecting a model.

[JsonPropertyName("intelligencePriority")]
public float? IntelligencePriority { get; init; }

Property Value

float?

Remarks

A value of 0 means intelligence is not important, while a value of 1 means intelligence is the most important factor.

SpeedPriority

Gets or sets how much to prioritize sampling speed (latency) when selecting a model.

[JsonPropertyName("speedPriority")]
public float? SpeedPriority { get; init; }

Property Value

float?

Remarks

A value of 0 means speed is not important, while a value of 1 means speed is the most important factor.