Skip to main content
Use this endpoint to merge a trained LoRA adapter back into the base model weights. Merging produces a full-weight model under the merged artifact path, which is required before exporting to deployment formats like GGUF, MLX, MNN, or QNN.

Method + Path

Authentication

Include your PIN API token or JWT in the Authorization header as a Bearer token.

Path parameters

string
required
The model identifier (e.g., md_abc123def456).

Request body

No request body is required.

Request example

Response

Returns a standard PIN success envelope with the merge status.
integer
required
0 on success, nonzero on error.
object
required
string
Human-readable message (empty on success).

Example response

Merge process

  1. The system validates that the model exists and is not already merging.
  2. It generates a temporary Python script using PEFT’s merge_and_unload to fuse the adapter into the base weights.
  3. The merged weights are saved to the model’s merged artifact directory.
  4. On success, the model status returns to ready and artifact_paths.merged is updated.

Errors

Notes

  • If you call POST /v1/models/:id/export before merging, the export service automatically triggers a merge first.
  • For models trained with full-parameter methods (pretrain, qat, distill with mode=full), no merge is needed because the output is already full weights.