Per-Model Prompt Caching Control#
What's wrong with this entry?
What: Fine-grained control over prompt caching for individual model families How to use:
# Disable caching for Haiku models only
export DISABLE_PROMPT_CACHING_HAIKU=true
# Disable caching for Sonnet models only
export DISABLE_PROMPT_CACHING_SONNET=true
# Disable caching for Opus models only
export DISABLE_PROMPT_CACHING_OPUS=true
# Or disable globally for all models (existing behavior)
export DISABLE_PROMPT_CACHING=true
Details:
- Allows optimization strategies per model tier (e.g., disable for cheaper Haiku, enable for expensive Opus)
- The global
DISABLE_PROMPT_CACHINGvariable still works as before - Enables cost and performance tuning based on your specific use cases
- Evidence:
Sd(A)function at line 395280 replacesPd()at line 394932 in v1.0.112