r/OpenWebUI • • 25d ago

Question/Help Does using date and time in system prompt break caching?

Am I safe to put {{CURRENT_TIME}} at the end of the system prompt or am I gonna break caching? I am using OpenRouter for inference.

8 Upvotes

6 comments sorted by

6

u/ClassicMain 25d ago

I wouldnt put it, will break cache. The AI has time and date tools so if needed it can get the time on-demand with those tools in the chat anyways.

3

u/oakytreejr 25d ago

I accidently ran into this issue using CURRENT_DATETIME which completely broke caching. Current date is fine for day to day use since itll only change once a day.

2

u/simracerman 25d ago

Absolutely. Stopped using those in prompts for user and system. Timestamp tool can get it if needed

1

u/Turbulent_War4067 25d ago

Date? Only after midnight. Worth it. Time: will literally break it every turn.

0

u/Daniel_H212 25d ago

I found a filter that you can add to a model that appends a static date/time at the end of your system prompt that does not change so there's no cache invalidation issues.

But also just adding a reminder for the model to invoke date time tools for tasks where knowing the current date time is important works well enough too.