Class: LiteLLMClient::HealthApi

Inherits:
Object
  • Object
show all
Defined in:
lib/litellm_client/api/health_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ HealthApi

Returns a new instance of HealthApi.



19
20
21
# File 'lib/litellm_client/api/health_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/litellm_client/api/health_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#active_callbacks_active_callbacks_get(opts = {}) ⇒ Object

Active Callbacks Returns a list of litellm level settings This is useful for debugging and ensuring the proxy server is configured correctly. Response schema: β€œβ€˜ { "alerting": _alerting, "litellm.callbacks": litellm_callbacks, "litellm.input_callback": litellm_input_callbacks, "litellm.failure_callback": litellm_failure_callbacks, "litellm.success_callback": litellm_success_callbacks, "litellm._async_success_callback": litellm_async_success_callbacks, "litellm._async_failure_callback": litellm_async_failure_callbacks, "litellm._async_input_callback": litellm_async_input_callbacks, "all_litellm_callbacks": all_litellm_callbacks, "num_callbacks": len(all_litellm_callbacks), "num_alerting": _num_alerting, "litellm.request_timeout": litellm.request_timeout, } β€œ`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


26
27
28
29
# File 'lib/litellm_client/api/health_api.rb', line 26

def active_callbacks_active_callbacks_get(opts = {})
  data, _status_code, _headers = active_callbacks_active_callbacks_get_with_http_info(opts)
  data
end

#active_callbacks_active_callbacks_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Active Callbacks Returns a list of litellm level settings This is useful for debugging and ensuring the proxy server is configured correctly. Response schema: &#x60;&#x60;&#x60; { &quot;alerting&quot;: _alerting, &quot;litellm.callbacks&quot;: litellm_callbacks, &quot;litellm.input_callback&quot;: litellm_input_callbacks, &quot;litellm.failure_callback&quot;: litellm_failure_callbacks, &quot;litellm.success_callback&quot;: litellm_success_callbacks, &quot;litellm._async_success_callback&quot;: litellm_async_success_callbacks, &quot;litellm._async_failure_callback&quot;: litellm_async_failure_callbacks, &quot;litellm._async_input_callback&quot;: litellm_async_input_callbacks, &quot;all_litellm_callbacks&quot;: all_litellm_callbacks, &quot;num_callbacks&quot;: len(all_litellm_callbacks), &quot;num_alerting&quot;: _num_alerting, &quot;litellm.request_timeout&quot;: litellm.request_timeout, } &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/health_api.rb', line 35

def active_callbacks_active_callbacks_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.active_callbacks_active_callbacks_get ...'
  end
  # resource path
  local_var_path = '/active/callbacks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.active_callbacks_active_callbacks_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#active_callbacks_active_callbacks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#active_callbacks_settings_get(opts = {}) ⇒ Object

Active Callbacks Returns a list of litellm level settings This is useful for debugging and ensuring the proxy server is configured correctly. Response schema: β€œβ€˜ { "alerting": _alerting, "litellm.callbacks": litellm_callbacks, "litellm.input_callback": litellm_input_callbacks, "litellm.failure_callback": litellm_failure_callbacks, "litellm.success_callback": litellm_success_callbacks, "litellm._async_success_callback": litellm_async_success_callbacks, "litellm._async_failure_callback": litellm_async_failure_callbacks, "litellm._async_input_callback": litellm_async_input_callbacks, "all_litellm_callbacks": all_litellm_callbacks, "num_callbacks": len(all_litellm_callbacks), "num_alerting": _num_alerting, "litellm.request_timeout": litellm.request_timeout, } β€œ`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


83
84
85
86
# File 'lib/litellm_client/api/health_api.rb', line 83

def active_callbacks_settings_get(opts = {})
  data, _status_code, _headers = active_callbacks_settings_get_with_http_info(opts)
  data
end

