Repository navigation
Expand file tree
/
Copy pathconfig.example.toml
More file actions
60 lines (51 loc) · 2.34 KB
/
Copy pathconfig.example.toml
File metadata and controls
60 lines (51 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# tokenwarden configuration — copy to config.toml and edit.
# Secrets (notifier tokens) come from environment variables, NEVER this file.
[gateway]
upstream_url = "https://api.anthropic.com"
host = "127.0.0.1"
port = 8788
timezone = "America/New_York" # daily budgets reset at local midnight here
db_path = "tokenwarden.db"
agent_header = "x-watchdog-agent" # agents set this header to identify themselves
enforce = false # true => 429 on over-budget requests (default: observe-only)
debug_log_bodies = false # true => log request/response bodies (privacy: keep off)
[thresholds]
warn_pct = 80
critical_pct = 100
[notifier]
# Channels to alert on. Secrets come from env vars, NEVER this file:
# discord -> TOKENWARDEN_DISCORD_WEBHOOK_URL
# telegram -> TOKENWARDEN_TELEGRAM_BOT_TOKEN, TOKENWARDEN_TELEGRAM_CHAT_ID
# (optional TOKENWARDEN_TELEGRAM_THREAD_ID targets a forum topic/thread)
# Leave empty ([]) to log-only without sending anywhere.
channels = ["discord"]
# Estimated dollars are computed from this table (USD per 1M tokens).
# Defaults ship in code for current models; override here whenever Anthropic
# changes pricing. cache_read / cache_write default to 0.1x / 1.25x of input.
[prices.claude-opus-4-8]
input = 5.0
output = 25.0
[prices.claude-sonnet-4-6]
input = 3.0
output = 15.0
[prices.claude-haiku-4-5]
input = 1.0
output = 5.0
[budgets]
global_daily = 50.0
default_agent_daily = 10.0 # applied to any agent without a specific budget
[budgets.per_agent_daily]
# forge = 20.0
# scout = 5.0
# Forward-looking spend forecasting for `tokenwarden forecast` (optional, off by
# default). Runs as a separate offline reader of the spend log — never in the
# gateway request path. The "timesfm" backend needs the optional extra:
# pip install "tokenwarden[forecast]" (pulls in torch — heavy, opt-in only)
[forecasting]
enabled = false
backend = "naive" # "naive" (stdlib baseline) | "timesfm" (zero-shot TimesFM 2.5)
lookback_days = 14 # how much history to feed the model
quantile = 0.9 # band edge used for overrun warnings + anomaly detection
min_history_hours = 48 # below this, forecasts are flagged low-confidence
anomaly_factor = 1.5 # actual > this × the forecast band => runaway-agent flag
# checkpoint = "google/timesfm-2.5-200m-pytorch" # timesfm model id