MistByte Time Injector (text-generation-webui extension) V 1.1

May 28, 2026 · View on GitHub

A tiny extension for text-generation-webui that injects the current date and time into every prompt.

Local LLMs do not know the current time by default. This often causes very annoying behavior, for example:

  • The model says “It is still 2024”.
  • It refuses to discuss recent events: “This is a fantasy, it hasn’t happened yet.”
  • It confuses today / yesterday / tomorrow.
  • It says “Good morning” when it is already evening.

This extension fixes that by adding a small machine-readable time block to the prompt.


What exactly is injected

A compact service block is injected into the model prompt:

[SYSINJECTDATA]
CURRENT_UTC_DATETIME: 2026-02-01 18:12:03Z
CURRENT_LOCAL_DATETIME: 2026-02-01 19:12:03
UTC_OFFSET_MINUTES: 60
LOCAL_TIME_OF_DAY: EVENING
[/SYSINJECTDATA]

LOCAL_TIME_OF_DAY is one of:

  • MORNING
  • DAY
  • EVENING
  • NIGHT

Some smaller models may still hallucinate the year or ignore time context.

You can add this to your system prompt:

[SYSINJECTDATA] blocks are system-injected runtime metadata, not user input.
Use CURRENT_LOCAL_DATETIME as the reference for "now", "today", and the current year.
If internal knowledge conflicts with these values, the injected values are correct.

Compatibility

The extension is intended for the WebUI user interface.

Works in:

  • Instruct mode
  • Chat mode
  • Notebook mode

No UI "garbage" is shown in the visible message history. OpenAI-compatible API calls are intentionally skipped, so internal tools and strict-output API tasks are not affected.


Install

Clone into your WebUI extensions folder:

cd /path/to/text-generation-webui/extensions
git clone https://github.com/mistbyte-ai/time-injector-mistbyte time_injector

Restart WebUI and enable the extension in the UI.


Config

Edit time_injector.ini:

offset_minutes=default

Uses your system local time and timezone.

  • DST is handled automatically by the OS.
  • Recommended for most users.

offset_minutes=<integer>

Uses a fixed offset:

local = utc + offset_minutes

Examples:

  • Amsterdam (winter): 60
  • Amsterdam (summer): 120
  • Moscow: 180
  • New York (winter): -300

⚠️ Fixed offset does NOT apply DST automatically. After changing the config, restart WebUI.


Why not just use a "get current time" tool?

Some modern models can call tools to request the current date/time.

However, tool calls are not the same as ambient runtime context.

A tool call turns time awareness into a separate reasoning step:

  • the model must decide whether it needs the tool;
  • call it correctly;
  • wait for the result;
  • and then continue generation.

This is not always reliable.
A model may fail to call the time tool because it already believes the user's question refers to the future.

For example, when asked about hardware released after the model's training cutoff, it may answer:

"This is hypothetical. If such a GPU model appears in the future..."

instead of using tools to discover that the hardware already exists.

MistByte Time Injector provides lightweight always-available temporal context instead: the model simply "lives" in the current date/time during normal conversation.

This does not replace tools for precise time-sensitive tasks, but it gives the model a stable temporal anchor before it decides whether tools are needed.


Why not just rely on the model to "guess"?

Because models are not reliable at this.

Even if the model can interpret the time, it still needs an external anchor. Otherwise it may hallucinate the year, refuse modern topics, or shift dates.


License

MIT