Skip to main content

Module prompt_cache

Module prompt_cache 

Source

Structs§

AnthropicPromptCacheSettings
Anthropic Claude cache control settings
DeepSeekPromptCacheSettings
DeepSeek prompt caching configuration (automatic KV cache reuse)
GeminiPromptCacheSettings
Gemini API caching preferences
MoonshotPromptCacheSettings
Moonshot prompt caching configuration (leverages server-side reuse)
OpenAIPromptCacheSettings
OpenAI prompt caching controls (automatic with metrics)
OpenRouterPromptCacheSettings
OpenRouter passthrough caching controls
PromptCachingConfig
Global prompt caching configuration loaded from vtcode.toml
ProviderPromptCachingConfig
Per-provider configuration overrides
ZaiPromptCacheSettings
Z.AI prompt caching configuration (disabled until platform exposes metrics)

Enums§

GeminiPromptCacheMode
Gemini prompt caching mode selection
OpenAIPromptCacheKeyMode
OpenAI prompt cache key derivation mode.
PromptCacheRetention
OpenAI prompt cache retention policy. Controls the model-side prompt caching window.

Functions§

build_openai_prompt_cache_key
Build a stable OpenAI prompt_cache_key for requests that should share provider-side cache routing.
build_session_affinity_prompt_cache_key
Build the namespaced session-affinity / prompt-cache key for a request.
map_prompt_cache_key_for_provider
Rewrite an OpenAI-style cache key for routes that share the wire shape but need distinct routing stickiness. Keeps the stable session identifier while namespacing gateway/session-affinity traffic apart from native OpenAI.
session_affinity_key_enabled
Whether LLMRequest.prompt_cache_key should carry session lineage for this provider.
session_affinity_provider
Providers that send lineage-stable session/cache identity on the wire.