Skip to content

v2.2.0

Choose a tag to compare

@SmetDenis SmetDenis released this 22 Jul 11:29
· 28 commits to main since this release
ef163e6
  • Fixed Anthropic cache double-counting behind a proxy (LiteLLM, etc.). Some proxies fold Anthropic's cache tokens into prompt_tokens while still reporting the top-level cache_read_input_tokens / cache_creation_input_tokens; the plugin previously treated those as additional to input, inflating both the total token count and the estimated cost (roughly doubling the cached portion). Cache accounting is now unified around an uncached fresh_input: cache is detected as a subset of input (OpenAI / DeepSeek / Gemini / Anthropic-via-proxy) or on top of it (native Anthropic), so totals and estimated cost match regardless of how the same call is routed. Provider-reported (auto) cost was never affected.
  • Richer debug_mode payload for troubleshooting model/cost issues (still copyable via the "Token Usage & Cost Display - Debug info" source + server log; the visible stats line is unchanged). Four new blocks:
    • model — sanitized, safe-to-share identity of the selected model: id/name/base_model_id, owned_by, connection_type, provider, preset/is_pipe/has_url_idx, a best-effort provider_guess, the function_calling mode and other OWUI params. Uses a strict whitelist, so no prompt text, user/session ids, access grants, base URLs or API keys ever appear. Generation params (temperature/top_p/…) are marked unavailable on purpose — Open WebUI strips them before the filter runs.
    • cost_debug — why the cost came out the way it did: the cost_mode, whether a native provider cost was found (and from which key), the resolved price source (price_map/models.dev/static/none) with the exact matched key (null is the tell-tale for an id that matches no price entry), the applied per-1M rates, and a full per-component breakdown (billable input, cached, cache-write, output → USD each).
    • context_debug — how the context-window size was resolved (override/num_ctx/user_map/models.dev/static_table/probe) and which key matched, plus size/used/percent.
    • valves — a snapshot of the current admin configuration to reproduce issues from a single payload; the two optional local-backend URLs (llamacpp_url, llama_swap_url) are masked.