#active_callbacks_settings_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Active Callbacks Returns a list of litellm level settings This is useful for debugging and ensuring the proxy server is configured correctly. Response schema: &#x60;&#x60;&#x60; { &quot;alerting&quot;: _alerting, &quot;litellm.callbacks&quot;: litellm_callbacks, &quot;litellm.input_callback&quot;: litellm_input_callbacks, &quot;litellm.failure_callback&quot;: litellm_failure_callbacks, &quot;litellm.success_callback&quot;: litellm_success_callbacks, &quot;litellm._async_success_callback&quot;: litellm_async_success_callbacks, &quot;litellm._async_failure_callback&quot;: litellm_async_failure_callbacks, &quot;litellm._async_input_callback&quot;: litellm_async_input_callbacks, &quot;all_litellm_callbacks&quot;: all_litellm_callbacks, &quot;num_callbacks&quot;: len(all_litellm_callbacks), &quot;num_alerting&quot;: _num_alerting, &quot;litellm.request_timeout&quot;: litellm.request_timeout, } &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/health_api.rb', line 92

def active_callbacks_settings_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.active_callbacks_settings_get ...'
  end
  # resource path
  local_var_path = '/settings'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.active_callbacks_settings_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#active_callbacks_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_endpoint_health_get(opts = {}) ⇒ Object

Health Endpoint 🚨 USE β€˜/health/liveliness` to health check the proxy 🚨 See more πŸ‘‰ docs.litellm.ai/docs/proxy/health Check the health of all the endpoints in config.yaml To run health checks in the background, add this to config.yaml: β€œ` general_settings: # … other settings background_health_checks: True β€œ` else, the health checks will be run on models when /health is called.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :model (String)

    Specify the model name (optional)

Returns:

  • (Object)


141
142
143
144
# File 'lib/litellm_client/api/health_api.rb', line 141

def health_endpoint_health_get(opts = {})
  data, _status_code, _headers = health_endpoint_health_get_with_http_info(opts)
  data
end

#health_endpoint_health_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Endpoint 🚨 USE &#x60;/health/liveliness&#x60; to health check the proxy 🚨 See more πŸ‘‰ docs.litellm.ai/docs/proxy/health Check the health of all the endpoints in config.yaml To run health checks in the background, add this to config.yaml: &#x60;&#x60;&#x60; general_settings: # … other settings background_health_checks: True &#x60;&#x60;&#x60; else, the health checks will be run on models when /health is called.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :model (String)

    Specify the model name (optional)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/health_api.rb', line 151

def health_endpoint_health_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_endpoint_health_get ...'
  end
  # resource path
  local_var_path = '/health'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.health_endpoint_health_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_endpoint_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_liveliness_health_liveliness_get(opts = {}) ⇒ Object

Health Liveliness Unprotected endpoint for checking if worker is alive

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


200
201
202
203
# File 'lib/litellm_client/api/health_api.rb', line 200

def health_liveliness_health_liveliness_get(opts = {})
  data, _status_code, _headers = health_liveliness_health_liveliness_get_with_http_info(opts)
  data
end

#health_liveliness_health_liveliness_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Liveliness Unprotected endpoint for checking if worker is alive

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
# File 'lib/litellm_client/api/health_api.rb', line 209

def health_liveliness_health_liveliness_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_liveliness_health_liveliness_get ...'
  end
  # resource path
  local_var_path = '/health/liveliness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"HealthApi.health_liveliness_health_liveliness_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_liveliness_health_liveliness_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_liveliness_health_liveness_get(opts = {}) ⇒ Object

Health Liveliness Unprotected endpoint for checking if worker is alive

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


257
258
259
260
# File 'lib/litellm_client/api/health_api.rb', line 257

def health_liveliness_health_liveness_get(opts = {})
  data, _status_code, _headers = health_liveliness_health_liveness_get_with_http_info(opts)
  data
end

#health_liveliness_health_liveness_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Liveliness Unprotected endpoint for checking if worker is alive

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/litellm_client/api/health_api.rb', line 266

def health_liveliness_health_liveness_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_liveliness_health_liveness_get ...'
  end
  # resource path
  local_var_path = '/health/liveness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"HealthApi.health_liveliness_health_liveness_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_liveliness_health_liveness_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_liveliness_options_health_liveliness_options(opts = {}) ⇒ Object

Health Liveliness Options Options endpoint for health/liveliness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


