pub struct LLMRequest {Show 34 fields
pub messages: Arc<Vec<Message>>,
pub system_prompt: Option<Arc<str>>,
pub tools: Option<Arc<Vec<ToolDefinition>>>,
pub model: String,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub stream: bool,
pub output_format: Option<Value>,
pub tool_choice: Option<ToolChoice>,
pub parallel_tool_calls: Option<bool>,
pub parallel_tool_config: Option<Box<ParallelToolConfig>>,
pub reasoning_effort: Option<ReasoningEffortLevel>,
pub effort: Option<String>,
pub verbosity: Option<VerbosityLevel>,
pub do_sample: Option<bool>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub stop_sequences: Option<Vec<String>>,
pub thinking_budget: Option<u32>,
pub betas: Option<Vec<String>>,
pub context_management: Option<Value>,
pub coding_agent_settings: Option<Box<CodingAgentSettings>>,
pub metadata: Option<Value>,
pub previous_response_id: Option<String>,
pub response_store: Option<bool>,
pub responses_include: Option<Vec<String>>,
pub service_tier: Option<String>,
pub prompt_cache_key: Option<String>,
pub prompt_cache_profile: Option<PromptCacheProfile>,
pub fallbacks: Option<Vec<FallbackModel>>,
pub fallback_credit_token: Option<String>,
pub anthropic_request_overrides: Option<AnthropicRequestOverrides>,
}Expand description
Universal LLM request structure
Fields§
§messages: Arc<Vec<Message>>Conversation history shared via Arc so per-turn request construction
and continuation bookkeeping are O(1) instead of deep-copying the
entire history (which grows unbounded over a session).
system_prompt: Option<Arc<str>>Shared via Arc<str> (single allocation) so per-turn request
construction can reuse the prompt envelope’s Arc<str> via a cheap
refcount bump instead of cloning the full system prompt string.
tools: Option<Arc<Vec<ToolDefinition>>>§model: String§max_tokens: Option<u32>§temperature: Option<f32>§stream: bool§output_format: Option<Value>Optional structured output JSON schema to request from providers that support it
For Anthropic this will be sent as output_config.format = { type: "json_schema", schema: ... }
tool_choice: Option<ToolChoice>Tool choice configuration based on official API docs Supports: “auto” (default), “none”, “any”, or specific tool selection
parallel_tool_calls: Option<bool>Whether to enable parallel tool calls (OpenAI specific)
parallel_tool_config: Option<Box<ParallelToolConfig>>Parallel tool use configuration following Anthropic best practices
reasoning_effort: Option<ReasoningEffortLevel>Reasoning effort level for models that support it (none, minimal, low, medium, high, xhigh) Applies to: Claude, GPT-5 family, Gemini, Qwen3, DeepSeek with reasoning capability
effort: Option<String>Effort level for overall token usage (low, medium, high, xhigh, max) Applies to: Anthropic adaptive-thinking models such as Claude Opus 4.7 Controls how many tokens Claude uses when responding, trading off between response thoroughness and token efficiency.
verbosity: Option<VerbosityLevel>Verbosity level for output text (low, medium, high) Applies to: GPT-5.4-family Responses workflows and other models that support verbosity control
do_sample: Option<bool>Advanced generation parameters
top_p: Option<f32>§top_k: Option<i32>§presence_penalty: Option<f32>§frequency_penalty: Option<f32>§stop_sequences: Option<Vec<String>>§thinking_budget: Option<u32>Optional budget for extended thinking (Anthropic specific) Minimum value: 1024
betas: Option<Vec<String>>Optional beta headers for Anthropic (and potentially others)
context_management: Option<Value>Optional provider-specific context management configuration (Anthropic compaction/editing).
coding_agent_settings: Option<Box<CodingAgentSettings>>Optional coding agent specific settings
metadata: Option<Value>Optional turn metadata for git context (remote URLs, commit hash, etc.) This is sent as X-Turn-Metadata header to providers that support it
previous_response_id: Option<String>Optional Responses API continuity pointer for server-side context chaining. Used by providers that support stateful response continuation.
response_store: Option<bool>Optional Responses API storage flag.
When set, providers that support store pass this through directly.
responses_include: Option<Vec<String>>Optional Responses API include fields (e.g. reasoning encrypted content). Passed through only for providers/APIs that support include selectors.
service_tier: Option<String>Optional native OpenAI service_tier request parameter.
Passed through only for native OpenAI endpoints that support service tiers.
prompt_cache_key: Option<String>Optional provider routing hint for prompt cache stickiness. OpenAI uses this value to improve routing locality for repeated prefixes.
prompt_cache_profile: Option<PromptCacheProfile>Optional request-scoped prompt cache profile for provider-specific TTL overrides.
fallbacks: Option<Vec<FallbackModel>>Optional explicit fallback models for Anthropic server-side fallback.
Overrides provider.anthropic.fallbacks; sent with the
server-side-fallback-2026-06-01 beta header. Subject to the same
gates as the config list (first-party endpoint, a model that supports
server-side fallbacks, no credit-token retry) and the same entry
validation; an empty list sends nothing.
fallback_credit_token: Option<String>Optional opaque credit token from a refused request’s stop_details.fallback_credit_token.
Echoed on the retry to avoid paying the prompt-cache cost twice.
Sent with the fallback-credit-2026-07-01 beta header. The refused request must have
carried that header or server-side-fallback-2026-07-01, which grants the same
stop_details fields.
anthropic_request_overrides: Option<AnthropicRequestOverrides>Optional Anthropic-specific request overrides used when request semantics must not inherit VT Code’s provider defaults, such as the Anthropic compatibility server.
Implementations§
Source§impl LLMRequest
impl LLMRequest
Sourcepub fn set_auxiliary_output_budget(
&mut self,
provider: &(impl LLMProvider + ?Sized),
visible_output_tokens: u32,
)
pub fn set_auxiliary_output_budget( &mut self, provider: &(impl LLMProvider + ?Sized), visible_output_tokens: u32, )
Budget a short auxiliary answer separately from any hidden reasoning.
Select low effort only when advertised; otherwise retain the provider’s
default. Reasoning routes receive 2,048 additional output tokens and no
sampling controls. This is a bounded allowance, not a completion guarantee.
Reapply after changing model, including on a fallback route.
Trait Implementations§
Source§impl Clone for LLMRequest
impl Clone for LLMRequest
Source§impl Debug for LLMRequest
impl Debug for LLMRequest
Source§impl Default for LLMRequest
impl Default for LLMRequest
Source§impl<'de> Deserialize<'de> for LLMRequest
impl<'de> Deserialize<'de> for LLMRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for LLMRequest
impl Freeze for LLMRequestwhere
*const ArcInner<Vec<Message>> is !null: Freeze,
PhantomData<ArcInner<Vec<Message>>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Vec<ToolDefinition>> is !null: Freeze,
PhantomData<ArcInner<Vec<ToolDefinition>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<String>: Freeze,
*const ParallelToolConfig is !null: Freeze,
PhantomData<ParallelToolConfig>: Freeze,
*const CodingAgentSettings is !null: Freeze,
PhantomData<CodingAgentSettings>: Freeze,
PhantomData<FallbackModel>: Freeze,
impl Move for LLMRequest
impl RefUnwindSafe for LLMRequest
impl Send for LLMRequest
impl Sync for LLMRequest
impl Unpin for LLMRequest
impl UnsafeUnpin for LLMRequestwhere
*const ArcInner<Vec<Message>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<Message>>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Vec<ToolDefinition>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<ToolDefinition>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ParallelToolConfig is !null: UnsafeUnpin,
PhantomData<ParallelToolConfig>: UnsafeUnpin,
*const CodingAgentSettings is !null: UnsafeUnpin,
PhantomData<CodingAgentSettings>: UnsafeUnpin,
PhantomData<FallbackModel>: UnsafeUnpin,
impl UnwindSafe for LLMRequestwhere
Arc<Vec<Message>>: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<Vec<ToolDefinition>>: UnwindSafe,
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
BoxRaw<ParallelToolConfig>: UnwindSafe,
BoxRaw<CodingAgentSettings>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.