(models)
Model Management API
List all models available to the user.
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
Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ModelList
Error Object |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Retrieve a model information.
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
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. |
|
models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet
Error Object |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Delete a fine-tuned model.
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
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. |
|
models.DeleteModelOut
Error Object |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Update a model name or description.
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
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. |
|
models.FTModelOut
Error Object |
Status Code |
Content Type |
models.SDKError |
4xx-5xx |
/ |
Archive a fine-tuned model.
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
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. |
|
models.ArchiveFTModelOut
Error Object |
Status Code |
Content Type |
models.SDKError |
4xx-5xx |
/ |
Un-archive a fine-tuned model.
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
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. |
|
models.UnarchiveFTModelOut
Error Object |
Status Code |
Content Type |
models.SDKError |
4xx-5xx |
/ |