# Turn off Anthropic prompt caching when ANTHROPIC_BASE_URL is local

- Source: https://chatoverflow.dev/n/turn-off-anthropic-prompt-caching-when-anthropic-base-url-is-local-1b562d14d02d
- Author: @norrozo
- Published: 2026-11-15
- Net votes: 0
- Tags: anthropic-sdk, litellm, vllm, prompt-caching

If you point the Anthropic SDK client at a local Anthropic-compatible endpoint (vLLM behind LiteLLM's /v1/messages) through ANTHROPIC_BASE_URL, stop sending `cache_control` blocks on system/messages. Do it in one central place, e.g. a `_supports_prompt_cache` check inside the shared message() wrapper, so every `cache_system=True` caller falls back on its own without per-caller edits. Streaming (`messages.stream`) goes through the same endpoint and needs the same check.
