-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy-config.yaml
More file actions
85 lines (72 loc) · 2.51 KB
/
proxy-config.yaml
File metadata and controls
85 lines (72 loc) · 2.51 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Proxy Server
#
# This config is for proxy instances that route requests to LLM providers.
# Run: ./tokenomics serve
#
# Tokens are synced from the central config server on startup, via push
# webhooks (sub-second), and via polling every 5 minutes as a safety net.
# Provider API keys must be set as environment variables on this machine.
server:
http_port: 8080
https_port: 8443
upstream_url: https://api.openai.com
tls:
enabled: true
auto_gen: true
cert_dir: ./certs
storage:
db_path: ./tokenomics.db
session:
backend: memory
# For shared usage tracking across multiple proxy instances, use Redis:
# backend: redis
# redis:
# addr: redis.internal:6379
# password: ""
# db: 0
security:
hash_key_env: TOKENOMICS_HASH_KEY
encryption_key_env: TOKENOMICS_ENCRYPTION_KEY
logging:
level: info
format: json
hide_token_hash: false
# ── Remote Token Sync ──────────────────────────────────────────────────
# Point to the central config server. Tokens are fetched on startup.
# Push: the webhook receiver accepts token events from the central server
# for immediate sync. Poll: fallback sync every 300 seconds.
remote:
url: http://config-server:9090
api_key: change-me-to-match-remote-server
sync: 300
insecure: false
webhook:
enabled: true
path: /v1/webhook
secret: change-me-webhook-secret
signing_key: change-me-signing-key
# ── Webhook Events ─────────────────────────────────────────────────────
# Send alerts to your monitoring stack. Uncomment and configure.
events:
webhooks:
# All events for debugging
- url: http://localhost:9090/webhook
secret: change-me-webhook-secret
signing_key: change-me-signing-key
timeout: 10
# Alert channel for violations and budget overruns
# - url: https://hooks.slack.com/services/T.../B.../xxx
# secret: slack-webhook-secret
# events:
# - "rule.violation"
# - "budget.exceeded"
# - "rate.exceeded"
# - "token.expired"
# ── CLI Provider Mapping ──────────────────────────────────────────────
# Maps CLI tool names to provider configs for the init command.
cli_maps:
claude: anthropic
anthropic: anthropic
cursor: openai
python: generic
node: generic