314
315
316
317
# File 'lib/litellm_client/api/health_api.rb', line 314

def health_liveliness_options_health_liveliness_options(opts = {})
  data, _status_code, _headers = health_liveliness_options_health_liveliness_options_with_http_info(opts)
  data
end

#health_liveliness_options_health_liveliness_options_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Liveliness Options Options endpoint for health/liveliness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/litellm_client/api/health_api.rb', line 323

def health_liveliness_options_health_liveliness_options_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_liveliness_options_health_liveliness_options ...'
  end
  # resource path
  local_var_path = '/health/liveliness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"HealthApi.health_liveliness_options_health_liveliness_options",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:OPTIONS, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_liveliness_options_health_liveliness_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_liveliness_options_health_liveness_options(opts = {}) ⇒ Object

Health Liveliness Options Options endpoint for health/liveliness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


371
372
373
374
# File 'lib/litellm_client/api/health_api.rb', line 371

def health_liveliness_options_health_liveness_options(opts = {})
  data, _status_code, _headers = health_liveliness_options_health_liveness_options_with_http_info(opts)
  data
end

#health_liveliness_options_health_liveness_options_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Liveliness Options Options endpoint for health/liveliness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/litellm_client/api/health_api.rb', line 380

def health_liveliness_options_health_liveness_options_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_liveliness_options_health_liveness_options ...'
  end
  # resource path
  local_var_path = '/health/liveness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"HealthApi.health_liveliness_options_health_liveness_options",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:OPTIONS, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_liveliness_options_health_liveness_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_readiness_health_readiness_get(opts = {}) ⇒ Object

Health Readiness Unprotected endpoint for checking if worker can receive requests

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


428
429
430
431
# File 'lib/litellm_client/api/health_api.rb', line 428

def health_readiness_health_readiness_get(opts = {})
  data, _status_code, _headers = health_readiness_health_readiness_get_with_http_info(opts)
  data
end

#health_readiness_health_readiness_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Readiness Unprotected endpoint for checking if worker can receive requests

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/litellm_client/api/health_api.rb', line 437

def health_readiness_health_readiness_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_readiness_health_readiness_get ...'
  end
  # resource path
  local_var_path = '/health/readiness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.health_readiness_health_readiness_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_readiness_health_readiness_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_readiness_options_health_readiness_options(opts = {}) ⇒ Object

Health Readiness Options Options endpoint for health/readiness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


485
486
487
488
# File 'lib/litellm_client/api/health_api.rb', line 485

def health_readiness_options_health_readiness_options(opts = {})
  data, _status_code, _headers = health_readiness_options_health_readiness_options_with_http_info(opts)
  data
end

#health_readiness_options_health_readiness_options_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Readiness Options Options endpoint for health/readiness check.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/litellm_client/api/health_api.rb', line 494

def health_readiness_options_health_readiness_options_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_readiness_options_health_readiness_options ...'
  end
  # resource path
  local_var_path = '/health/readiness'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.health_readiness_options_health_readiness_options",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:OPTIONS, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_readiness_options_health_readiness_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_services_endpoint_health_services_get(service, opts = {}) ⇒ Object

Health Services Endpoint Use this admin-only endpoint to check if the service is healthy. Example: β€œβ€˜ curl -L -X GET ’0.0.0.0:4000/health/services?service=datadog’ -H β€˜Authorization: Bearer sk-1234’ β€œβ€˜

Parameters:

  • service (Service)

    Specify the service being hit.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


543
544
545
546
# File 'lib/litellm_client/api/health_api.rb', line 543

def health_services_endpoint_health_services_get(service, opts = {})
  data, _status_code, _headers = health_services_endpoint_health_services_get_with_http_info(service, opts)
  data
end

#health_services_endpoint_health_services_get_with_http_info(service, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Services Endpoint Use this admin-only endpoint to check if the service is healthy. Example: &#x60;&#x60;&#x60; curl -L -X GET &#39;0.0.0.0:4000/health/services?service&#x3D;datadog&#39; -H &#39;Authorization: Bearer sk-1234&#39; &#x60;&#x60;&#x60;

