Add optional Gemini context caching and cache usage accounting

This commit is contained in:
Nico committed 2026-10-16 14:57:33 +02:00
1 parent 61138955ec
commit 4142e2dc2b
16 files changed
+965 -20

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
# Optional separate configuration. Copy to an ignored *.local.toml file.
# This does not replace the existing OpenAI-compatible configuration.
[llm]
privacy_profile = "cloud_allowed"
max_attempts = 10
retry_delay_seconds = 60
blocked_retry_seconds = 3600
[[llm.providers]]
id = "gemini-native"
adapter = "gemini"
privacy = "cloud"
base_url = "https://generativelanguage.googleapis.com/v1beta"
model = "gemini-3.8-flash"
api_key_env = "GEMINI_API_KEY"
timeout_seconds = 300
response_format = "json_object"
max_output_tokens = 16384
reasoning_effort = "medium"
entity_resolution_reasoning_effort = "low"
# Opt-in. Instruction/schema prefix only; live evidence is always complete.
context_cache = true
cache_ttl_seconds = 300
# A character heuristic, not a tokenizer or a format limit. Provider minimums
# still apply; rejected/too-small cache requests fall back to the full input.
cache_min_prefix_chars = 16000
# Optional estimates in USD per million tokens; verify your model/tariff/date.
# These illustrative standard-tier rates are from 2026-10-16, valid through
# 2026-12-31 for the model above, not universal/default prices.
input_cost_per_million = 0.75
cached_input_cost_per_million = 0.075
output_cost_per_million = 3.75
cache_storage_cost_per_million_hour = 0.50