Skip to content

vllm.entrypoints.anthropic.protocol

Pydantic models for Anthropic API protocol.

Classes:

Functions:

AnthropicContentBlock

Bases: BaseModel

Content block in message.

AnthropicContextManagement

Bases: BaseModel

Context management information for token counting.

AnthropicCountTokensRequest

Bases: BaseModel

Anthropic messages.count_tokens request.

AnthropicCountTokensResponse

Bases: BaseModel

Anthropic messages.count_tokens response.

AnthropicDelta

Bases: BaseModel

Delta for streaming responses.

AnthropicError

Bases: BaseModel

Error structure for Anthropic API.

AnthropicErrorResponse

Bases: BaseModel

Error response structure for Anthropic API.

AnthropicJsonOutputFormat

Bases: BaseModel

JSON output format configuration.

AnthropicMessage

Bases: BaseModel

Message structure.

AnthropicMessagesRequest

Bases: BaseModel

Anthropic Messages API request.

AnthropicMessagesResponse

Bases: BaseModel

Anthropic Messages API response.

AnthropicOutputConfig

Bases: BaseModel

Configuration options for the model's output, such as the output format.

AnthropicStreamEvent

Bases: BaseModel

Streaming event.

AnthropicThinkingConfigAdaptive

Bases: BaseModel

Extended thinking whose depth the model chooses.

display is accepted but ignored: reasoning is always returned.

AnthropicThinkingConfigBetweenTools

Bases: BaseModel

Thinking that is off up front but may resume between tool calls.

vLLM maps this to disabled thinking. It cannot force a model to emit progress notes between tool calls; any reasoning the model emits is still returned as thinking blocks.

AnthropicThinkingConfigEnabled

Bases: BaseModel

Extended thinking with a fixed token budget.

display is accepted but ignored: reasoning is always returned.

AnthropicTool

Bases: BaseModel

Tool definition.

AnthropicToolChangeDefinition

Bases: BaseModel

A tool defined by value in a tool_addition block.

AnthropicToolChangeReference

Bases: BaseModel

A tool named by a tool_addition or tool_removal block.

AnthropicToolChoice

Bases: BaseModel

Tool Choice definition.

AnthropicUsage

Bases: BaseModel

Token usage information.

translate_error_type(status_code)

Translate an HTTP status code to Anthropic's error.type vocabulary.