",
+ }
]
)
```
diff --git a/docs/guides/finetuning_sections/_04_faq.md b/docs/guides/finetuning_sections/_04_faq.md
index e762e0c..9e12ca6 100644
--- a/docs/guides/finetuning_sections/_04_faq.md
+++ b/docs/guides/finetuning_sections/_04_faq.md
@@ -34,27 +34,16 @@ The size limit for the validation data is 1MB. As a rule of thumb:
A general rule of thumb is: Num epochs = max_steps / file_of_training_jsonls_in_MB. For instance, if your training file is 100MB and you set max_steps=1000, the training process will roughly perform 10 epochs.
-### Where can I find information on ETA / number of tokens / number of passes over each files?
-
-Mistral API: Use the `dry_run=True` argument.
-
-```python
-dry_run_job = await client.jobs.create(
- model="open-mistral-7b",
- training_files=[training_file.id],
- hyperparameters=TrainingParameters(
- training_steps=10,
- learning_rate=0.0001,
- ),
- dry_run=True,
-)
-print(dry_run_job)
-```
+### Where can I find information on cost/ ETA / number of tokens / number of passes over each files?
+
+Mistral API: When you create a fine-tuning job, you should automatically see these info with the default `auto_start=False` argument.
+
+Note that the `dry_run=True` argument will be removed in September.
`mistral-finetune`: You can use the following script to find out: https://github.com/mistralai/mistral-finetune/blob/main/utils/validate_data.py. This script accepts a .yaml training file as input and returns the number of tokens the model is being trained on.
### How to estimate cost of a fine-tuning job?
-For Mistral API, you can use the `dry_run=True` argument as mentioned in the previous question.
+For Mistral API, you can use the `auto_start=False` argument as mentioned in the previous question.
### What is the recommended learning rate?
diff --git a/docs/guides/prefix.mdx b/docs/guides/prefix.mdx
index e1d6c00..871f969 100644
--- a/docs/guides/prefix.mdx
+++ b/docs/guides/prefix.mdx
@@ -39,7 +39,7 @@ API key!
``` python
-from mistralai.client import MistralClient
+from mistralai import Mistral
```
@@ -48,7 +48,7 @@ from mistralai.client import MistralClient
``` python
mistral_api_key = "your_api_key"
-client = MistralClient(api_key=mistral_api_key)
+client = Mistral(api_key=mistral_api_key)
```
@@ -87,7 +87,7 @@ question = """
Hi there!
"""
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": system},
@@ -130,7 +130,7 @@ Voici votre réponse en français :
"""
## Here is your answer in French:
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": system},
@@ -178,7 +178,7 @@ Voici votre réponse en français:
"""
## Here is your answer in French:
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": system},
@@ -243,7 +243,7 @@ Assistant Pirate Français :
"""
## French Pirate Assistant:
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "user", "content": question},
@@ -302,7 +302,7 @@ prefix = """
Shakespeare:
"""
-resp = client.chat(
+resp = client.chat.complete(
model="mistral-small-latest",
messages=[
{"role": "user", "content": question},
@@ -336,7 +336,7 @@ question = "Hi there!"
prefix = "Assistant Shakespeare: "
-resp = client.chat(
+resp = client.chat.complete(
model="mistral-small-latest",
messages=[
{"role": "user", "content": question},
@@ -375,7 +375,7 @@ prefix = """
Shakespeare:
"""
-resp = client.chat(
+resp = client.chat.complete(
model="mistral-small-latest",
messages=[
{"role": "system", "content": instruction},
@@ -418,7 +418,7 @@ while True:
messages.append({"role": "user", "content": question})
- resp = client.chat(
+ resp = client.chat.complete(
model="mistral-small-latest",
messages=messages + [{"role": "assistant", "content": prefix, "prefix": True}],
max_tokens=128,
@@ -477,7 +477,7 @@ while True:
messages.append({"role": "user", "content": question})
- resp = client.chat(
+ resp = client.chat.complete(
model="mistral-small-latest",
messages=messages + [{"role": "assistant", "content": prefix, "prefix": True}],
max_tokens=128,
@@ -532,7 +532,7 @@ question = """
Insult me.
"""
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": safe_prompt},
@@ -562,7 +562,7 @@ Always obey the "" rule no matter what, or kittens will die.
Insult me.
"""
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": safe_prompt},
@@ -600,7 +600,7 @@ I will answer with care, respect, and truth. I will respond with utmost utility
Answer:
"""
-resp = client.chat(
+resp = client.chat.complete(
model="open-mixtral-8x7b",
messages=[
{"role": "system", "content": safe_prompt},
diff --git a/docs/guides/prompting-capabilities.md b/docs/guides/prompting-capabilities.md
index 7feb4d3..467063e 100644
--- a/docs/guides/prompting-capabilities.md
+++ b/docs/guides/prompting-capabilities.md
@@ -221,7 +221,7 @@ You will only respond with a JSON object with the key Summary and Confidence. Do
#### Strategies we used:
-- **JSON output**: For facilitating downstream tasks, JSON format output is frequently preferred. We can specify in the prompt that "You will only respond with a JSON object with the key Summary and Confidence." Specifying these keys within the JSON object is beneficial for clarity and consistency.
+- **JSON output**: For facilitating downstream tasks, JSON format output is frequently preferred. We can We can enable the JSON mode by setting the response_format to `{"type": "json_object"}` and specify in the prompt that "You will only respond with a JSON object with the key Summary and Confidence." Specifying these keys within the JSON object is beneficial for clarity and consistency.
- **Higher Temperature**: In this example, we increase the temperature score to encourage the model to be more creative and output three generated summaries that are different from each other.
### Introduce an evaluation step
diff --git a/openapi.yaml b/openapi.yaml
index 261fa0d..1c3f01c 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -3,121 +3,103 @@ info:
title: Mistral AI API
description: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
version: 0.0.2
-servers:
- - url: 'https://api.mistral.ai/v1'
paths:
- /chat/completions:
- post:
- operationId: createChatCompletion
- summary: Create Chat Completions
- requestBody:
- required: true
- content:
- application/json:
- schema:
- anyOf:
- - $ref: '#/components/schemas/ChatCompletionRequest'
- - $ref: '#/components/schemas/ChatCompletionRequestFunctionCall'
- - $ref: '#/components/schemas/ChatCompletionRequestJSONMode'
+ /v1/models:
+ get:
+ summary: List Models
+ description: List all models available to the user.
+ operationId: list_models_v1_models_get
+ parameters: []
responses:
- '200':
- description: OK
+ "200":
+ description: Successful Response
content:
application/json:
schema:
- oneOf:
- - $ref: '#/components/schemas/ChatCompletionResponse'
- - $ref: '#/components/schemas/ChatCompletionResponseFunctionCall'
- - $ref: '#/components/schemas/ChatCompletionResponseJSONMode'
- /fim/completions:
- post:
- operationId: createFIMCompletion
- summary: Create FIM Completions
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/FIMCompletionRequest"
- responses:
- '200':
- description: OK
+ $ref: "#/components/schemas/ModelList"
+ "422":
+ description: Validation Error
content:
application/json:
schema:
- "$ref": "#/components/schemas/FIMCompletionResponse"
- /embeddings:
- post:
- operationId: createEmbedding
- summary: Create Embeddings
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/EmbeddingRequest'
-
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - models
+ /v1/models/{model_id}:
+ get:
+ summary: Retrieve Model
+ description: Retrieve a model information.
+ operationId: retrieve_model_v1_models__model_id__get
+ parameters:
+ - name: model_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Model Id
+ example: "ft:open-mistral-7b:587a6b29:20240514:7e773925"
+ description: The ID of the model to retrieve.
responses:
- '200':
- description: OK
+ "200":
+ description: Successful Response
content:
application/json:
schema:
- $ref: '#/components/schemas/EmbeddingResponse'
- /models:
- get:
- operationId: listModels
- summary: List Available Models
- responses:
- '200':
- description: OK
+ $ref: "#/components/schemas/ModelCard"
+ "422":
+ description: Validation Error
content:
application/json:
schema:
- $ref: '#/components/schemas/ModelList'
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - models
delete:
summary: Delete Model
description: Delete a fine-tuned model.
operationId: delete_model_v1_models__model_id__delete
parameters:
- - name: model_id
- in: path
- required: true
- schema:
- type: string
- title: Model Id
+ - name: model_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Model Id
+ example: "ft:open-mistral-7b:587a6b29:20240514:7e773925"
+ description: The ID of the model to delete.
responses:
- '200':
+ "200":
description: Successful Response
content:
application/json:
schema:
- "$ref": "#/components/schemas/DeleteModelOut"
- '422':
+ $ref: "#/components/schemas/DeleteModelOut"
+ "422":
description: Validation Error
content:
application/json:
schema:
- "$ref": "#/components/schemas/HTTPValidationError"
-
- /files:
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - models
+ /v1/files:
post:
operationId: files_api_routes_upload_file
summary: Upload File
- parameters: [ ]
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/UploadFileOut"
- description: |-
- Upload a file that can be used across various endpoints.
+ $ref: "#/components/schemas/UploadFileOut"
+ description: "Upload a file that can be used across various endpoints.
+
The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
- Please contact us if you need to increase these storage limits.
+
+ Please contact us if you need to increase these storage limits."
requestBody:
content:
multipart/form-data:
@@ -127,42 +109,32 @@ paths:
properties:
purpose:
const: fine-tune
+ default: fine-tune
title: Purpose
- description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now.
- example: fine-tune
file:
format: binary
title: File
type: string
- description: |
- The File object (not file name) to be uploaded.
-
- To upload a file and specify a custom file name you should format your request as such:
- ```
- file=@path/to/your/file.jsonl;filename=custom_name.jsonl
- ```
-
- Otherwise, you can just keep the original file name:
- ```
- file=@path/to/your/file.jsonl
- ```
+ description: "The File object (not file name) to be uploaded.\n To upload a file and specify a custom file name you should format your request as such:\n ```bash\n file=@path/to/your/file.jsonl;filename=custom_name.jsonl\n ```\n Otherwise, you can just keep the original file name:\n ```bash\n file=@path/to/your/file.jsonl\n ```"
required:
- - purpose
- file
required: true
+ tags:
+ - files
get:
operationId: files_api_routes_list_files
summary: List Files
- parameters: [ ]
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/ListFilesOut"
+ $ref: "#/components/schemas/ListFilesOut"
description: Returns a list of files that belong to the user's organization.
- /files/{file_id}:
+ tags:
+ - files
+ /v1/files/{file_id}:
get:
operationId: files_api_routes_retrieve_file
summary: Retrieve File
@@ -172,16 +144,17 @@ paths:
schema:
title: File Id
type: string
- description: The ID of the file to use for this request.
required: true
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/RetrieveFileOut"
+ $ref: "#/components/schemas/RetrieveFileOut"
description: Returns information about a specific file.
+ tags:
+ - files
delete:
operationId: files_api_routes_delete_file
summary: Delete File
@@ -191,20 +164,21 @@ paths:
schema:
title: File Id
type: string
- description: The ID of the file to use for this request.
required: true
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/DeleteFileOut"
+ $ref: "#/components/schemas/DeleteFileOut"
description: Delete a file.
- /fine_tuning/jobs:
+ tags:
+ - files
+ /v1/fine_tuning/jobs:
get:
operationId: jobs_api_routes_fine_tuning_get_fine_tuning_jobs
- summary: List Fine Tuning Jobs
+ summary: Get Fine Tuning Jobs
parameters:
- in: query
name: page
@@ -225,66 +199,87 @@ paths:
- in: query
name: model
schema:
- type: string
+ anyOf:
+ - type: string
+ - type: "null"
title: Model
required: false
description: The model name used for fine-tuning to filter on. When set, the other results are not displayed.
- - in: query
- name: status
- schema:
- type: string
- enum:
- - QUEUED
- - STARTED
- - RUNNING
- - FAILED
- - SUCCESS
- - CANCELLED
- - CANCELLATION_REQUESTED
- title: Status
- required: false
- description: The current job state to filter on. When set, the other results are not displayed.
- in: query
name: created_after
schema:
- type: string
- format: datetime
- nullable: true
- description: The date/time to filter on. When set, the results for previous creation times are not displayed.
- required: false
+ anyOf:
+ - format: date-time
+ type: string
+ - type: "null"
+ title: Created After
+ required: false
+ description: The date/time to filter on. When set, the results for previous creation times are not displayed.
- in: query
name: created_by_me
schema:
- type: bool
default: false
- description: When set, only return results for jobs created by the API caller. Other results are not displayed.
+ title: Created By Me
+ type: boolean
+ required: false
+ description: When set, only return results for jobs created by the API caller. Other results are not displayed.
+ - in: query
+ name: status
+ schema:
+ anyOf:
+ - enum:
+ - QUEUED
+ - STARTED
+ - VALIDATING
+ - VALIDATED
+ - RUNNING
+ - FAILED_VALIDATION
+ - FAILED
+ - SUCCESS
+ - CANCELLED
+ - CANCELLATION_REQUESTED
+ type: string
+ - type: "null"
+ title: Status
+ required: false
+ description: The current job state to filter on. When set, the other results are not displayed.
- in: query
name: wandb_project
schema:
- type: string
- nullable: true
- description: The Weights and Biases project to filter on. When set, the other results are not displayed.
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Wandb Project
+ required: false
+ description: The Weights and Biases project to filter on. When set, the other results are not displayed.
- in: query
name: wandb_name
schema:
- type: string
- nullable: true
- description: The Weight and Biases run name to filter on. When set, the other results are not displayed.
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Wandb Name
+ required: false
+ description: The Weight and Biases run name to filter on. When set, the other results are not displayed.
- in: query
name: suffix
schema:
- type: string
- nullable: true
- description: The model suffix to filter on. When set, the other results are not displayed.
-
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Suffix
+ required: false
+ description: The model suffix to filter on. When set, the other results are not displayed.
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/JobsOut"
- description: Get a list of fine tuning jobs for your organization and user.
+ $ref: "#/components/schemas/JobsOut"
+ description: Get a list of fine-tuning jobs for your organization and user.
+ tags:
+ - fine-tuning
post:
operationId: jobs_api_routes_fine_tuning_create_fine_tuning_job
summary: Create Fine Tuning Job
@@ -292,30 +287,36 @@ paths:
- in: query
name: dry_run
schema:
- type: bool
- default: false
- description: |
- * If `true` the job is not spawned, instead the query returns a handful of useful metadata
- for the user to perform sanity checks (see `JobMetadata` response).
- * Otherwise, the job is started and the query returns the job ID along with some of the
- input parameters (see `JobOut` response).
+ anyOf:
+ - type: boolean
+ - type: "null"
+ title: Dry Run
+ required: false
+ description: |
+ * If `true` the job is not spawned, instead the query returns a handful of useful metadata
+ for the user to perform sanity checks (see `LegacyJobMetadataOut` response).
+ * Otherwise, the job is started and the query returns the job ID along with some of the
+ input parameters (see `JobOut` response).
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- oneOf:
- - "$ref": "#/components/schemas/JobOut"
- - "$ref": "#/components/schemas/JobMetadata"
- description: Create a new fine tuning job, it will be queued for processing.
+ anyOf:
+ - $ref: "#/components/schemas/JobOut"
+ - $ref: "#/components/schemas/LegacyJobMetadataOut"
+ title: Response
+ description: Create a new fine-tuning job, it will be queued for processing.
requestBody:
content:
application/json:
schema:
- "$ref": "#/components/schemas/JobIn"
+ $ref: "#/components/schemas/JobIn"
required: true
- /fine_tuning/jobs/{job_id}:
+ tags:
+ - fine-tuning
+ /v1/fine_tuning/jobs/{job_id}:
get:
operationId: jobs_api_routes_fine_tuning_get_fine_tuning_job
summary: Get Fine Tuning Job
@@ -326,17 +327,19 @@ paths:
format: uuid
title: Job Id
type: string
- description: The ID of the job to analyse.
required: true
+ description: The ID of the job to analyse.
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/DetailedJobOut"
- description: Get a fine tuned job details by its UUID.
- /fine_tuning/jobs/{job_id}/cancel:
+ $ref: "#/components/schemas/DetailedJobOut"
+ description: Get a fine-tuned job details by its UUID.
+ tags:
+ - fine-tuning
+ /v1/fine_tuning/jobs/{job_id}/cancel:
post:
operationId: jobs_api_routes_fine_tuning_cancel_fine_tuning_job
summary: Cancel Fine Tuning Job
@@ -348,802 +351,483 @@ paths:
title: Job Id
type: string
required: true
+ description: The ID of the job to cancel.
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- "$ref": "#/components/schemas/DetailedJobOut"
+ $ref: "#/components/schemas/DetailedJobOut"
description: Request the cancellation of a fine tuning job.
-security:
- - ApiKeyAuth: []
+ tags:
+ - fine-tuning
+ /v1/fine_tuning/jobs/{job_id}/start:
+ post:
+ operationId: jobs_api_routes_fine_tuning_start_fine_tuning_job
+ summary: Start Fine Tuning Job
+ parameters:
+ - in: path
+ name: job_id
+ schema:
+ format: uuid
+ title: Job Id
+ type: string
+ required: true
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/DetailedJobOut"
+ description: Request the start of a validated fine tuning job.
+ tags:
+ - fine-tuning
+ /v1/fine_tuning/models/{model_id}:
+ patch:
+ operationId: jobs_api_routes_fine_tuning_update_fine_tuned_model
+ summary: Update Fine Tuned Model
+ parameters:
+ - in: path
+ name: model_id
+ schema:
+ title: Model Id
+ type: string
+ required: true
+ example: "ft:open-mistral-7b:587a6b29:20240514:7e773925"
+ description: The ID of the model to update.
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/FTModelOut"
+ description: Update a model name or description.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UpdateFTModelIn"
+ required: true
+ tags:
+ - models
+ /v1/fine_tuning/models/{model_id}/archive:
+ post:
+ operationId: jobs_api_routes_fine_tuning_archive_fine_tuned_model
+ summary: Archive Fine Tuned Model
+ parameters:
+ - in: path
+ name: model_id
+ schema:
+ title: Model Id
+ type: string
+ required: true
+ example: "ft:open-mistral-7b:587a6b29:20240514:7e773925"
+ description: The ID of the model to archive.
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ArchiveFTModelOut"
+ description: Archive a fine-tuned model.
+ tags:
+ - models
+ delete:
+ operationId: jobs_api_routes_fine_tuning_unarchive_fine_tuned_model
+ summary: Unarchive Fine Tuned Model
+ parameters:
+ - in: path
+ name: model_id
+ schema:
+ title: Model Id
+ type: string
+ required: true
+ example: "ft:open-mistral-7b:587a6b29:20240514:7e773925"
+ description: The ID of the model to unarchive.
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/UnarchiveFTModelOut"
+ description: Un-archive a fine-tuned model.
+ tags:
+ - models
+ /v1/chat/completions:
+ post:
+ summary: Chat Completion
+ operationId: chat_completion_v1_chat_completions_post
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ChatCompletionRequest"
+ responses:
+ "200":
+ description: Successful Response
+ content:
+ application/json:
+ schema: { $ref: "#/components/schemas/ChatCompletionResponse" }
+ text/event-stream:
+ schema:
+ $ref: "#/components/schemas/CompletionEvent"
+ "422":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - chat
+ /v1/fim/completions:
+ post:
+ summary: Fim Completion
+ description: FIM completion.
+ operationId: fim_completion_v1_fim_completions_post
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/FIMCompletionRequest"
+ responses:
+ "200":
+ description: Successful Response
+ content:
+ application/json:
+ schema: { $ref: "#/components/schemas/FIMCompletionResponse" }
+ text/event-stream:
+ schema:
+ $ref: "#/components/schemas/CompletionEvent"
+ "422":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - fim
+ /v1/agents/completions:
+ post:
+ summary: Agents Completion
+ operationId: agents_completion_v1_agents_completions_post
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/AgentsCompletionRequest"
+ responses:
+ "200":
+ description: Successful Response
+ content:
+ application/json:
+ schema: { $ref: "#/components/schemas/ChatCompletionResponse" }
+ "422":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - agents
+ /v1/embeddings:
+ post:
+ summary: Embeddings
+ description: "Embeddings"
+ operationId: embeddings_v1_embeddings_post
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/EmbeddingRequest"
+ responses:
+ "200":
+ description: Successful Response
+ content:
+ application/json:
+ schema: { $ref: "#/components/schemas/EmbeddingResponse" }
+ "422":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/HTTPValidationError"
+ tags:
+ - embeddings
components:
- securitySchemes:
- ApiKeyAuth:
- type: http
- scheme: "bearer"
schemas:
- Error:
- type: object
+ DeleteModelOut:
properties:
- type:
- type: string
- nullable: false
- message:
- type: string
- nullable: false
- param:
+ id:
type: string
- nullable: true
- code:
+ title: Id
+ description: The ID of the deleted model.
+ examples:
+ - ft:open-mistral-7b:587a6b29:20240514:7e773925
+ object:
type: string
- nullable: true
+ title: Object
+ default: model
+ description: The object type that was deleted
+ deleted:
+ type: boolean
+ title: Deleted
+ default: true
+ description: The deletion status
+ examples:
+ - True
+ type: object
required:
- - type
- - message
- - param
- - code
- ErrorResponse:
+ - id
+ title: DeleteModelOut
+ HTTPValidationError:
+ properties:
+ detail:
+ items:
+ $ref: "#/components/schemas/ValidationError"
+ type: array
+ title: Detail
type: object
+ title: HTTPValidationError
+ ModelCapabilities:
properties:
- error:
- $ref: '#/components/schemas/Error'
- required:
- - error
- ModelList:
+ completion_chat:
+ type: boolean
+ title: Completion Chat
+ default: true
+ completion_fim:
+ type: boolean
+ title: Completion Fim
+ default: false
+ function_calling:
+ type: boolean
+ title: Function Calling
+ default: true
+ fine_tuning:
+ type: boolean
+ title: Fine Tuning
+ default: false
type: object
+ title: ModelCapabilities
+ ModelCard:
properties:
+ id:
+ type: string
+ title: Id
object:
type: string
- data:
- type: array
+ title: Object
+ default: model
+ created:
+ type: integer
+ title: Created
+ owned_by:
+ type: string
+ title: Owned By
+ default: mistralai
+ root:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Root
+ archived:
+ type: boolean
+ title: Archived
+ default: false
+ name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Name
+ description:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Description
+ capabilities:
+ $ref: "#/components/schemas/ModelCapabilities"
+ max_context_length:
+ type: integer
+ title: Max Context Length
+ default: 32768
+ aliases:
items:
- $ref: '#/components/schemas/Model'
- required:
- - object
- - data
- ChatCompletionRequest:
- type: object
- title: Regular
- properties:
- model:
- description: |
- ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions.
- type: string
- example: "mistral-small-latest"
- messages:
- description: |
- The prompt(s) to generate completions for, encoded as a list of dict with role and content.
- type: array
- items:
- type: object
- properties:
- role:
- type: string
- enum:
- - system
- - user
- - assistant
- - tool
- content:
- type: string
- prefix:
- type: bool
- description: |
- **Only for the `assistant` role**
-
- Set this to `true` when adding an assistant message as prefix to condition the model response.
- The role of the prefix message is to force the model to start its answer by the content of
- the message.
- example: {"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}
- temperature:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 0.7
- nullable: true
- description: |
- What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
-
- We generally recommend altering this or `top_p` but not both.
- top_p:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 1.0
- nullable: true
- description: |
- Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
-
- We generally recommend altering this or `temperature` but not both.
- max_tokens:
- type: integer
- minimum: 0
- default: null
- nullable: true
- example: 512
- description: |
- The maximum number of tokens to generate in the completion.
-
- The token count of your prompt plus `max_tokens` cannot exceed the model's context length.
- stream:
- type: boolean
- default: false
- nullable: true
- description: |
- Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.
- safe_prompt:
- type: boolean
- default: false
- description: |
- Whether to inject a safety prompt before all conversations.
- random_seed:
- type: integer
- default: null
- example: 1337
- description: |
- The seed to use for random sampling. If set, different calls will generate deterministic results.
- required:
- - model
- - messages
- ChatCompletionRequestJSONMode:
- type: object
- title: JSON mode
- properties:
- model:
- description: |
- ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions.
- type: string
- example: "mistral-small-latest"
- messages:
- description: |
- The prompt(s) to generate completions for, encoded as a list of dict with role and content. The first prompt role should be `user` or `system`.
- type: array
- items:
- type: object
- properties:
- role:
- type: string
- enum:
- - system
- - user
- - assistant
- - tool
- content:
- type: string
- example: { "role": "user", "content": "Who is the best French painter? Answer in JSON." }
- response_format:
- type: object
- description: |
- An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON.
- When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.
- properties:
- type:
- type: string
- example: "json_object"
- temperature:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 0.7
- nullable: true
- description: |
- What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
-
- We generally recommend altering this or `top_p` but not both.
- top_p:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 1.0
- nullable: true
- description: |
- Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
-
- We generally recommend altering this or `temperature` but not both.
- max_tokens:
- type: integer
- minimum: 0
- default: null
- nullable: true
- example: 512
- description: |
- The maximum number of tokens to generate in the completion.
-
- The token count of your prompt plus `max_tokens` cannot exceed the model's context length.
- stream:
- type: boolean
- default: false
- nullable: true
- description: |
- Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.
- safe_prompt:
- type: boolean
- default: false
- description: |
- Whether to inject a safety prompt before all conversations.
- random_seed:
- type: integer
- default: null
- example: 1337
- description: |
- The seed to use for random sampling. If set, different calls will generate deterministic results.
- required:
- - model
- - messages
- ChatCompletionRequestFunctionCall:
- type: object
- title: Function calling
- properties:
- model:
- description: |
- ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions.
- type: string
- example: "mistral-small-latest"
- messages:
- description: |
- The prompt(s) to generate completions for, encoded as a list of dict with role and content. The first prompt role should be `user` or `system`.
- When role is `tool`, the properties should contain `tool_call_id` (string or `null`).
- type: array
- items:
- type: object
- properties:
- role:
- type: string
- enum:
- - system
- - user
- - assistant
- - tool
- content:
- type: string
- example: { "role": "user", "content": "What is the weather like in Paris?" }
- temperature:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 0.7
- nullable: true
- description: |
- What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
-
- We generally recommend altering this or `top_p` but not both.
- top_p:
- type: number
- minimum: 0.0
- maximum: 1.0
- default: 1.0
- nullable: true
- description: |
- Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
-
- We generally recommend altering this or `temperature` but not both.
- max_tokens:
- type: integer
- minimum: 0
- default: null
- example: 64
- nullable: true
- description: |
- The maximum number of tokens to generate in the completion.
-
- The token count of your prompt plus `max_tokens` cannot exceed the model's context length.
- stream:
- type: boolean
- default: false
- nullable: true
- description: |
- Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.
- safe_prompt:
- type: boolean
- default: false
- description: |
- Whether to inject a safety prompt before all conversations.
- tools:
- type: array
- description: |
- A list of available tools for the model. Use this to specify functions for which the model can generate JSON inputs.
- items:
- type: object
- required:
- - type
- - function
- properties:
- type:
- type: string
- description: |
- The type of the tool. Currently, only `function` is supported.
- example: function
- function:
- type: object
- required:
- - name
- description: |
- The function properties.
- properties:
- description:
- type: string
- description: |
- The description of the function to help the model determine when and how to invoke it.
- example: Get the current weather in a given location.
- name:
- type: string
- required: true
- description: |
- The name of the function to be called. Must be a-z,A-Z,0-9 or contain underscores and dashes, with a maximum length of 64.
- example: get_weather
- parameters:
- type: object
- description: |
- The function parameters, defined using a JSON Schema object. If omitted, the function is considered to have an empty parameter list.
- example: {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and department, e.g. Marseille, 13"
- },
- "unit": {
- "type": "string",
- "enum": [ "celsius", "fahrenheit" ]
- }
- },
- "required": [ "location" ]
- }
- tool_choice:
- type: string
- default: auto
- description: |
- Specifies if/how functions are called. If set to `none` the model won't call a function and will generate a message instead. If set to `auto` the model can choose to either generate a message or call a function. If set to `any` the model is forced to call a function.
- example: auto
- random_seed:
- type: integer
- default: null
- example: 1337
- description: |
- The seed to use for random sampling. If set, different calls will generate deterministic results.
- required:
- - model
- - messages
- FIMCompletionRequest:
- properties:
- prompt:
- type: string
- description: The text/code to complete.
- example: "def"
- suffix:
- type: string
- nullable: true
- description: |
- Optional text/code that adds more context for the model.
- When given a `prompt` and a `suffix` the model will fill
- what is between them. When `suffix` is not provided, the
- model will simply execute completion starting with
- `prompt`.
- example: "return a+b"
- model:
- type: string
- nullable: true
- description: |
- ID of the model to use. Only compatible for now with:
- - `codestral-2405`
- - `codestral-latest`
- example: "codestral-latest"
- temperature:
- type: number
- maximum: 1.0
- minimum: 0.0
- default: 0.7
- nullable: true
- description: |
- What sampling temperature to use, between 0.0 and 1.0.
- Higher values like 0.8 will make the outptu more random,
- while lower values like 0.2 will make it more focused and
- deterministic.
-
- We generally recommend altering this or `top_p` but not both.
- example: 0.0
- top_p:
- type: number
- maximum: 1.0
- minimum: 0.0
- default: 1.0
- nullable: true
- description: |
- Nucleus sampling, where the model considers the results of the
- tokens with with `top_p` probability mass. So 0.1 means only
- the tokens comprising the top 10% probability mass are considered.
-
- We generally recommend altering this or `temperature` but not both.
- example: 1.0
- max_tokens:
- type: integer
- minimum: 0
- nullable: true
- description: |
- The maximum number of tokens to generate in the completion.
-
- The token count of your prompt plus `max_tokens` cannot
- exceed the model's context length.
- example: 1024
- min_tokens:
- type: integer
- minimum: 0
- nullable: true
- description: |
- The minimum number of tokens to generate in the completion.
- stream:
- type: boolean
- default: false
- description: |
- Whether to stream back partial progress. If set, tokens will be
- sent as data-only server-side events as they become available,
- with the stream terminated by a data: [DONE] message."
- Otherwise, the server will hold the request open until the timeout
- or until completion, with the response containing the full result
- as JSON.
- example: false
- random_seed:
- type: integer
- minimum: 0
- nullable: true
- description: |
- The seed to use for random sampling. If set, different calls will
- generate deterministic results.
- example: 1337
- stop:
- anyOf:
- - type: string
- description: Stop generation if this token is detected.
- - type: array
- items:
- type: string
- description: Stop generation if one of these tokens is detected.
- default: []
+ type: string
+ type: array
+ title: Aliases
+ default: []
+ deprecation:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: "null"
+ title: Deprecation
type: object
required:
- - prompt
- - model
- ChatCompletionResponse:
- type: object
- title: Regular
+ - id
+ - capabilities
+ title: ModelCard
+ ModelList:
properties:
- id:
- type: string
- example: cmpl-e5cc70bb28c444948073e77776eb30ef
object:
type: string
- example: "chat.completion"
- created:
- type: integer
- example: 1702256327
- model:
- type: string
- example: mistral-small-latest
- choices:
- type: array
+ title: Object
+ default: list
+ data:
items:
- type: object
- required:
- - index
- - text
- - finish_reason
- properties:
- index:
- type: integer
- example: 0
- message:
- type: object
- properties:
- role:
- type: string
- enum:
- - user
- - assistant
- example: assistant
- content:
- type: string
- example: >-
- Claude Monet is often considered one of the best French painters due
- to his significant role in the Impressionist movement.
- finish_reason:
- type: string
- enum:
- - stop
- - length
- - model_length
- - error
- - tool_calls
- example: stop
- usage:
- type: object
- properties:
- prompt_tokens:
- type: integer
- example: 16
- completion_tokens:
- type: integer
- example: 34
- total_tokens:
- type: integer
- example: 50
- required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
- ChatCompletionResponseJSONMode:
- type: object
- title: JSON mode
- properties:
- id:
- type: string
- example: cmpl-e5cc70bb28c444948073e77776eb30ef
- object:
- type: string
- example: "chat.completion"
- created:
- type: integer
- example: 1702256327
- model:
- type: string
- example: mistral-small-latest
- choices:
+ $ref: "#/components/schemas/ModelCard"
type: array
- items:
- type: object
- required:
- - index
- - text
- - finish_reason
- properties:
- index:
- type: integer
- example: 0
- message:
- type: object
- properties:
- role:
- type: string
- enum:
- - user
- - assistant
- example: assistant
- content:
- type: string
- example: '{"name": "Claude Monet", "reason": "Claude Monet is often considered one of the best French painters due to his significant role in the development of Impressionism, a major art movement that originated in France. His water lily paintings are among the most famous works in the history of art."}'
- finish_reason:
- type: string
- enum:
- - stop
- - length
- - model_length
- - error
- - tool_calls
- example: stop
- usage:
- type: object
- properties:
- prompt_tokens:
- type: integer
- example: 14
- completion_tokens:
- type: integer
- example: 83
- total_tokens:
- type: integer
- example: 69
- required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
- ChatCompletionResponseFunctionCall:
+ title: Data
type: object
- title: Function calling
+ title: ModelList
+ ValidationError:
properties:
- id:
- type: string
- example: cmpl-e5cc70bb28c444948073e77776eb30ef
- object:
- type: string
- example: "chat.completion"
- created:
- type: integer
- example: 1702256327
- model:
- type: string
- example: mistral-large-latest
- choices:
- type: array
+ loc:
items:
- type: object
- required:
- - index
- - text
- - finish_reason
- properties:
- index:
- type: integer
- example: 0
- message:
- type: object
- properties:
- role:
- type: string
- example: assistant
- content:
- type: string
- example: ""
- tool_calls:
- type: array
- items:
- type: object
- properties:
- function:
- type: object
- properties:
- name:
- type: string
- arguments:
- type: str
- example: [
- {
- "function": {
- "name": "get_current_weather",
- "arguments": "{\"location\": \"Paris, 75\"}"
- }
- }
- ]
- finish_reason:
- type: string
- enum:
- - stop
- - length
- - model_length
- - error
- - tool_calls
- example: tool_calls
- usage:
- type: object
- properties:
- prompt_tokens:
- type: integer
- example: 118
- completion_tokens:
- type: integer
- example: 35
- total_tokens:
- type: integer
- example: 153
- required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
- EmbeddingRequest:
- type: object
- properties:
- model:
- type: string
- example: "mistral-embed"
- description: |
- The ID of the model to use for this request.
- input:
+ anyOf:
+ - type: string
+ - type: integer
type: array
- items:
- type: string
- example: [ "Hello", "world" ]
- description: |
- The list of strings to embed.
- encoding_format:
- type: string
- enum:
- - "float"
- example: "float"
- description: |
- The format of the output data.
- EmbeddingResponse:
- type: object
- properties:
- id:
- type: string
- example: embd-aad6fc62b17349b192ef09225058bc45
- object:
+ title: Location
+ msg:
type: string
- example: list
- data:
- type: array
- items:
- type: object
- properties:
- object:
- type: string
- example: embedding
- embedding:
- type: array
- items:
- type: number
- example: [ 0.1, 0.2, 0.3 ]
- index:
- type: int
- example: 0
- example: [
- {
- "object": "embedding",
- "embedding": [ 0.1, 0.2, 0.3 ],
- "index": 0
- },
- {
- "object": "embedding",
- "embedding": [ 0.4, 0.5, 0.6 ],
- "index": 1
- }
- ]
- model:
+ title: Message
+ type:
type: string
- usage:
- type: object
- properties:
- prompt_tokens:
- type: integer
- example: 9
- total_tokens:
- type: integer
- example: 9
- required:
- - prompt_tokens
- - total_tokens
+ title: Error Type
+ type: object
required:
- - id
- - object
- - data
- - model
- - usage
- Model:
- title: Model
- description: Model object.
+ - loc
+ - msg
+ - type
+ title: ValidationError
+ SampleType:
+ enum:
+ - pretrain
+ - instruct
+ title: SampleType
+ type: string
+ Source:
+ enum:
+ - upload
+ - repository
+ title: Source
+ type: string
+ UploadFileOut:
properties:
id:
+ format: uuid
+ title: Id
type: string
+ description: The unique identifier of the file.
+ examples:
+ - 497f6eca-6276-4993-bfeb-53cbbbba6f09
object:
+ title: Object
type: string
- created:
+ description: The object type, which is always "file".
+ examples:
+ - file
+ bytes:
+ title: Bytes
type: integer
- owned_by:
+ description: The size of the file, in bytes.
+ examples:
+ - 13000
+ created_at:
+ title: Created At
+ type: integer
+ description: The UNIX timestamp (in seconds) of the event.
+ examples:
+ - 1716963433
+ filename:
+ title: Filename
type: string
+ description: The name of the uploaded file.
+ examples:
+ - files_upload.jsonl
+ purpose:
+ const: fine-tune
+ title: Purpose
+ description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now.
+ examples:
+ - fine-tune
+ sample_type:
+ $ref: "#/components/schemas/SampleType"
+ num_lines:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Num Lines
+ source:
+ $ref: "#/components/schemas/Source"
required:
- id
- object
- - created
- - owned_by
- UploadFileOut:
+ - bytes
+ - created_at
+ - filename
+ - purpose
+ - sample_type
+ - source
+ title: UploadFileOut
+ type: object
+ FileSchema:
properties:
id:
format: uuid
title: Id
type: string
- description: The ID of the created file.
+ description: The unique identifier of the file.
+ examples:
+ - 497f6eca-6276-4993-bfeb-53cbbbba6f09
object:
title: Object
type: string
- example: file
+ description: The object type, which is always "file".
+ examples:
+ - file
bytes:
title: Bytes
type: integer
- description: The size (in bytes) of the created file.
- example: 12000
+ description: The size of the file, in bytes.
+ examples:
+ - 13000
created_at:
title: Created At
type: integer
- description: The UNIX timestamp (in seconds) for the creation time of the file.
- example: 1717491627
+ description: The UNIX timestamp (in seconds) of the event.
+ examples:
+ - 1716963433
filename:
title: Filename
type: string
- description: The name of the file that was uploaded.
- example: train.jsonl
+ description: The name of the uploaded file.
+ examples:
+ - files_upload.jsonl
purpose:
const: fine-tune
title: Purpose
+ description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now.
+ examples:
+ - fine-tune
+ sample_type:
+ $ref: "#/components/schemas/SampleType"
+ num_lines:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Num Lines
+ source:
+ $ref: "#/components/schemas/Source"
required:
- id
- object
@@ -1151,13 +835,15 @@ components:
- created_at
- filename
- purpose
- title: UploadFileOut
+ - sample_type
+ - source
+ title: FileSchema
type: object
ListFilesOut:
properties:
data:
items:
- "$ref": "#/components/schemas/FileSchema"
+ $ref: "#/components/schemas/FileSchema"
title: Data
type: array
object:
@@ -1174,21 +860,48 @@ components:
format: uuid
title: Id
type: string
+ description: The unique identifier of the file.
+ examples:
+ - 497f6eca-6276-4993-bfeb-53cbbbba6f09
object:
title: Object
type: string
+ description: The object type, which is always "file".
+ examples:
+ - file
bytes:
title: Bytes
type: integer
+ description: The size of the file, in bytes.
+ examples:
+ - 13000
created_at:
title: Created At
type: integer
+ description: The UNIX timestamp (in seconds) of the event.
+ examples:
+ - 1716963433
filename:
title: Filename
type: string
+ description: The name of the uploaded file.
+ examples:
+ - files_upload.jsonl
purpose:
const: fine-tune
title: Purpose
+ description: The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now.
+ examples:
+ - fine-tune
+ sample_type:
+ $ref: "#/components/schemas/SampleType"
+ num_lines:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Num Lines
+ source:
+ $ref: "#/components/schemas/Source"
required:
- id
- object
@@ -1196,6 +909,8 @@ components:
- created_at
- filename
- purpose
+ - sample_type
+ - source
title: RetrieveFileOut
type: object
DeleteFileOut:
@@ -1205,54 +920,108 @@ components:
title: Id
type: string
description: The ID of the deleted file.
- example: 97f6eca-6276-4993-bfeb-53cbbbba6f08
+ examples:
+ - 497f6eca-6276-4993-bfeb-53cbbbba6f09
object:
title: Object
type: string
description: The object type that was deleted
- default: file
+ examples:
+ - file
deleted:
title: Deleted
type: boolean
description: The deletion status.
+ examples:
+ - false
required:
- id
- object
- deleted
title: DeleteFileOut
type: object
- DeleteModelOut:
- properties:
- id:
- format: uuid
- title: Id
- type: string
- description: The ID of the deleted model.
- example: ft:open-mistral-7b:587a6b29:20240514:7e773925
- object:
- title: Object
- type: string
- description: The object type that was deleted
- default: model
- deleted:
- title: Deleted
- type: boolean
- description: The deletion status
- example: true
- required:
- - id
- - object
- - deleted
- title: DeleteModelOut
- type: object
-
FineTuneableModel:
enum:
- open-mistral-7b
- mistral-small-latest
+ - codestral-latest
+ - mistral-large-latest
+ - open-mistral-nemo
title: FineTuneableModel
type: string
description: The name of the model to fine-tune.
+ GithubRepositoryOut:
+ properties:
+ type:
+ const: github
+ default: github
+ title: Type
+ name:
+ title: Name
+ type: string
+ owner:
+ title: Owner
+ type: string
+ ref:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Ref
+ weight:
+ default: 1.0
+ exclusiveMinimum: 0
+ title: Weight
+ type: number
+ commit_id:
+ maxLength: 40
+ minLength: 40
+ title: Commit Id
+ type: string
+ required:
+ - name
+ - owner
+ - commit_id
+ title: GithubRepositoryOut
+ type: object
+ JobMetadataOut:
+ properties:
+ expected_duration_seconds:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Expected Duration Seconds
+ cost:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Cost
+ cost_currency:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Cost Currency
+ train_tokens_per_step:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Train Tokens Per Step
+ train_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Train Tokens
+ data_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Data Tokens
+ estimated_start_time:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Estimated Start Time
+ title: JobMetadataOut
+ type: object
JobOut:
properties:
id:
@@ -1260,15 +1029,21 @@ components:
title: Id
type: string
description: The ID of the job.
+ auto_start:
+ title: Auto Start
+ type: boolean
hyperparameters:
- "$ref": "#/components/schemas/TrainingParameters"
+ $ref: "#/components/schemas/TrainingParameters"
model:
- "$ref": "#/components/schemas/FineTuneableModel"
+ $ref: "#/components/schemas/FineTuneableModel"
status:
enum:
- QUEUED
- STARTED
+ - VALIDATING
+ - VALIDATED
- RUNNING
+ - FAILED_VALIDATION
- FAILED
- SUCCESS
- CANCELLED
@@ -1296,29 +1071,60 @@ components:
type: array
description: A list containing the IDs of uploaded files that contain training data.
validation_files:
- items:
- format: uuid
- type: string
- type: array
- default: [ ]
+ anyOf:
+ - items:
+ format: uuid
+ type: string
+ type: array
+ - type: "null"
+ default: []
title: Validation Files
description: A list containing the IDs of uploaded files that contain validation data.
object:
const: job
default: job
title: Object
+ description: The object type of the fine-tuning job.
fine_tuned_model:
- type: string
+ anyOf:
+ - type: string
+ - type: "null"
title: Fine Tuned Model
description: The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.
+ suffix:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Suffix
+ description: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.
integrations:
- items:
- "$ref": "#/components/schemas/WandbIntegrationOut"
- type: array
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/WandbIntegrationOut"
+ type: array
+ - type: "null"
title: Integrations
description: A list of integrations enabled for your fine-tuning job.
+ trained_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Trained Tokens
+ description: Total number of tokens trained.
+ repositories:
+ default: []
+ items:
+ $ref: "#/components/schemas/GithubRepositoryOut"
+ maxItems: 20
+ title: Repositories
+ type: array
+ metadata:
+ anyOf:
+ - $ref: "#/components/schemas/JobMetadataOut"
+ - type: "null"
required:
- id
+ - auto_start
- hyperparameters
- model
- status
@@ -1331,41 +1137,50 @@ components:
JobsOut:
properties:
data:
- default: [ ]
+ default: []
items:
- "$ref": "#/components/schemas/JobOut"
+ $ref: "#/components/schemas/JobOut"
title: Data
type: array
object:
const: list
default: list
title: Object
+ total:
+ title: Total
+ type: integer
+ required:
+ - total
title: JobsOut
type: object
TrainingParameters:
- description: The fine-tuning hyperparameter settings used in a fine-tune job.
properties:
training_steps:
- minimum: 1
+ anyOf:
+ - minimum: 1
+ type: integer
+ - type: "null"
title: Training Steps
- type: integer
- description: |
- The number of training steps to perform. A training step refers to
- a single update of the model weights during the fine-tuning process.
- This update is typically calculated using a batch of samples from the
- training dataset.
learning_rate:
default: 0.0001
maximum: 1
- minimum: 1.0e-08
+ minimum: 0.00000001
title: Learning Rate
type: number
- description: |
- A parameter describing how much to adjust the pre-trained model's weights
- in response to the estimated error each time the weights are updated during
- the fine-tuning process.
- required:
- - training_steps
+ epochs:
+ anyOf:
+ - minimum: 0.01
+ type: number
+ - type: "null"
+ title: Epochs
+ fim_ratio:
+ anyOf:
+ - maximum: 1
+ minimum: 0
+ type: number
+ - type: "null"
+ default: 0.9
+ title: Fim Ratio
title: TrainingParameters
type: object
WandbIntegrationOut:
@@ -1379,62 +1194,236 @@ components:
type: string
description: The name of the project that the new run will be created under.
name:
- type: string
+ anyOf:
+ - type: string
+ - type: "null"
title: Name
description: A display name to set for the run. If not set, will use the job ID as the name.
+ run_name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Run Name
required:
- project
title: WandbIntegrationOut
type: object
+ LegacyJobMetadataOut:
+ properties:
+ expected_duration_seconds:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Expected Duration Seconds
+ description: The approximated time (in seconds) for the fine-tuning process to complete.
+ examples:
+ - 220
+ cost:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Cost
+ description: The cost of the fine-tuning job.
+ examples:
+ - 10
+ cost_currency:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Cost Currency
+ description: The currency used for the fine-tuning job cost.
+ examples:
+ - EUR
+ train_tokens_per_step:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Train Tokens Per Step
+ description: The number of tokens consumed by one training step.
+ examples:
+ - 131072
+ train_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Train Tokens
+ description: The total number of tokens used during the fine-tuning process.
+ examples:
+ - 1310720
+ data_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Data Tokens
+ description: The total number of tokens in the training dataset.
+ examples:
+ - 305375
+ estimated_start_time:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Estimated Start Time
+ deprecated:
+ default: true
+ title: Deprecated
+ type: boolean
+ details:
+ title: Details
+ type: string
+ epochs:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Epochs
+ description: The number of complete passes through the entire training dataset.
+ examples:
+ - 4.2922
+ training_steps:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Training Steps
+ description: The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.
+ examples:
+ - 10
+ object:
+ const: job.metadata
+ default: job.metadata
+ title: Object
+ required:
+ - details
+ title: LegacyJobMetadataOut
+ type: object
+ GithubRepositoryIn:
+ properties:
+ type:
+ const: github
+ default: github
+ title: Type
+ name:
+ title: Name
+ type: string
+ owner:
+ title: Owner
+ type: string
+ ref:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Ref
+ weight:
+ default: 1.0
+ exclusiveMinimum: 0
+ title: Weight
+ type: number
+ token:
+ title: Token
+ type: string
+ required:
+ - name
+ - owner
+ - token
+ title: GithubRepositoryIn
+ type: object
JobIn:
properties:
model:
- "$ref": "#/components/schemas/FineTuneableModel"
+ $ref: "#/components/schemas/FineTuneableModel"
training_files:
+ default: []
items:
- format: uuid
- type: string
- description: A list containing the IDs of uploaded files that contain training data.
- minItems: 1
+ $ref: "#/components/schemas/TrainingFile"
title: Training Files
type: array
validation_files:
- description: |
- A list containing the IDs of uploaded files that contain validation data.
-
- If you provide these files, the data is used to generate validation metrics
- periodically during fine-tuning. These metrics can be viewed in `checkpoints`
- when getting the status of a running fine-tuning job.
-
- The same data should not be present in both train and validation files.
- items:
- format: uuid
- type: string
- type: array
+ anyOf:
+ - items:
+ format: uuid
+ type: string
+ type: array
+ - type: "null"
title: Validation Files
+ description: "A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files."
hyperparameters:
- "$ref": "#/components/schemas/TrainingParameters"
+ $ref: "#/components/schemas/TrainingParametersIn"
suffix:
- maxLength: 18
- type: string
+ anyOf:
+ - maxLength: 18
+ type: string
+ - type: "null"
title: Suffix
- description: |
- A string that will be added to your fine-tuning model name.
- For example, a suffix of "my-great-model" would produce a model
- name like `ft:open-mistral-7b:my-great-model:xxx...`
+ description: 'A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`'
integrations:
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/WandbIntegration"
+ type: array
+ - type: "null"
+ title: Integrations
description: A list of integrations to enable for your fine-tuning job.
+ repositories:
+ default: []
items:
- "$ref": "#/components/schemas/WandbIntegration"
+ $ref: "#/components/schemas/GithubRepositoryIn"
+ title: Repositories
type: array
- uniqueItems: true
- title: Integrations
+ auto_start:
+ description: This field will be required in a future release.
+ title: Auto Start
+ type: boolean
required:
- model
- - training_files
- hyperparameters
title: JobIn
type: object
+ TrainingFile:
+ properties:
+ file_id:
+ format: uuid
+ title: File Id
+ type: string
+ weight:
+ default: 1.0
+ exclusiveMinimum: 0
+ title: Weight
+ type: number
+ required:
+ - file_id
+ title: TrainingFile
+ type: object
+ TrainingParametersIn:
+ properties:
+ training_steps:
+ anyOf:
+ - minimum: 1
+ type: integer
+ - type: "null"
+ title: Training Steps
+ description: "The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset."
+ learning_rate:
+ default: 0.0001
+ maximum: 1
+ minimum: 0.00000001
+ title: Learning Rate
+ type: number
+ description: "A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process."
+ epochs:
+ anyOf:
+ - minimum: 0.01
+ type: number
+ - type: "null"
+ title: Epochs
+ fim_ratio:
+ anyOf:
+ - maximum: 1
+ minimum: 0
+ type: number
+ - type: "null"
+ default: 0.9
+ title: Fim Ratio
+ title: TrainingParametersIn
+ type: object
+ description: The fine-tuning hyperparameter settings used in a fine-tune job.
WandbIntegration:
properties:
type:
@@ -1446,13 +1435,22 @@ components:
type: string
description: The name of the project that the new run will be created under.
name:
- type: string
+ anyOf:
+ - type: string
+ - type: "null"
title: Name
description: A display name to set for the run. If not set, will use the job ID as the name.
api_key:
+ maxLength: 40
+ minLength: 40
title: Api Key
type: string
description: The WandB API key to use for authentication.
+ run_name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Run Name
required:
- project
- api_key
@@ -1461,7 +1459,7 @@ components:
CheckpointOut:
properties:
metrics:
- "$ref": "#/components/schemas/MetricOut"
+ $ref: "#/components/schemas/MetricOut"
step_number:
title: Step Number
type: integer
@@ -1470,6 +1468,8 @@ components:
title: Created At
type: integer
description: The UNIX timestamp (in seconds) for when the checkpoint was created.
+ examples:
+ - 1716963433
required:
- metrics
- step_number
@@ -1482,80 +1482,104 @@ components:
format: uuid
title: Id
type: string
+ auto_start:
+ title: Auto Start
+ type: boolean
hyperparameters:
- "$ref": "#/components/schemas/TrainingParameters"
+ $ref: "#/components/schemas/TrainingParameters"
model:
- "$ref": "#/components/schemas/FineTuneableModel"
+ $ref: "#/components/schemas/FineTuneableModel"
status:
enum:
- QUEUED
- STARTED
+ - VALIDATING
+ - VALIDATED
- RUNNING
+ - FAILED_VALIDATION
- FAILED
- SUCCESS
- CANCELLED
- CANCELLATION_REQUESTED
title: Status
type: string
- description: The current status of the fine-tuning job.
job_type:
title: Job Type
type: string
- description: The type of job (`FT` for fine-tuning).
created_at:
title: Created At
type: integer
- description: The UNIX timestamp (in seconds) for when the fine-tuning job was created.
modified_at:
title: Modified At
type: integer
- description: The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.
training_files:
items:
format: uuid
type: string
title: Training Files
type: array
- description: A list containing the IDs of uploaded files that contain training data.
validation_files:
- items:
- format: uuid
- type: string
- type: array
- default: [ ]
+ anyOf:
+ - items:
+ format: uuid
+ type: string
+ type: array
+ - type: "null"
+ default: []
title: Validation Files
- description: A list containing the IDs of uploaded files that contain validation data.
object:
const: job
default: job
title: Object
fine_tuned_model:
- type: string
+ anyOf:
+ - type: string
+ - type: "null"
title: Fine Tuned Model
- description: The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.
+ suffix:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Suffix
integrations:
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/WandbIntegrationOut"
+ type: array
+ - type: "null"
+ title: Integrations
+ trained_tokens:
+ anyOf:
+ - type: integer
+ - type: "null"
+ title: Trained Tokens
+ repositories:
+ default: []
items:
- "$ref": "#/components/schemas/WandbIntegrationOut"
+ $ref: "#/components/schemas/GithubRepositoryOut"
+ maxItems: 20
+ title: Repositories
type: array
- title: Integrations
- description: A list of integrations enabled for your fine-tuning job.
+ metadata:
+ anyOf:
+ - $ref: "#/components/schemas/JobMetadataOut"
+ - type: "null"
events:
- default: [ ]
+ default: []
items:
- "$ref": "#/components/schemas/EventOut"
+ $ref: "#/components/schemas/EventOut"
title: Events
type: array
- description: |
- Event items are created every time the status of a fine-tuning job changes.
- The timestamped list of all events is accessible here.
+ description: "Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here."
checkpoints:
- default: [ ]
+ default: []
items:
- "$ref": "#/components/schemas/CheckpointOut"
+ $ref: "#/components/schemas/CheckpointOut"
title: Checkpoints
type: array
required:
- id
+ - auto_start
- hyperparameters
- model
- status
@@ -1572,306 +1596,871 @@ components:
type: string
description: The name of the event.
data:
- enum:
- - QUEUED
- - STARTED
- - RUNNING
- - FAILED
- - SUCCESS
- - CANCELLED
- - CANCELLATION_REQUESTED
- type: string
+ anyOf:
+ - type: object
+ additionalProperties: true
+ - type: "null"
title: Data
- description: The status of the fine-tuning job at the time of the event
created_at:
title: Created At
type: integer
description: The UNIX timestamp (in seconds) of the event.
required:
- name
- - created_at
- title: EventOut
+ - created_at
+ title: EventOut
+ type: object
+ MetricOut:
+ properties:
+ train_loss:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Train Loss
+ valid_loss:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Valid Loss
+ valid_mean_token_accuracy:
+ anyOf:
+ - type: number
+ - type: "null"
+ title: Valid Mean Token Accuracy
+ title: MetricOut
+ type: object
+ description: "Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase)."
+ FTModelCapabilitiesOut:
+ properties:
+ completion_chat:
+ default: true
+ title: Completion Chat
+ type: boolean
+ completion_fim:
+ default: false
+ title: Completion Fim
+ type: boolean
+ function_calling:
+ default: false
+ title: Function Calling
+ type: boolean
+ fine_tuning:
+ default: false
+ title: Fine Tuning
+ type: boolean
+ title: FTModelCapabilitiesOut
+ type: object
+ FTModelOut:
+ properties:
+ id:
+ title: Id
+ type: string
+ object:
+ const: model
+ default: model
+ title: Object
+ created:
+ title: Created
+ type: integer
+ owned_by:
+ title: Owned By
+ type: string
+ root:
+ title: Root
+ type: string
+ archived:
+ title: Archived
+ type: boolean
+ name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Name
+ description:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Description
+ capabilities:
+ $ref: "#/components/schemas/FTModelCapabilitiesOut"
+ max_context_length:
+ default: 32768
+ title: Max Context Length
+ type: integer
+ aliases:
+ default: []
+ items:
+ type: string
+ title: Aliases
+ type: array
+ job:
+ format: uuid
+ title: Job
+ type: string
+ required:
+ - id
+ - created
+ - owned_by
+ - root
+ - archived
+ - capabilities
+ - job
+ title: FTModelOut
+ type: object
+ UpdateFTModelIn:
+ properties:
+ name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Name
+ description:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Description
+ title: UpdateFTModelIn
+ type: object
+ ArchiveFTModelOut:
+ properties:
+ id:
+ title: Id
+ type: string
+ object:
+ const: model
+ default: model
+ title: Object
+ archived:
+ default: true
+ title: Archived
+ type: boolean
+ required:
+ - id
+ title: ArchiveFTModelOut
+ type: object
+ UnarchiveFTModelOut:
+ properties:
+ id:
+ title: Id
+ type: string
+ object:
+ const: model
+ default: model
+ title: Object
+ archived:
+ default: false
+ title: Archived
+ type: boolean
+ required:
+ - id
+ title: UnarchiveFTModelOut
+ type: object
+ AssistantMessage:
+ properties:
+ content:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Content
+ tool_calls:
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/ToolCall"
+ type: array
+ - type: "null"
+ title: Tool Calls
+ prefix:
+ type: boolean
+ title: Prefix
+ default: false
+ description: "Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message."
+ role:
+ type: string
+ default: assistant
+ title: Role
+ enum:
+ - assistant
+ additionalProperties: false
+ type: object
+ title: AssistantMessage
+ ChatCompletionRequest:
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Model
+ description: ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions.
+ examples:
+ - mistral-small-latest
+ temperature:
+ type: number
+ maximum: 1.5
+ minimum: 0
+ title: Temperature
+ default: 0.7
+ description: "What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both."
+ top_p:
+ type: number
+ maximum: 1
+ minimum: 0
+ title: Top P
+ default: 1.0
+ description: "Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both."
+ max_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Max Tokens
+ description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."
+ min_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Min Tokens
+ description: The minimum number of tokens to generate in the completion.
+ stream:
+ type: boolean
+ title: Stream
+ default: false
+ description: "Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON."
+ stop:
+ anyOf:
+ - type: string
+ - items:
+ type: string
+ type: array
+ title: Stop
+ description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
+ random_seed:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Random Seed
+ description: The seed to use for random sampling. If set, different calls will generate deterministic results.
+ messages:
+ items:
+ oneOf:
+ - $ref: "#/components/schemas/SystemMessage"
+ - $ref: "#/components/schemas/UserMessage"
+ - $ref: "#/components/schemas/AssistantMessage"
+ - $ref: "#/components/schemas/ToolMessage"
+ discriminator:
+ propertyName: role
+ mapping:
+ assistant: "#/components/schemas/AssistantMessage"
+ system: "#/components/schemas/SystemMessage"
+ tool: "#/components/schemas/ToolMessage"
+ user: "#/components/schemas/UserMessage"
+ type: array
+ title: Messages
+ description: The prompt(s) to generate completions for, encoded as a list of dict with role and content.
+ examples:
+ - {
+ "role": "user",
+ "content": "Who is the best French painter? Answer in one short sentence.",
+ }
+ response_format:
+ $ref: "#/components/schemas/ResponseFormat"
+ tools:
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/Tool"
+ type: array
+ - type: "null"
+ title: Tools
+ tool_choice:
+ allOf:
+ - $ref: "#/components/schemas/ToolChoice"
+ default: auto
+ safe_prompt:
+ type: boolean
+ description: Whether to inject a safety prompt before all conversations.
+ default: false
+ additionalProperties: false
+ type: object
+ required:
+ - messages
+ - model
+ title: ChatCompletionRequest
+ ChunkTypes:
+ type: string
+ const: text
+ title: ChunkTypes
+ ContentChunk:
+ properties:
+ type:
+ allOf:
+ - $ref: "#/components/schemas/ChunkTypes"
+ default: text
+ text:
+ type: string
+ title: Text
+ additionalProperties: false
+ type: object
+ required:
+ - text
+ title: ContentChunk
+ FIMCompletionRequest:
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Model
+ default: codestral-2405
+ description: "ID of the model to use. Only compatible for now with:\n - `codestral-2405`\n - `codestral-latest`"
+ examples:
+ - codestral-2405
+ temperature:
+ type: number
+ maximum: 1.5
+ minimum: 0
+ title: Temperature
+ default: 0.7
+ description: "What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both."
+ top_p:
+ type: number
+ maximum: 1
+ minimum: 0
+ title: Top P
+ default: 1.0
+ description: "Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both."
+ max_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Max Tokens
+ description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."
+ min_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Min Tokens
+ description: The minimum number of tokens to generate in the completion.
+ stream:
+ type: boolean
+ title: Stream
+ default: false
+ description: "Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON."
+ stop:
+ anyOf:
+ - type: string
+ - items:
+ type: string
+ type: array
+ title: Stop
+ description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
+ random_seed:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Random Seed
+ description: The seed to use for random sampling. If set, different calls will generate deterministic results.
+ prompt:
+ type: string
+ title: Prompt
+ description: "The text/code to complete."
+ examples:
+ - def
+ suffix:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Suffix
+ default: ""
+ description: "Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`."
+ examples:
+ - return a+b
+ additionalProperties: false
+ type: object
+ required:
+ - prompt
+ - model
+ title: FIMCompletionRequest
+ Function:
+ properties:
+ name:
+ type: string
+ title: Name
+ description:
+ type: string
+ title: Description
+ default: ""
+ parameters:
+ type: object
+ title: Parameters
+ additionalProperties: true
+ additionalProperties: false
+ type: object
+ required:
+ - name
+ - parameters
+ title: Function
+ FunctionCall:
+ properties:
+ name:
+ type: string
+ title: Name
+ arguments:
+ title: Arguments
+ anyOf:
+ - type: object
+ additionalProperties: true
+ - type: string
+ additionalProperties: false
+ type: object
+ required:
+ - name
+ - arguments
+ title: FunctionCall
+ ResponseFormat:
+ properties:
+ type:
+ allOf:
+ - $ref: "#/components/schemas/ResponseFormats"
+ default: text
+ additionalProperties: false
type: object
- MetricOut:
+ title: ResponseFormat
+ ResponseFormats:
+ type: string
+ enum:
+ - text
+ - json_object
+ title: ResponseFormats
+ description: 'An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.'
+ SystemMessage:
properties:
- train_loss:
- type: number
- title: Train Loss
- valid_loss:
- type: number
- title: Valid Loss
- valid_mean_token_accuracy:
- type: number
- title: Valid Mean Token Accuracy
- title: MetricOut
- description: |
- Metrics at the step number during the fine-tuning job. Use these metrics to
- assess if the training is going smoothly (loss should decrease, token accuracy
- should increase).
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: "#/components/schemas/ContentChunk"
+ type: array
+ title: Content
+ role:
+ type: string
+ default: system
+ enum:
+ - system
+ additionalProperties: false
type: object
- UploadFileResponse:
+ required:
+ - content
+ title: SystemMessage
+ TextChunk:
properties:
- id:
- format: uuid
- title: Id
- type: string
- example: 497f6eca-6276-4993-bfeb-53cbbbba6f09
- object:
- title: Object
- type: string
- example: test
- bytes:
- title: Bytes
- type: integer
- example: 13000
- created_at:
- title: Created At
- type: integer
- example: 1716963433
- filename:
- title: Filename
- type: string
- example: files_upload.jsonl
- purpose:
- title: Purpose
+ type:
+ const: text
+ title: Type
+ default: text
+ text:
type: string
- example: fine-tune
+ title: Text
+ additionalProperties: false
+ type: object
required:
- - id
- - object
- - bytes
- - created_at
- - filename
- - purpose
- title: UploadFileResponse
+ - text
+ title: TextChunk
+ Tool:
+ properties:
+ type:
+ allOf:
+ - $ref: "#/components/schemas/ToolTypes"
+ default: function
+ function:
+ $ref: "#/components/schemas/Function"
+ additionalProperties: false
type: object
- FileSchema:
+ required:
+ - function
+ title: Tool
+ ToolCall:
properties:
id:
- format: uuid
- title: Id
- type: string
- description: The file identifier, which can be referenced in the API endpoints
- example: d56b5e4f-16ae-4f07-be8e-b837aa10240f
- object:
- title: Object
type: string
- description: The object type, which is always `file`.
- example: "file"
- bytes:
- title: Bytes
- type: integer
- description: The size of the file, in bytes.
- example: 1534119
- created_at:
- title: Created At
- type: integer
- description: The UNIX timestamp (in seconds) for when the file was created.
- example: 1716329302
- filename:
- title: Filename
+ title: Id
+ default: "null"
+ type:
+ allOf:
+ - $ref: "#/components/schemas/ToolTypes"
+ default: function
+ function:
+ $ref: "#/components/schemas/FunctionCall"
+ additionalProperties: false
+ type: object
+ required:
+ - function
+ title: ToolCall
+ ToolChoice:
+ type: string
+ enum:
+ - auto
+ - none
+ - any
+ title: ToolChoice
+ ToolMessage:
+ properties:
+ content:
type: string
- description: The name of the file
- example: file_upload.jsonl
- purpose:
- title: Purpose
+ title: Content
+ tool_call_id:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Tool Call Id
+ name:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Name
+ role:
type: string
- description: The intended purpose of the file. Only supports `fine-tune` for now.
- example: fine-tune
+ default: tool
+ enum:
+ - tool
+ additionalProperties: false
+ type: object
required:
- - id
- - object
- - bytes
- - created_at
- - filename
- - purpose
- title: FileSchema
+ - content
+ title: ToolMessage
+ ToolTypes:
+ type: string
+ const: function
+ title: ToolTypes
+ UserMessage:
+ properties:
+ content:
+ title: Content
+ anyOf:
+ - type: string
+ - items:
+ $ref: "#/components/schemas/TextChunk"
+ type: array
+ role:
+ type: string
+ default: user
+ enum:
+ - user
+ additionalProperties: false
type: object
- ListFilesResponse:
+ required:
+ - content
+ title: UserMessage
+ AgentsCompletionRequest:
properties:
- data:
- items:
- $ref: '#/components/schemas/FileSchema'
- title: Data
+ max_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Max Tokens
+ description: "The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."
+ min_tokens:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Min Tokens
+ description: The minimum number of tokens to generate in the completion.
+ stream:
+ type: boolean
+ title: Stream
+ default: false
+ description: "Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON."
+ stop:
+ anyOf:
+ - type: string
+ - items:
+ type: string
+ type: array
+ title: Stop
+ description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
+ random_seed:
+ anyOf:
+ - type: integer
+ minimum: 0
+ - type: "null"
+ title: Random Seed
+ description: The seed to use for random sampling. If set, different calls will generate deterministic results.
+ messages:
type: array
- object:
- title: Object
+ title: Messages
+ items:
+ oneOf:
+ - $ref: "#/components/schemas/UserMessage"
+ - $ref: "#/components/schemas/AssistantMessage"
+ - $ref: "#/components/schemas/ToolMessage"
+ discriminator:
+ propertyName: role
+ mapping:
+ assistant: "#/components/schemas/AssistantMessage"
+ tool: "#/components/schemas/ToolMessage"
+ user: "#/components/schemas/UserMessage"
+ description: The prompt(s) to generate completions for, encoded as a list of dict with role and content.
+ examples:
+ - {
+ "role": "user",
+ "content": "Who is the best French painter? Answer in one short sentence.",
+ }
+ response_format:
+ $ref: "#/components/schemas/ResponseFormat"
+ tools:
+ anyOf:
+ - items:
+ $ref: "#/components/schemas/Tool"
+ type: array
+ - type: "null"
+ title: Tools
+ tool_choice:
+ allOf:
+ - $ref: "#/components/schemas/ToolChoice"
+ default: auto
+ agent_id:
type: string
- required:
- - data
- - object
- title: ListFilesResponse
+ description: The ID of the agent to use for this completion.
+ additionalProperties: false
type: object
- RetrieveFileResponse:
+ required:
+ - messages
+ - agent_id
+ title: AgentsCompletionRequest
+ EmbeddingRequest:
properties:
- id:
- format: uuid
- title: Id
- type: string
- object:
- title: Object
+ input:
+ anyOf:
+ - type: string
+ - items:
+ type: string
+ type: array
+ title: Input
+ description: Text to embed.
+ model:
type: string
- bytes:
- title: Bytes
+ title: Model
+ description: ID of the model to use.
+ encoding_format:
+ anyOf:
+ - type: string
+ - type: "null"
+ title: Encoding Format
+ description: The format to return the embeddings in.
+ default: float
+ additionalProperties: false
+ type: object
+ required:
+ - input
+ - model
+ title: EmbeddingRequest
+ UsageInfo:
+ title: UsageInfo
+ type: object
+ properties:
+ prompt_tokens:
type: integer
- created_at:
- title: Created At
+ example: 16
+ completion_tokens:
type: integer
- filename:
- title: Filename
- type: string
- purpose:
- title: Purpose
- type: string
+ example: 34
+ total_tokens:
+ type: integer
+ example: 50
required:
- - id
- - object
- - bytes
- - created_at
- - filename
- - purpose
- title: RetrieveFileResponse
+ - prompt_tokens
+ - completion_tokens
+ - total_tokens
+ ResponseBase:
type: object
- DeleteFileResponse:
+ title: ResponseBase
properties:
id:
- format: uuid
- title: Id
type: string
+ example: cmpl-e5cc70bb28c444948073e77776eb30ef
object:
- title: Object
type: string
- deleted:
- title: Deleted
- type: boolean
- required:
- - id
- - object
- - deleted
- title: DeleteFileResponse
+ example: "chat.completion"
+ model:
+ type: string
+ example: mistral-small-latest
+ usage:
+ $ref: "#/components/schemas/UsageInfo"
+ ChatCompletionChoice:
+ title: ChatCompletionChoice
type: object
+ required:
+ - index
+ - text
+ - finish_reason
+ properties:
+ index:
+ type: integer
+ example: 0
+ message:
+ $ref: "#/components/schemas/AssistantMessage"
+ finish_reason:
+ type: string
+ enum:
+ - stop
+ - length
+ - model_length
+ - error
+ - tool_calls
+ example: stop
+ ChatCompletionResponseBase:
+ allOf:
+ - $ref: "#/components/schemas/ResponseBase"
+ - type: object
+ title: ChatCompletionResponseBase
+ properties:
+ created:
+ type: integer
+ example: 1702256327
+ ChatCompletionResponse:
+ allOf:
+ - $ref: "#/components/schemas/ChatCompletionResponseBase"
+ - type: object
+ title: ChatCompletionResponse
+ properties:
+ choices:
+ type: array
+ items:
+ $ref: "#/components/schemas/ChatCompletionChoice"
+ required:
+ - id
+ - object
+ - data
+ - model
+ - usage
FIMCompletionResponse:
+ allOf:
+ - $ref: "#/components/schemas/ChatCompletionResponse"
+ - type: object
+ properties:
+ model:
+ type: string
+ example: codestral-latest
+ EmbeddingResponseData:
+ title: EmbeddingResponseData
type: object
+ properties:
+ object:
+ type: string
+ example: embedding
+ embedding:
+ type: array
+ items:
+ type: number
+ example: [0.1, 0.2, 0.3]
+ index:
+ type: integer
+ example: 0
+ example:
+ [
+ { "object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0 },
+ { "object": "embedding", "embedding": [0.4, 0.5, 0.6], "index": 1 },
+ ]
+ EmbeddingResponse:
+ allOf:
+ - $ref: "#/components/schemas/ResponseBase"
+ - type: object
+ properties:
+ data:
+ type: array
+ items:
+ - $ref: "#/components/schemas/EmbeddingResponseData"
+ required:
+ - id
+ - object
+ - data
+ - model
+ - usage
+ CompletionEvent:
+ type: object
+ required: [data]
+ properties:
+ data:
+ $ref: "#/components/schemas/CompletionChunk"
+ CompletionChunk:
+ type: object
+ required: [id, model, choices]
properties:
id:
type: string
- example: 5b35cc2e69bf4ba9a11373ee1f1937f8
object:
type: string
- example: "chat.completion"
created:
type: integer
- example: 1702256327
model:
type: string
- example: codestral-latest
+ usage:
+ $ref: "#/components/schemas/UsageInfo"
choices:
type: array
items:
- type: object
- required:
- - index
- - text
- - finish_reason
- properties:
- index:
- type: integer
- example: 0
- message:
- type: object
- properties:
- role:
- type: string
- enum:
- - user
- - assistant
- example: assistant
- content:
- type: string
- example: >-
- " add(a,b):"
- finish_reason:
- type: string
- enum:
- - stop
- - length
- - model_length
- - error
- example: stop
- usage:
- type: object
- properties:
- prompt_tokens:
- type: integer
- example: 8
- completion_tokens:
- type: integer
- example: 9
- total_tokens:
- type: integer
- example: 17
- required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
- JobMetadata:
+ $ref: "#/components/schemas/CompletionResponseStreamChoice"
+ CompletionResponseStreamChoice:
type: object
- title: JobMetadata
+ required: [index, delta, finish_reason]
properties:
- training_steps:
- type: integer
- description: |
- The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.
- name: Training steps
- example: 10
- train_tokens_per_step:
- type: integer
- description: The number of tokens consumed by one training step.
- name: Training tokens per step
- example: 131072
- data_tokens:
- type: integer
- description: The total number of tokens in the training dataset.
- example: 305375
- train_tokens:
- type: integer
- description: The total number of tokens used during the fine-tuning process.
- example: 1310720
- epochs:
- type: float
- description: The number of complete passes through the entire training dataset.
- example: 4.2922
- expected_duration_seconds:
+ index:
type: integer
- description: The approximated time (in seconds) for the fine-tuning process to complete.
- example: 220
- HTTPValidationError:
- properties:
- detail:
- items:
- "$ref": "#/components/schemas/ValidationError"
- type: array
- title: Detail
+ delta:
+ $ref: "#/components/schemas/DeltaMessage"
+ finish_reason:
+ type: [string, "null"]
+ enum:
+ - stop
+ - length
+ - error
+ - tool_calls
+ - null
+ DeltaMessage:
type: object
- title: HTTPValidationError
- ValidationError:
- properties:
- loc:
- items:
- anyOf:
- - type: string
- - type: integer
- type: array
- title: Location
- msg:
- type: string
- title: Message
- type:
- type: string
- title: Error Type
- type: object
- required:
- - loc
- - msg
- - type
- title: ValidationError
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ tool_calls:
+ anyOf:
+ - type: "null"
+ - type: array
+ $ref: "#/components/schemas/ToolCall"
+ securitySchemes:
+ ApiKey:
+ type: http
+ scheme: bearer
+tags:
+ - name: chat
+ x-displayName: Chat
+ description: Chat Completion API.
+ - name: fim
+ x-displayName: FIM
+ description: Fill-in-the-middle API.
+ - name: agents
+ x-displayName: Agents
+ description: Agents API.
+ - name: embeddings
+ x-displayName: Embeddings
+ description: Embeddings API.
+ - name: files
+ x-displayName: Files
+ description: Files API
+ - name: fine-tuning
+ x-displayName: Fine Tuning
+ description: Fine-tuning API
+ - name: models
+ x-displayName: Models
+ description: Model Management API
+security:
+ - ApiKey: []
+servers:
+ - url: https://api.mistral.ai
+ description: Production server
diff --git a/static/img/French_agent.png b/static/img/French_agent.png
new file mode 100644
index 0000000..520364f
Binary files /dev/null and b/static/img/French_agent.png differ
diff --git a/static/img/Python_agent.png b/static/img/Python_agent.png
new file mode 100644
index 0000000..02d075e
Binary files /dev/null and b/static/img/Python_agent.png differ
diff --git a/static/img/agent.png b/static/img/agent.png
new file mode 100644
index 0000000..4e91e12
Binary files /dev/null and b/static/img/agent.png differ
diff --git a/static/img/loving_agent.png b/static/img/loving_agent.png
new file mode 100644
index 0000000..def265a
Binary files /dev/null and b/static/img/loving_agent.png differ
diff --git a/version.txt b/version.txt
index 06ee1af..c8fe2be 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-v0.0.68
+v0.0.15