Parameters:

  • service (Service)

    Specify the service being hit.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/litellm_client/api/health_api.rb', line 553

def health_services_endpoint_health_services_get_with_http_info(service, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.health_services_endpoint_health_services_get ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling HealthApi.health_services_endpoint_health_services_get"
  end
  # resource path
  local_var_path = '/health/services'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'service'] = service

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.health_services_endpoint_health_services_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#health_services_endpoint_health_services_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#test_endpoint_test_get(opts = {}) ⇒ Object

Test Endpoint

DEPRECATED

use β€˜/health/liveliness` instead. A test endpoint that pings the proxy server to check if it’s healthy. Parameters: request (Request): The incoming request. Returns: dict: A dictionary containing the route of the request URL.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


606
607
608
609
# File 'lib/litellm_client/api/health_api.rb', line 606

def test_endpoint_test_get(opts = {})
  data, _status_code, _headers = test_endpoint_test_get_with_http_info(opts)
  data
end

#test_endpoint_test_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Test Endpoint

DEPRECATED

use &#x60;/health/liveliness&#x60; instead. A test endpoint that pings the proxy server to check if it&#39;s healthy. Parameters: request (Request): The incoming request. Returns: dict: A dictionary containing the route of the request URL.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/litellm_client/api/health_api.rb', line 615

def test_endpoint_test_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.test_endpoint_test_get ...'
  end
  # resource path
  local_var_path = '/test'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.test_endpoint_test_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#test_endpoint_test_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#test_model_connection_health_test_connection_post(opts = {}) ⇒ Object

Test Model Connection Test a direct connection to a specific model. This endpoint allows you to verify if your proxy can successfully connect to a specific model. It’s useful for troubleshooting model connectivity issues without going through the full proxy routing. Example: β€œβ€˜bash curl -X POST ’localhost:4000/health/test_connection’ \ -H β€˜Authorization: Bearer sk-1234’ \ -H β€˜Content-Type: application/json’ \ -d β€˜{ "litellm_params": { "model": "gpt-4", "custom_llm_provider": "azure_ai", "litellm_credential_name": null, "api_key": "6xxxxxxx", "api_base": "litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21", }, "mode": "chat" }’ β€œβ€˜ Returns: dict: A dictionary containing the health check result with either success information or error details.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Object)


664
665
666
667
# File 'lib/litellm_client/api/health_api.rb', line 664

def test_model_connection_health_test_connection_post(opts = {})
  data, _status_code, _headers = test_model_connection_health_test_connection_post_with_http_info(opts)
  data
end

#test_model_connection_health_test_connection_post_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Test Model Connection Test a direct connection to a specific model. This endpoint allows you to verify if your proxy can successfully connect to a specific model. It&#39;s useful for troubleshooting model connectivity issues without going through the full proxy routing. Example: &#x60;&#x60;&#x60;bash curl -X POST &#39;localhost:4000/health/test_connection&#39; \ -H &#39;Authorization: Bearer sk-1234&#39; \ -H &#39;Content-Type: application/json&#39; \ -d &#39;{ &quot;litellm_params&quot;: { &quot;model&quot;: &quot;gpt-4&quot;, &quot;custom_llm_provider&quot;: &quot;azure_ai&quot;, &quot;litellm_credential_name&quot;: null, &quot;api_key&quot;: &quot;6xxxxxxx&quot;, &quot;api_base&quot;: &quot;litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version&#x3D;2024-10-21&quot;, }, &quot;mode&quot;: &quot;chat&quot; }&#39; &#x60;&#x60;&#x60; Returns: dict: A dictionary containing the health check result with either success information or error details.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/litellm_client/api/health_api.rb', line 674

def test_model_connection_health_test_connection_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HealthApi.test_model_connection_health_test_connection_post ...'
  end
  # resource path
  local_var_path = '/health/test_connection'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body_test_model_connection_health_test_connection_post'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['APIKeyHeader']

  new_options = opts.merge(
    :operation => :"HealthApi.test_model_connection_health_test_connection_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HealthApi#test_model_connection_health_test_connection_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end