For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
  • Cohere API
    • About
    • Teams and Roles
    • Errors
    • Migrating From API v1 to API v2
    • Using the OpenAI SDK
  • Endpoints
  • Deprecated
      • GETLists fine-tuned models.
      • POSTTrains and deploys a fine-tuned model.
      • PATCHUpdates a fine-tuned model.
      • GETReturns a fine-tuned model by ID.
      • DELDeletes a fine-tuned model.
      • GETFetch history of statuses for a fine-tuned model.
      • GETRetrieve training metrics for fine-tuned models.
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Deprecatedv1/finetuning

Updates a fine-tuned model.

Deprecated
PATCH
https://api.cohere.com/v1/finetuning/finetuned-models/:id
PATCH
/v1/finetuning/finetuned-models/:id
1from cohere.finetuning import (
2 BaseModel,
3 Settings,
4)
5import cohere
6
7co = cohere.Client()
8finetuned_model = co.finetuning.update_finetuned_model(
9 id="test-id",
10 name="new name",
11 settings=Settings(
12 base_model=BaseModel(
13 base_type="BASE_TYPE_CHAT",
14 ),
15 dataset_id="my-dataset-id",
16 ),
17)
18
19print(finetuned_model)
1{
2 "finetuned_model": {
3 "name": "string",
4 "settings": {
5 "base_model": {
6 "base_type": "BASE_TYPE_UNSPECIFIED",
7 "name": "string",
8 "version": "string",
9 "strategy": "STRATEGY_UNSPECIFIED"
10 },
11 "dataset_id": "string",
12 "hyperparameters": {
13 "early_stopping_patience": 1,
14 "early_stopping_threshold": 1.1,
15 "train_batch_size": 1,
16 "train_epochs": 1,
17 "learning_rate": 1.1,
18 "lora_alpha": 1,
19 "lora_rank": 1,
20 "lora_target_modules": "LORA_TARGET_MODULES_UNSPECIFIED"
21 },
22 "multi_label": true,
23 "wandb": {
24 "project": "string",
25 "api_key": "string",
26 "entity": "string"
27 }
28 },
29 "id": "string",
30 "creator_id": "string",
31 "organization_id": "string",
32 "status": "STATUS_UNSPECIFIED",
33 "created_at": "2024-01-15T09:30:00Z",
34 "updated_at": "2024-01-15T09:30:00Z",
35 "completed_at": "2024-01-15T09:30:00Z",
36 "last_used": "2024-01-15T09:30:00Z"
37 }
38}

Updates the fine-tuned model with the given ID. The model will be updated with the new settings and name provided in the request body.

Was this page helpful?
Previous

Returns a fine-tuned model by ID.

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired
FinetunedModel ID.

Headers

X-Client-NamestringOptional
The name of the project that is making the request.

Request

Information about the fine-tuned model. Must contain name and settings.

namestringRequired

FinetunedModel name (e.g. foobar).

settingsobjectRequired
FinetunedModel settings such as dataset, hyperparameters...
statusenumOptionalDefaults to STATUS_UNSPECIFIED

Current stage in the life-cycle of the fine-tuned model.

Response

A successful response.
finetuned_modelobject

Information about the fine-tuned model.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error
503
Service Unavailable Error