Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mistralai Client python FineTuningJobs Get List

From Leeroopedia
Knowledge Sources
Domains Fine_Tuning, Job_Management
Last Updated 2026-02-15 14:00 GMT

Overview

Concrete tool for querying fine-tuning job status and listing jobs provided by the FineTuningJobs resource.

Description

FineTuningJobs.get() retrieves a single job by ID, returning its current status, training metrics, checkpoints, and fine-tuned model name (if completed). FineTuningJobs.list() retrieves all jobs with optional filtering by model name, status, and pagination. Both have async variants.

Usage

Call client.fine_tuning.jobs.get(job_id=...) to check a specific job, or client.fine_tuning.jobs.list() to see all jobs.

Code Reference

Source Location

  • Repository: client-python
  • File: src/mistralai/client/fine_tuning_jobs.py
  • Lines: L553-637 (get sync), L639-723 (get async), L21-132 (list sync), L134-245 (list async)

Signature

class FineTuningJobs:
    def get(self, *, job_id: str) -> JobsAPIRoutesFineTuningGetFineTuningJobResponse: ...
    async def get_async(self, *, job_id: str) -> JobsAPIRoutesFineTuningGetFineTuningJobResponse: ...
    def list(self, *, page: int = 0, page_size: int = 100, model: Optional[str] = None, status: Optional[...] = None) -> JobsOut: ...
    async def list_async(self, *, page: int = 0, page_size: int = 100, model: Optional[str] = None, status: Optional[...] = None) -> JobsOut: ...

Import

from mistralai import Mistral
# Access via: client.fine_tuning.jobs.get(...) or client.fine_tuning.jobs.list(...)

I/O Contract

Inputs (get)

Name Type Required Description
job_id str Yes Fine-tuning job UUID

Inputs (list)

Name Type Required Description
page int No Pagination page (default 0)
page_size int No Results per page (default 100)
model Optional[str] No Filter by model name
status Optional[...] No Filter by job status

Outputs

Name Type Description
job (get) DetailedJobOut Job details with status, metrics, checkpoints
jobs (list) JobsOut Paginated list of jobs

Usage Examples

Monitor Job Status

import time
from mistralai import Mistral

client = Mistral(api_key="your-key")

# Poll until completion
while True:
    job = client.fine_tuning.jobs.get(job_id="job-abc123")
    print(f"Status: {job.status}")
    if job.status in ("SUCCEEDED", "FAILED", "CANCELLED"):
        break
    time.sleep(30)

if job.status == "SUCCEEDED":
    print(f"Fine-tuned model: {job.fine_tuned_model}")

# List all jobs
all_jobs = client.fine_tuning.jobs.list()
for j in all_jobs.data:
    print(f"{j.id}: {j.status}")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment