Skip to main content

Module provider

Module provider 

Source
Expand description

Core LLM provider trait and error types. Universal LLM provider abstraction with API-specific role handling.

The canonical trait, request/response types, and tool definitions live in vtcode_llm::provider. This module re-exports them so the historical crate::llm::provider::* import paths continue to resolve throughout vtcode-core.

Structs§

AnthropicRequestOverrides
CodingAgentSettings
Settings to refine model behavior for coding agent tasks
ContextWindowProvider
Provider-local context capacity discovered for the selected model. All transport and capability behavior remains delegated to the underlying provider.
FallbackModel
Fallback model configuration for Anthropic server-side fallback. The explicit-list form of fallbacks, sent with the server-side-fallback-2026-06-01 beta header (the "default" keyword form uses server-side-fallback-2026-07-01; pairing a header with the other form is rejected).
FunctionCall
Function call within a tool call
FunctionDefinition
Function definition within a tool
GrammarDefinition
Grammar definition for GPT-5 context-free grammar (CFG) constraints
LLMErrorMetadata
LLMRequest
Universal LLM request structure
LLMResponse
Universal LLM response structure
Message
Universal message structure supporting both text and image content
ParallelToolConfig
Configuration for parallel tool use behavior Based on Anthropic’s parallel tool use guidelines
PreparedResponsesRequest
ProviderCapabilities
Cached provider capabilities to reduce repeated trait method calls
ResponsesCompactionOptions
Optional overrides for standalone Responses compaction requests.
ResponsesContinuationState
ShellToolDefinition
Shell tool definition for GPT-5.1 shell tool type Allows controlled command-line interface interactions
SpecificFunctionChoice
Specific function choice details
SpecificToolChoice
Specific tool choice for forcing a particular function call
ToolCall
Universal tool call that matches OpenAI/Anthropic/Gemini specifications
ToolDefinition
Universal tool definition that matches OpenAI/Anthropic/Gemini specifications Based on official API documentation from Context7
ToolNamespace
A namespace grouping for deferred tools. When a tool has a namespace and defer_loading is true, only the namespace metadata (name + description) is sent upfront. The full tool definitions are loaded when the model searches for a tool in that namespace.
Usage

Enums§

AnthropicOptionalStringOverride
AnthropicOptionalU32Override
AnthropicThinkingConfig
Anthropic thinking configuration for fallback models.
AnthropicThinkingDisplayOverride
AnthropicThinkingModeOverride
AssistantPhase
Phase metadata for assistant messages in multi-step Responses-style workflows.
ContentPart
Content type for messages that can include both text and images
FinishReason
LLMError
LLM error types with optional provider metadata
LLMStreamEvent
MessageClearAt
Controls when an Anthropic mid-conversation system message is cleared.
MessageContent
MessageRole
NormalizedStreamEvent
PromptCacheProfile
ReasoningSource
Provider-side classification for streamed reasoning text.
ToolChoice
Tool choice configuration that works across different providers Based on OpenAI, Anthropic, and Gemini API specifications Follows Anthropic’s tool use best practices for optimal performance
ToolSearchAlgorithm
Tool search algorithm for Anthropic’s advanced-tool-use beta

Traits§

LLMProvider
Universal LLM provider trait

Functions§

get_cached_capabilities
Extract and cache provider capabilities for a given provider and model
prepare_openai_responses_request
prepare_responses_continuation_request
records_responses_continuation_state
responses_continuation_key
supports_responses_chaining
uses_incremental_responses_history
Compatibility shim for older callers.

Type Aliases§

BorrowedLLMStream
LLMNormalizedStream
LLMStream