---
title: "Prepare a fine-tuned model for FP4 inference"
method: POST
path: "/v1/shaping/prepare-for-fp4-inference"
tags: ["Shaping"]
---

# Prepare a fine-tuned model for FP4 inference

`POST /v1/shaping/prepare-for-fp4-inference`

## Request

- Base URL: `https://api.together.ai`
- URL: `https://api.together.ai/v1/shaping/prepare-for-fp4-inference`
- Auth: HTTP bearer

Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402.

## Request body

- QuantizationRequest: Request body for preparing a fine-tuned model for FP4 inference.
  - `inputs` QuantizationPipelineInputs, required: The model to prepare: an adapter or a full model. A request names it by the `model_*` fields or the deprecated `adapter_*` fields, never a mix of the two, and gives a revision only beside the ID it belongs to. A job returns both names, with the same values.
    - `model_object_id` string: Model object ID of the model to prepare. It names the input model; it is not the `results.model_object_id` of a job, which names the model the job produced.
    - `model_revision_id` string: Revision ID of the model to prepare. Omit to use the model's current revision. Only valid with `model_object_id`.
    - `calibration_file_id` string: Conversation dataset file ID to use for calibration. Upload it first with `POST /v1/files` using purpose `calibration` and file type `jsonl`. Each JSONL row must contain a `messages` array and may contain a `tools` array. When provided, the job draws half of the calibration corpus from this file and half from a general-text corpus. When omitted, the job calibrates on the general-text corpus only. The request is rejected unless the file exists in the request project, has finished uploading, has passed files API validation as a conversation dataset, is not empty, and is at most 64 MiB. A `fine-tune` purpose file is also accepted so a training file can be reused.

## Response `200`

Quantization job created successfully.

- QuantizationJob: Quantization job that prepares a fine-tuned model for FP4 inference.
  - `id` string, required: Unique shaping job ID.
  - `job_type` 'quantization', required: Kind of shaping job.
  - `status` 'pending' | 'queued' | 'running' | 'completed' | 'cancelled' | 'cancel_requested' | 'error' | 'user_error', required: Lifecycle status of a shaping job.
  - `created_at` string, date-time, required: Time when the job was created.
  - `updated_at` string, date-time, required: Time when the job was last updated.
  - `user_id` string, required: User that created the job.
  - `params` QuantizationPipelineSpec, required: Stored job specification containing the request and resolved configuration.
    - `inputs` QuantizationPipelineInputs, required: The model to prepare: an adapter or a full model. A request names it by the `model_*` fields or the deprecated `adapter_*` fields, never a mix of the two, and gives a revision only beside the ID it belongs to. A job returns both names, with the same values.
      - `model_object_id` string: Model object ID of the model to prepare. It names the input model; it is not the `results.model_object_id` of a job, which names the model the job produced.
      - `model_revision_id` string: Revision ID of the model to prepare. Omit to use the model's current revision. Only valid with `model_object_id`.
      - `calibration_file_id` string: Conversation dataset file ID to use for calibration. Upload it first with `POST /v1/files` using purpose `calibration` and file type `jsonl`. Each JSONL row must contain a `messages` array and may contain a `tools` array. When provided, the job draws half of the calibration corpus from this file and half from a general-text corpus. When omitted, the job calibrates on the general-text corpus only. The request is rejected unless the file exists in the request project, has finished uploading, has passed files API validation as a conversation dataset, is not empty, and is at most 64 MiB. A `fine-tune` purpose file is also accepted so a training file can be reused.
    - `configuration` QuantizationPipelineConfiguration, required: Server-resolved configuration for a quantization job. The `adapter_*` fields are the deprecated names of the `model_*` ones, with the same values.
      - `user_id` string, required: User whose scope is used to fetch the model weights.
      - `model_project_id` string, required: Project the model belongs to.
      - `model_revision_id` string, required: Revision of the model selected for preparation.
      - `model_name` string, required: Qualified name of the model, which the produced model is named after.
      - `base_object_id` string, required: Model object ID of the base model the prepared model was fine-tuned from.
      - `base_revision_id` string, required: Revision ID of that base model.
      - `base_model_name` string, required: Qualified name of the base model.
  - `results` QuantizationResults: Model artifact produced by a completed quantization job.
    - `model_object_id` string: Model object ID registered by the job.
    - `model_revision_id` string: Model revision ID registered by the job.
  - `events` QuantizationEvent[], required: Events emitted by the job.
    - `object` 'shaping', required: Object type, always `shaping`.
    - `created_at` string, date-time, required: Time when the event was created.
    - `level` 'Info' | 'Warning' | 'Error', required: Severity level for a shaping event.
    - `message` string, required: Human-readable event message.
    - `type` 'SHAPING_ERROR' | 'SHAPING_USER_ERROR' | 'QUANTIZATION_JOB_START' | 'QUANTIZATION_MODEL_DOWNLOAD_COMPLETE' | 'QUANTIZATION_MERGE_COMPLETE' | 'QUANTIZATION_QUANTIZE_PROCESS_START' | 'QUANTIZATION_QUANTIZE_PROCESS_COMPLETE' | 'QUANTIZATION_MODEL_UPLOAD_COMPLETE' | 'QUANTIZATION_JOB_COMPLETE', required: Quantization event type.
    - `hash` string: Event hash used for deduplication.
    - `result` QuantizationResults: Model artifact produced by a completed quantization job.
      - `model_object_id` string: Model object ID registered by the job.
      - `model_revision_id` string: Model revision ID registered by the job.

## Other responses

- `400`: Invalid request parameters.
- `401`: Missing or invalid API key.
- `402`: The project cannot cover the estimated price of the run.
- `403`: The project is blocked and cannot start a run.
- `500`: Internal server error.
- `503`: Preparing models for FP4 inference is not available.

## Changes

- **2026-10-22** `bb5257b3173a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/together/apis/together-apis/changes/v1/shaping/prepare-for-fp4-inference/post.md)

---

[API](https://skmtc.dev/together/apis/together-apis.md) - [All operations](https://skmtc.dev/together/apis/together-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/together/apis/together-apis/revisions/93438ddac711?raw)
