-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
262 lines (228 loc) · 7.68 KB
/
Copy pathconfig.yml
File metadata and controls
262 lines (228 loc) · 7.68 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# LiteLLM Proxy Configuration
# Documentation: https://docs.litellm.ai/docs/proxy/configs
# Model configurations with proper naming and fallback support
model_list:
# Local models (primary)
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_base: http://localhost:3006/v1
api_key: dummy_key
rpm: 120
timeout: 50
model_info:
mode: chat
max_tokens: 128000
# - model_name: qwen-3-4b
# litellm_params:
# model: lm_studio/qwen/qwen3-4b-2507
# api_base: http://localhost:1234/v1
# api_key: dummy_key
# rpm: 120
# timeout: 50
# model_info:
# mode: chat
# max_tokens: 128000
- model_name: gpt-4.1
litellm_params:
model: openai/gpt-4.1
api_base: http://localhost:3006/v1
api_key: dummy_key
rpm: 120
timeout: 50
model_info:
mode: chat
max_tokens: 128000
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_base: http://localhost:3007/v1
api_key: dummy_key
rpm: 120
timeout: 50
model_info:
mode: chat
max_tokens: 128000
# Free models from OpenRouter with proper names
- model_name: deepseek-chat-v3.1-free
litellm_params:
model: openrouter/deepseek/deepseek-chat-v3.1:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: grok-4-fast-free
litellm_params:
model: openrouter/x-ai/grok-4-fast:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: nemotron-nano-9b-v2-free
litellm_params:
model: openrouter/nvidia/nemotron-nano-9b-v2:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: mistral-small-3.2-24b-instruct-free
litellm_params:
model: openrouter/mistralai/mistral-small-3.2-24b-instruct:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: llama-3.3-8b-instruct-free
litellm_params:
model: openrouter/meta-llama/llama-3.3-8b-instruct:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: qwen3-4b-free
litellm_params:
model: openrouter/qwen/qwen3-4b:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: qwen3-30b-a3b-free
litellm_params:
model: openrouter/qwen/qwen3-30b-a3b:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: qwen3-8b-free
litellm_params:
model: openrouter/qwen/qwen3-8b:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
- model_name: llama-4-maverick-free
litellm_params:
model: openrouter/meta-llama/llama-4-maverick:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 120
timeout: 50
model_info:
mode: chat
# Vision-capable models
- model_name: qwen-vl
litellm_params:
model: openrouter/qwen/qwen2.5-vl-72b-instruct:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 20
timeout: 50
model_info:
mode: chat
max_tokens: 128000
- model_name: qwen-vl
litellm_params:
model: openrouter/qwen/qwen2.5-vl-72b-instruct:free
api_key: os.environ/OPENROUTER_API_KEY
api_base: os.environ/OPENROUTER_API_BASE
rpm: 20
timeout: 50
model_info:
mode: chat
max_tokens: 128000
- model_name: qwen-vl
litellm_params:
model: lm_studio/qwen2.5-vl-3b-instruct
api_base: http://localhost:1234/v1
rpm: 20
timeout: 50
model_info:
mode: chat
max_tokens: 128000
# LiteLLM settings
litellm_settings:
drop_params: true # Drop unsupported params instead of failing
max_budget: 1000 # Max budget in USD
telemetry: false # Disable telemetry
set_verbose: false # Set to true for debugging
# Retry configuration
num_retries: 3
retry_after: 5 # Wait 5 seconds between retries
max_retries: 3
request_timeout: 120 # Global timeout
# Caching
cache: true
cache_params:
type: "local" # or "redis" for distributed cache
ttl: 3600 # Cache for 1 hour
# Router settings for load balancing
router_settings:
routing_strategy: "least-busy" # Options: simple-shuffle, least-busy, usage-based-routing, latency-based-routing
num_retries: 3
retry_after: 5
timeout: 120
# Model fallback configuration
# These fallbacks will be used when a model fails or is unavailable
model_fallbacks:
# Primary GPT-4 models with fallback chains
gpt-4o: ["grok-4-fast-free", "deepseek-chat-v3.1-free", "mistral-small-3.2-24b-instruct-free", "llama-3.3-8b-instruct-free", "qwen3-8b-free", "qwen3-4b-free", "nemotron-nano-9b-v2-free"]
gpt-4.1: ["gpt-4o", "grok-4-fast-free", "deepseek-chat-v3.1-free"]
# Free tier models with their own fallback chains
grok-4-fast-free: ["deepseek-chat-v3.1-free", "mistral-small-3.2-24b-instruct-free", "llama-3.3-8b-instruct-free"]
deepseek-chat-v3.1-free: ["grok-4-fast-free", "mistral-small-3.2-24b-instruct-free", "llama-4-maverick-free"]
mistral-small-3.2-24b-instruct-free: ["llama-3.3-8b-instruct-free", "qwen3-30b-a3b-free", "qwen3-8b-free"]
llama-3.3-8b-instruct-free: ["llama-4-maverick-free", "qwen3-8b-free", "nemotron-nano-9b-v2-free"]
llama-4-maverick-free: ["llama-3.3-8b-instruct-free", "qwen3-30b-a3b-free"]
# Qwen models fallback chain
qwen3-30b-a3b-free: ["qwen3-8b-free", "qwen3-4b-free", "nemotron-nano-9b-v2-free"]
qwen3-8b-free: ["qwen3-30b-a3b-free", "qwen3-4b-free", "llama-3.3-8b-instruct-free"]
qwen3-4b-free: ["qwen3-8b-free", "nemotron-nano-9b-v2-free"]
# Smaller model fallbacks
nemotron-nano-9b-v2-free: ["qwen3-4b-free", "qwen3-8b-free"]
# Vision models fallback chain (if one fails, try others)
qwen-vl: ["qwen-vl"] # Will cycle through all available qwen-vl endpoints
# Redis configuration (optional, for distributed load balancing)
# redis_host: "localhost"
# redis_port: 6379
# redis_password: "your_redis_password"
# General proxy settings
general_settings:
# Master key for admin access (generate with: openssl rand -hex 32)
# Database for usage tracking (optional)
# database_url: "postgresql://user:password@localhost:5432/litellm"
# Proxy server settings
max_parallel_requests: 300
infer_model_from_keys: true
background_health_checks: true
health_check_interval: 300 # Check every 5 minutes
# Custom auth
# custom_auth: "your_custom_auth_function"
# Alerting (optional)
# alerting: ["slack"]
# alerting_threshold: 10 # Alert after 10 failures
# Pass through endpoints (optional)
# pass_through_endpoints:
# - path: "/v1/completions"
# target: "https://api.openai.com/v1/completions"
# headers:
# Authorization: "Bearer os.environ/OPENAI_API_KEY"
# Environment variables (optional, can also be set in Docker/system)
environment_variables:
OPENROUTER_API_BASE: "https://openrouter.ai/api/v1"
# Add other environment variables as needed