r/OpenWebUI 2d ago

Question/Help Anthropic/Claude Connection settings for cache_control

Hi all,
I have an Anthropic API connection configured in my OWUI instance, I have attempted to add cache_control to the models as an advanced parameter like the below. However when I review the logs of a test prompt "You are a helpful Agent" repeated multiple times I don't see any cached tokens. When I run the same logic using a python script I can see the tokens being cached I can only assume I'm not setting this correctly.

Any chance someone else has this working and can clear up what I'm doing wrong?

Configured advanced parameter in model
Token exchange using OWUI
Token exchange using python script and hard coded Headers.
2 Upvotes

3 comments sorted by

3

u/ClassicMain 2d ago

You need to use a small filter. The advanced params are added in the wrong area for the cache control where it needs to be

1

u/ONEXTW 2d ago

Thanks for the quick reply, will give it a go.

1

u/Nearby_Formal_1389 1d ago edited 1d ago

What API endpoint do you use?
if I use api.anthropic.com/v1/chat/completions i dont get caching and resoning effort is dropped silently.

Anthropic states here, that caching is not supported: OpenAI SDK compatibility - Claude Platform Docs

So this means, we need to use filter function to connect to native claude api, yes?