Liking cljdoc? Tell your friends :D

llm.sdk.cache.markers

Provider-native context cache marker transforms.

Provider-native context cache marker transforms.
raw docstring

apply-marker-to-messageclj

(apply-marker-to-message message ttl-marker layout)

Place a cache_control marker on a provider-native message.

Place a cache_control marker on a provider-native message.
sourceraw docstring

apply-system-and-3clj

(apply-system-and-3 messages)
(apply-system-and-3 messages
                    {:keys [ttl layout breakpoints]
                     :or {ttl "5m" layout :native breakpoints 4}})

Apply system_and_3 caching to a vector of provider-native messages.

Apply system_and_3 caching to a vector of provider-native messages.
sourceraw docstring

apply-system-blocks-cacheclj

(apply-system-blocks-cache system-blocks {:keys [ttl] :or {ttl "5m"}})

Place cache_control on the last Anthropic system content block.

Place cache_control on the last Anthropic system content block.
sourceraw docstring

apply-tools-cacheclj

(apply-tools-cache tools {:keys [ttl] :or {ttl "5m"}})

Mark the last Anthropic tools[] item as cacheable.

Mark the last Anthropic tools[] item as cacheable.
sourceraw docstring

markerclj

(marker)
(marker ttl)

Build a cache_control marker for the given TTL ('5m' or '1h').

The ttl is emitted explicitly for both known durations. We used to omit it for '5m' and lean on the provider's implicit ephemeral default — but Anthropic silently changed that default from 1h to 5m on 2026-03-06, which silently shortened the cache lifetime of every consumer that relied on it. Pinning the ttl in cache_control makes the requested duration explicit and immune to future default shifts. An unrecognized ttl falls back to a bare marker (the provider default) rather than sending an invalid value.

Build a cache_control marker for the given TTL ('5m' or '1h').

The ttl is emitted *explicitly* for both known durations. We used to omit it
for '5m' and lean on the provider's implicit ephemeral default — but Anthropic
silently changed that default from 1h to 5m on 2026-03-06, which silently
shortened the cache lifetime of every consumer that relied on it. Pinning the
ttl in cache_control makes the requested duration explicit and immune to future
default shifts. An unrecognized ttl falls back to a bare marker (the provider
default) rather than sending an invalid value.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close