-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
94 lines (79 loc) · 2.6 KB
/
Copy pathconfig.example.yaml
File metadata and controls
94 lines (79 loc) · 2.6 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
86
87
88
89
90
91
92
93
94
# API Optimizer Configuration
# Copy this file to config.yaml and customize
# API Keys - Using OpenRouter as unified provider
# OpenRouter provides access to all models through a single API key
api_keys:
# OpenRouter API key (recommended - unified access to all models)
openrouter: "${OPENROUTER_API_KEY}" # Get from https://openrouter.ai/keys
# Direct provider keys (optional, if not using OpenRouter)
# openai: "${OPENAI_API_KEY}"
# anthropic: "${ANTHROPIC_API_KEY}"
# OpenRouter Configuration
openrouter:
api_base: "https://openrouter.ai/api/v1"
extra_headers:
HTTP-Referer: "https://agent-zero.ai/"
X-Title: "Agent Zero"
# Response Cache Settings
cache:
enabled: true
backend: "sqlite" # sqlite or memory
db_path: ".api_optimizer/cache.db"
default_ttl: 3600 # seconds (1 hour)
max_entries: 10000
semantic_matching:
enabled: true
threshold: 0.92 # similarity threshold (0-1)
embedding_model: "openai/text-embedding-3-small" # via OpenRouter
# Model Router Settings
router:
enabled: true
default_model: "openai/gpt-4o-mini" # Cheap default for simple tasks
cost_optimization: true
# Model preferences by complexity (using OpenRouter model names)
complexity_routing:
simple:
preferred: "openai/gpt-4o-mini" # Fast & cheap ($0.15/$0.60 per 1M)
fallback: "anthropic/claude-3.5-haiku"
medium:
preferred: "openai/gpt-4o-mini" # Still cost-effective
fallback: "anthropic/claude-3.5-sonnet"
complex:
preferred: "anthropic/claude-opus-4.5" # Best reasoning
fallback: "openai/gpt-4o"
critical:
preferred: "anthropic/claude-opus-4.5" # Maximum capability
fallback: "openai/gpt-4o"
# Cost limits
max_cost_per_request: 1.00 # USD, null for unlimited
# Cost Monitor Settings
monitor:
enabled: true
db_path: ".api_optimizer/usage.db"
# Budget alerts (USD)
budgets:
daily: 10.00
weekly: 50.00
monthly: 150.00
# Hard caps - requests blocked when exceeded
hard_caps:
daily: 20.00
weekly: 100.00
monthly: 300.00
# Alert callbacks (optional)
alert_webhook: null # URL to POST alerts to
alert_email: null # Email for alerts
# Prompt Optimizer Settings
optimizer:
enabled: true
# Optimization features
remove_redundant_phrases: true
normalize_whitespace: true
compress_examples: false # Summarize long examples
# Token estimation
warn_threshold: 4000 # Warn if prompt exceeds this
max_tokens: 100000 # Error if prompt exceeds this
# Logging
logging:
level: "INFO" # DEBUG, INFO, WARNING, ERROR
file: null # Log file path, null for stdout only