-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmartproxy.yaml.example
More file actions
153 lines (134 loc) · 3.18 KB
/
Copy pathsmartproxy.yaml.example
File metadata and controls
153 lines (134 loc) · 3.18 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
version: 1
listen: "127.0.0.1:4100"
admin_listen: "127.0.0.1:4101"
server:
shutdown_timeout: 30s
read_timeout: 120s
write_timeout: 120s
read_header_timeout: 15s
max_body_bytes: 20971520
max_concurrent_upstream: 0
database:
path: "~/.smartproxy/smartproxy.db"
retention_days: 90
providers:
- name: deepseek
type: openai
base_url: "https://api.deepseek.com/v1"
api_key_env: DEEPSEEK_API_KEY
max_idle_conns_per_host: 10
max_conns_per_host: 0
- name: openai
type: openai
base_url: "https://api.openai.com/v1"
api_key_env: OPENAI_API_KEY
- name: anthropic
type: anthropic
base_url: "https://api.anthropic.com"
api_key_env: ANTHROPIC_API_KEY
anthropic_version: "2023-06-01"
targets:
- name: deepseek-flash
enabled: true
provider: deepseek
model: "deepseek-chat"
timeout: 120s
max_retries: 2
max_context: 64000
required_capabilities: [chat, stream, tools]
- name: gpt-mini
enabled: true
provider: openai
model: "gpt-4o-mini"
timeout: 120s
max_retries: 2
max_context: 128000
required_capabilities: [chat, stream, tools, vision]
- name: claude-sonnet
enabled: true
provider: anthropic
model: "claude-sonnet-4-20250514"
timeout: 120s
max_retries: 2
max_context: 200000
required_capabilities: [chat, stream, tools, vision]
model_aliases:
claude-sonnet: "claude-sonnet-4-20250514"
cheap: "deepseek-chat"
routes:
- name: vision-to-claude
endpoints: ["/v1/chat/completions"]
strategy: priority
match:
has_images: true
targets: [claude-sonnet, gpt-mini]
- name: cheap-text-default
endpoints: ["/v1/chat/completions"]
strategy: priority
cache:
enabled: true
ttl: 30m
targets: [deepseek-flash, gpt-mini, claude-sonnet]
failover:
on_status: [408, 409, 425, 429, 500, 502, 503, 504]
on_timeout: true
backoff_base: 250ms
backoff_max: 5s
respect_retry_after: true
circuit_breaker:
error_threshold: 3
success_threshold: 2
min_requests: 3
window: 60s
sleep_window: 30s
jitter: 0.2
half_open_max_requests: 1
streaming:
mid_stream_policy: close
client_notice_text: "\n\n[smartproxy: upstream stream interrupted]"
notice_for_tool_calls: false
cache:
enabled: false
ttl: 1h
max_size_mb: 500
max_entries: 100000
gzip: true
encrypt: false
encryption_key_env: SMARTPROXY_CACHE_KEY
budget:
daily_limit_usd: 10.0
monthly_limit_usd: 200.0
session_limit_usd: 0
alert_at_percent: 80
action: stop
pricing:
unknown_model:
mode: estimate
input_per_million: 2.0
output_per_million: 8.0
overrides:
my-custom-model:
input_per_million: 1.0
output_per_million: 5.0
observability:
level: info
log_format: text
response_headers: true
log_prompts: false
log_responses: false
redact_secrets: true
metrics:
enabled: false
security:
allow_client_authorization_passthrough: false
admin_bind_required_loopback: true
tls:
enabled: false
cert_file: ""
key_file: ""
admin_auth:
api_key_env: SMARTPROXY_ADMIN_API_KEY
client_auth:
mode: loopback_optional
api_key_env: SMARTPROXY_API_KEY
require_for_non_loopback: true