Listing jobs
Returns: list: A list of job details.
Getting job status
Parameters:
job_id(str): The ID of the job to retrieve the status for.
Returns: dict: The status of the job.
Getting job results
Parameters:
job_id(str): The ID of the job to retrieve the results for.include_inputs(bool, optional): Whether to include the inputs in the results. Defaults to False.include_cumulative_logprobs(bool, optional): Whether to include the cumulative logprobs in the results. Defaults to False.with_original_df(Union[pl.DataFrame, pd.DataFrame], optional): Original DataFrame to join results with. Defaults to None.output_column(str, optional): Name of the column containing results. Defaults to “inference_result”.disable_cache(bool, optional): Whether to disable reading from or writing to the local job results cache. Defaults to False.unpack_json(bool, optional): If the output_column is formatted as a JSON string, decides whether to unpack the top level JSON fields in the results into separate columns. Defaults to True.
Returns: Union[pl.DataFrame, pd.DataFrame]: Results as a DataFrame.
- If
with_original_dfis provided: Returns the same type as the input DataFrame with results added as a new column - If
with_original_dfis None: Returns a polars DataFrame by default
The DataFrame will contain:
inputscolumn (ifinclude_inputs=True). Each cell contains the input string given to the model.- The user-provided ID column when the job was submitted with
id_column. This column is returned even wheninclude_inputs=False. inference_resultcolumn (or custom name viaoutput_column)cumulative_logprobscolumn (ifinclude_cumulative_logprobs=True)
Example:
Choosing between
get_job_results() and download_job_results():- Use
get_job_results()for smaller jobs — as a rule of thumb, up to the thousands of rows. One call returns a ready-to-use DataFrame: the output column is namedinference_result, structured outputs are unpacked into columns, and results are cached locally. The whole result set is held in memory. - Use
download_job_results()for anything larger, or when you want the results as a durable Parquet file on disk rather than a DataFrame. It streams with a progress bar and resumes interrupted downloads, but hands you the raw artifact: the output column is named after the job ID, and structured outputs stay as JSON strings.
Downloading large results
get_job_results() is more convenient: it returns a ready DataFrame with friendly column names and unpacked structured outputs, but holds everything in memory. This method instead streams the job’s unified Parquet artifact to disk with a progress bar and returns the local path, leaving the file exactly as the server produced it.
An interrupted download leaves a .part file behind. When resume is True, rerunning the call picks up where it left off using an HTTP Range request, validated against the artifact’s ETag — if the artifact changed server-side (or the ETag isn’t available), the download restarts from scratch instead of resuming.
Parameters:
job_id(str): The ID of the job to download results for.output_path(str, optional): Where to write the Parquet file. May be a directory (the server-provided artifact filename is used) or a full file path. Defaults to the artifact filename in the current directory.include_inputs(bool, optional): Whether to include the inputs in the results. Defaults to False.include_cumulative_logprobs(bool, optional): Whether to include the cumulative logprobs in the results. Defaults to False.resume(bool, optional): Whether to resume a partial download if one exists. Defaults to True.expires_in_seconds(int, optional): TTL for the underlying presigned URLs, up to 604800 (7 days). Defaults to 3600.
Returns: str: The local path of the downloaded Parquet file. Returns None if the request fails.
The job must have succeeded before results can be downloaded — the backend returns 409 for jobs that are still running, since the results artifact is cached permanently once materialized. Use
await_job_completion() first.
The Parquet file’s columns differ from
get_job_results() in one important way: the output column is named after the job ID, not inference_result. The file contains:
inputscolumn (ifinclude_inputs=True)- The user-provided ID column when the job was submitted with
id_column. This column is included even wheninclude_inputs=False. - An output column named after the job ID (e.g.
job-76844041-b2bf-4248-9603-b7f750231b34) cumulative_logprobscolumn (ifinclude_cumulative_logprobs=True)confidence_scorecolumn (when the model provides one)
Structured outputs are kept as raw JSON strings; nothing is unpacked into separate columns (unlike
get_job_results(unpack_json=True)).
Example:
Getting a results download URL
download_job_results(): use it when you want the URLs themselves — to hand the download off to another system, fetch from a different machine, or issue partial Range reads. It wraps the results download URL endpoint; see that page for the full payload reference and raw-HTTP download patterns.
Parameters:
job_id(str): The ID of the job to retrieve results for.include_inputs(bool, optional): Whether to include the inputs in the results. Defaults to False.include_cumulative_logprobs(bool, optional): Whether to include the cumulative logprobs in the results. Defaults to False.expires_in_seconds(int, optional): TTL for the returned presigned URLs, up to 604800 (7 days). Defaults to 3600.
Returns: dict: The endpoint payload, containing
artifact metadata (filename, size_bytes, …) and presigned urls — urls.get for downloading (supports HTTP Range requests) and urls.head for metadata only. Returns None if the request fails.
Example:
Cancelling jobs
Parameters:
job_id(str): The ID of the job to cancel.
Returns: dict: The status of the job cancellation.