Skip to content

Latest commit

 

History

History
258 lines (165 loc) · 12.8 KB

README.md

File metadata and controls

258 lines (165 loc) · 12.8 KB

Models

(models)

Overview

Model Management API

Available Operations

list

List all models available to the user.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.list()

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ModelList

Errors

Error Object Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4xx-5xx /

retrieve

Retrieve a model information.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.retrieve(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
model_id str ✔️ The ID of the model to retrieve. ft:open-mistral-7b:587a6b29:20240514:7e773925
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet

Errors

Error Object Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4xx-5xx /

delete

Delete a fine-tuned model.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.delete(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
model_id str ✔️ The ID of the model to delete. ft:open-mistral-7b:587a6b29:20240514:7e773925
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DeleteModelOut

Errors

Error Object Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4xx-5xx /

update

Update a model name or description.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.update(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
model_id str ✔️ The ID of the model to update. ft:open-mistral-7b:587a6b29:20240514:7e773925
name OptionalNullable[str] N/A
description OptionalNullable[str] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.FTModelOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

archive

Archive a fine-tuned model.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.archive(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
model_id str ✔️ The ID of the model to archive. ft:open-mistral-7b:587a6b29:20240514:7e773925
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ArchiveFTModelOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

unarchive

Un-archive a fine-tuned model.

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.models.unarchive(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
model_id str ✔️ The ID of the model to unarchive. ft:open-mistral-7b:587a6b29:20240514:7e773925
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UnarchiveFTModelOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /