Class: LiteLLMClient::FineTuningApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FineTuningApi

Returns a new instance of FineTuningApi.



19
20
21
# File 'lib/litellm_client/api/fine_tuning_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/fine_tuning_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post(fine_tuning_job_id, opts = {}) ⇒ Object

✨ (Enterprise) Cancel Fine-Tuning Jobs Cancel a fine-tuning job. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id/cancel Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `fine_tuning_job_id`: The ID of the fine-tuning job to cancel.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


27
28
29
30
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 27

def cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post(fine_tuning_job_id, opts = {})
  data, _status_code, _headers = cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post_with_http_info(fine_tuning_job_id, opts)
  data
end

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

✨ (Enterprise) Cancel Fine-Tuning Jobs Cancel a fine-tuning job. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id/cancel Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;fine_tuning_job_id&#x60;: The ID of the fine-tuning job to cancel.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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

def cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post_with_http_info(fine_tuning_job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post ...'
  end
  # verify the required parameter 'fine_tuning_job_id' is set
  if @api_client.config.client_side_validation && fine_tuning_job_id.nil?
    fail ArgumentError, "Missing the required parameter 'fine_tuning_job_id' when calling FineTuningApi.cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post"
  end
  # resource path
  local_var_path = '/fine_tuning/jobs/{fine_tuning_job_id}/cancel'.sub('{' + 'fine_tuning_job_id' + '}', CGI.escape(fine_tuning_job_id.to_s))

  # 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 => :"FineTuningApi.cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_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: FineTuningApi#cancel_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post(fine_tuning_job_id, opts = {}) ⇒ Object

✨ (Enterprise) Cancel Fine-Tuning Jobs Cancel a fine-tuning job. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id/cancel Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `fine_tuning_job_id`: The ID of the fine-tuning job to cancel.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


90
91
92
93
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 90

def cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post(fine_tuning_job_id, opts = {})
  data, _status_code, _headers = cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post_with_http_info(fine_tuning_job_id, opts)
  data
end

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

✨ (Enterprise) Cancel Fine-Tuning Jobs Cancel a fine-tuning job. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id/cancel Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;fine_tuning_job_id&#x60;: The ID of the fine-tuning job to cancel.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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

def cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post_with_http_info(fine_tuning_job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post ...'
  end
  # verify the required parameter 'fine_tuning_job_id' is set
  if @api_client.config.client_side_validation && fine_tuning_job_id.nil?
    fail ArgumentError, "Missing the required parameter 'fine_tuning_job_id' when calling FineTuningApi.cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post"
  end
  # resource path
  local_var_path = '/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel'.sub('{' + 'fine_tuning_job_id' + '}', CGI.escape(fine_tuning_job_id.to_s))

  # 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 => :"FineTuningApi.cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_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: FineTuningApi#cancel_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fine_tuning_job_fine_tuning_jobs_post(lite_llm_fine_tuning_job_create, opts = {}) ⇒ Object

✨ (Enterprise) Create Fine-Tuning Job Creates a fine-tuning job which begins the process of creating a new model from a given dataset. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs Supports Identical Params as: platform.openai.com/docs/api-reference/fine-tuning/create Example Curl: “‘ curl localhost:4000/v1/fine_tuning/jobs -H "Content-Type: application/json" -H "Authorization: Bearer sk-1234" -d ’{ "model": "gpt-3.5-turbo", "training_file": "file-abc123", "hyperparameters": { "n_epochs": 4 } }‘ “`

Parameters:

Returns:

  • (Object)


153
154
155
156
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 153

def create_fine_tuning_job_fine_tuning_jobs_post(lite_llm_fine_tuning_job_create, opts = {})
  data, _status_code, _headers = create_fine_tuning_job_fine_tuning_jobs_post_with_http_info(lite_llm_fine_tuning_job_create, opts)
  data
end

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

✨ (Enterprise) Create Fine-Tuning Job Creates a fine-tuning job which begins the process of creating a new model from a given dataset. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs Supports Identical Params as: platform.openai.com/docs/api-reference/fine-tuning/create Example Curl: &#x60;&#x60;&#x60; curl localhost:4000/v1/fine_tuning/jobs -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Bearer sk-1234&quot; -d &#39;{ &quot;model&quot;: &quot;gpt-3.5-turbo&quot;, &quot;training_file&quot;: &quot;file-abc123&quot;, &quot;hyperparameters&quot;: { &quot;n_epochs&quot;: 4 } }&#39; &#x60;&#x60;&#x60;

Parameters:

Returns:

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

    Object data, response status code and response headers



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

def create_fine_tuning_job_fine_tuning_jobs_post_with_http_info(lite_llm_fine_tuning_job_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.create_fine_tuning_job_fine_tuning_jobs_post ...'
  end
  # verify the required parameter 'lite_llm_fine_tuning_job_create' is set
  if @api_client.config.client_side_validation && lite_llm_fine_tuning_job_create.nil?
    fail ArgumentError, "Missing the required parameter 'lite_llm_fine_tuning_job_create' when calling FineTuningApi.create_fine_tuning_job_fine_tuning_jobs_post"
  end
  # resource path
  local_var_path = '/fine_tuning/jobs'

  # 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(lite_llm_fine_tuning_job_create)

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

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

  new_options = opts.merge(
    :operation => :"FineTuningApi.create_fine_tuning_job_fine_tuning_jobs_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: FineTuningApi#create_fine_tuning_job_fine_tuning_jobs_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fine_tuning_job_v1_fine_tuning_jobs_post(lite_llm_fine_tuning_job_create, opts = {}) ⇒ Object

✨ (Enterprise) Create Fine-Tuning Job Creates a fine-tuning job which begins the process of creating a new model from a given dataset. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs Supports Identical Params as: platform.openai.com/docs/api-reference/fine-tuning/create Example Curl: “‘ curl localhost:4000/v1/fine_tuning/jobs -H "Content-Type: application/json" -H "Authorization: Bearer sk-1234" -d ’{ "model": "gpt-3.5-turbo", "training_file": "file-abc123", "hyperparameters": { "n_epochs": 4 } }‘ “`

Parameters:

Returns:

  • (Object)


221
222
223
224
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 221

def create_fine_tuning_job_v1_fine_tuning_jobs_post(lite_llm_fine_tuning_job_create, opts = {})
  data, _status_code, _headers = create_fine_tuning_job_v1_fine_tuning_jobs_post_with_http_info(lite_llm_fine_tuning_job_create, opts)
  data
end

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

✨ (Enterprise) Create Fine-Tuning Job Creates a fine-tuning job which begins the process of creating a new model from a given dataset. This is the equivalent of POST api.openai.com/v1/fine_tuning/jobs Supports Identical Params as: platform.openai.com/docs/api-reference/fine-tuning/create Example Curl: &#x60;&#x60;&#x60; curl localhost:4000/v1/fine_tuning/jobs -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Bearer sk-1234&quot; -d &#39;{ &quot;model&quot;: &quot;gpt-3.5-turbo&quot;, &quot;training_file&quot;: &quot;file-abc123&quot;, &quot;hyperparameters&quot;: { &quot;n_epochs&quot;: 4 } }&#39; &#x60;&#x60;&#x60;

Parameters:

Returns:

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

    Object data, response status code and response headers



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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 231

def create_fine_tuning_job_v1_fine_tuning_jobs_post_with_http_info(lite_llm_fine_tuning_job_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.create_fine_tuning_job_v1_fine_tuning_jobs_post ...'
  end
  # verify the required parameter 'lite_llm_fine_tuning_job_create' is set
  if @api_client.config.client_side_validation && lite_llm_fine_tuning_job_create.nil?
    fail ArgumentError, "Missing the required parameter 'lite_llm_fine_tuning_job_create' when calling FineTuningApi.create_fine_tuning_job_v1_fine_tuning_jobs_post"
  end
  # resource path
  local_var_path = '/v1/fine_tuning/jobs'

  # 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(lite_llm_fine_tuning_job_create)

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

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

  new_options = opts.merge(
    :operation => :"FineTuningApi.create_fine_tuning_job_v1_fine_tuning_jobs_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: FineTuningApi#create_fine_tuning_job_v1_fine_tuning_jobs_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fine_tuning_jobs_fine_tuning_jobs_get(opts = {}) ⇒ Object

✨ (Enterprise) List Fine-Tuning Jobs Lists fine-tuning jobs for the organization. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `after`: Identifier for the last job from the previous pagination request. - `limit`: Number of fine-tuning jobs to retrieve (default is 20).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)
  • :target_model_names (String)

    Comma separated list of model names to filter by. Example: &#39;gpt-4o,gpt-4o-mini&#39;

  • :after (String)
  • :limit (Integer)

Returns:

  • (Object)


292
293
294
295
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 292

def list_fine_tuning_jobs_fine_tuning_jobs_get(opts = {})
  data, _status_code, _headers = list_fine_tuning_jobs_fine_tuning_jobs_get_with_http_info(opts)
  data
end

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

✨ (Enterprise) List Fine-Tuning Jobs Lists fine-tuning jobs for the organization. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;after&#x60;: Identifier for the last job from the previous pagination request. - &#x60;limit&#x60;: Number of fine-tuning jobs to retrieve (default is 20).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)
  • :target_model_names (String)

    Comma separated list of model names to filter by. Example: &#39;gpt-4o,gpt-4o-mini&#39;

  • :after (String)
  • :limit (Integer)

Returns:

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

    Object data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
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
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 305

def list_fine_tuning_jobs_fine_tuning_jobs_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.list_fine_tuning_jobs_fine_tuning_jobs_get ...'
  end
  allowable_values = ["openai", "azure"]
  if @api_client.config.client_side_validation && opts[:'custom_llm_provider'] && !allowable_values.include?(opts[:'custom_llm_provider'])
    fail ArgumentError, "invalid value for \"custom_llm_provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fine_tuning/jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'custom_llm_provider'] = opts[:'custom_llm_provider'] if !opts[:'custom_llm_provider'].nil?
  query_params[:'target_model_names'] = opts[:'target_model_names'] if !opts[:'target_model_names'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => :"FineTuningApi.list_fine_tuning_jobs_fine_tuning_jobs_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: FineTuningApi#list_fine_tuning_jobs_fine_tuning_jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fine_tuning_jobs_v1_fine_tuning_jobs_get(opts = {}) ⇒ Object

✨ (Enterprise) List Fine-Tuning Jobs Lists fine-tuning jobs for the organization. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `after`: Identifier for the last job from the previous pagination request. - `limit`: Number of fine-tuning jobs to retrieve (default is 20).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)
  • :target_model_names (String)

    Comma separated list of model names to filter by. Example: &#39;gpt-4o,gpt-4o-mini&#39;

  • :after (String)
  • :limit (Integer)

Returns:

  • (Object)


365
366
367
368
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 365

def list_fine_tuning_jobs_v1_fine_tuning_jobs_get(opts = {})
  data, _status_code, _headers = list_fine_tuning_jobs_v1_fine_tuning_jobs_get_with_http_info(opts)
  data
end

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

✨ (Enterprise) List Fine-Tuning Jobs Lists fine-tuning jobs for the organization. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;after&#x60;: Identifier for the last job from the previous pagination request. - &#x60;limit&#x60;: Number of fine-tuning jobs to retrieve (default is 20).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)
  • :target_model_names (String)

    Comma separated list of model names to filter by. Example: &#39;gpt-4o,gpt-4o-mini&#39;

  • :after (String)
  • :limit (Integer)

Returns:

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

    Object data, response status code and response headers



378
379
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
423
424
425
426
427
428
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 378

def list_fine_tuning_jobs_v1_fine_tuning_jobs_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.list_fine_tuning_jobs_v1_fine_tuning_jobs_get ...'
  end
  allowable_values = ["openai", "azure"]
  if @api_client.config.client_side_validation && opts[:'custom_llm_provider'] && !allowable_values.include?(opts[:'custom_llm_provider'])
    fail ArgumentError, "invalid value for \"custom_llm_provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/fine_tuning/jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'custom_llm_provider'] = opts[:'custom_llm_provider'] if !opts[:'custom_llm_provider'].nil?
  query_params[:'target_model_names'] = opts[:'target_model_names'] if !opts[:'target_model_names'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => :"FineTuningApi.list_fine_tuning_jobs_v1_fine_tuning_jobs_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: FineTuningApi#list_fine_tuning_jobs_v1_fine_tuning_jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get(fine_tuning_job_id, opts = {}) ⇒ Object

✨ (Enterprise) Retrieve Fine-Tuning Job Retrieves a fine-tuning job. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `fine_tuning_job_id`: The ID of the fine-tuning job to retrieve.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)

Returns:

  • (Object)


436
437
438
439
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 436

def retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get(fine_tuning_job_id, opts = {})
  data, _status_code, _headers = retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get_with_http_info(fine_tuning_job_id, opts)
  data
end

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

✨ (Enterprise) Retrieve Fine-Tuning Job Retrieves a fine-tuning job. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;fine_tuning_job_id&#x60;: The ID of the fine-tuning job to retrieve.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)

Returns:

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

    Object data, response status code and response headers



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
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 447

def retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get_with_http_info(fine_tuning_job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get ...'
  end
  # verify the required parameter 'fine_tuning_job_id' is set
  if @api_client.config.client_side_validation && fine_tuning_job_id.nil?
    fail ArgumentError, "Missing the required parameter 'fine_tuning_job_id' when calling FineTuningApi.retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get"
  end
  allowable_values = ["openai", "azure"]
  if @api_client.config.client_side_validation && opts[:'custom_llm_provider'] && !allowable_values.include?(opts[:'custom_llm_provider'])
    fail ArgumentError, "invalid value for \"custom_llm_provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fine_tuning/jobs/{fine_tuning_job_id}'.sub('{' + 'fine_tuning_job_id' + '}', CGI.escape(fine_tuning_job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'custom_llm_provider'] = opts[:'custom_llm_provider'] if !opts[:'custom_llm_provider'].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 => :"FineTuningApi.retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_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: FineTuningApi#retrieve_fine_tuning_job_fine_tuning_jobs_fine_tuning_job_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get(fine_tuning_job_id, opts = {}) ⇒ Object

✨ (Enterprise) Retrieve Fine-Tuning Job Retrieves a fine-tuning job. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id Supported Query Params: - ‘custom_llm_provider`: Name of the LiteLLM provider - `fine_tuning_job_id`: The ID of the fine-tuning job to retrieve.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)

Returns:

  • (Object)


506
507
508
509
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 506

def retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get(fine_tuning_job_id, opts = {})
  data, _status_code, _headers = retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get_with_http_info(fine_tuning_job_id, opts)
  data
end

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

✨ (Enterprise) Retrieve Fine-Tuning Job Retrieves a fine-tuning job. This is the equivalent of GET api.openai.com/v1/fine_tuning/jobs/fine_tuning_job_id Supported Query Params: - &#x60;custom_llm_provider&#x60;: Name of the LiteLLM provider - &#x60;fine_tuning_job_id&#x60;: The ID of the fine-tuning job to retrieve.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :custom_llm_provider (String)

Returns:

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

    Object data, response status code and response headers



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
# File 'lib/litellm_client/api/fine_tuning_api.rb', line 517

def retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get_with_http_info(fine_tuning_job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FineTuningApi.retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get ...'
  end
  # verify the required parameter 'fine_tuning_job_id' is set
  if @api_client.config.client_side_validation && fine_tuning_job_id.nil?
    fail ArgumentError, "Missing the required parameter 'fine_tuning_job_id' when calling FineTuningApi.retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get"
  end
  allowable_values = ["openai", "azure"]
  if @api_client.config.client_side_validation && opts[:'custom_llm_provider'] && !allowable_values.include?(opts[:'custom_llm_provider'])
    fail ArgumentError, "invalid value for \"custom_llm_provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/fine_tuning/jobs/{fine_tuning_job_id}'.sub('{' + 'fine_tuning_job_id' + '}', CGI.escape(fine_tuning_job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'custom_llm_provider'] = opts[:'custom_llm_provider'] if !opts[:'custom_llm_provider'].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 => :"FineTuningApi.retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_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: FineTuningApi#retrieve_fine_tuning_job_v1_fine_tuning_jobs_fine_tuning_job_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end