Documentation

Training Quantize Module Details

v1.1.11 2026-11

Export training results as GGUF files. Choose weight merging, format conversion, or quantization options for your intended use.

Table of Contents


Overview

The Quantize module is responsible for converting trained models (including base model and LoRA weights) into GGUF format suitable for inference deployment. Due to many parameters and mutual exclusion/dependency relationships, it is strongly recommended to use preset templates for operation.

Core Functions

FunctionDescription
LoRA Weight MergeMerge LoRA adapter weights into base model
GGUF Format ConversionConvert HuggingFace format model to GGUF
Model QuantizationCompress model size, support multiple quantization precisions
LoRA Independent ExportExport LoRA weights independently as GGUF format

Output Artifacts

File TypeNaming FormatDescription
Unquantized GGUF{model_name}.ggufGGUF file with original precision
Quantized GGUF{model_name}-{Q_TYPE}.ggufQuantized GGUF file
LoRA GGUF{checkpoint_name}-lora.ggufGGUF file of LoRA adapter

Packaging Flow

Standard Flow (Using Template)

  1. Select Task

    • Select completed training task from dropdown list.
    • System automatically fills path information.
  2. Select Template

    • Select appropriate preset template according to needs.
    • Confirm configuration summary displayed on the right.
  3. Select Checkpoint (LoRA Task)

    • Select version to quantize from checkpoint list.
    • Refer to evaluation score to select best checkpoint.
  4. Confirm Output Directory

    • Check if output directory is correct.
    • Ensure sufficient disk space.
  5. Start Packaging

    • Click "Start Packaging" button.
    • Wait for packaging to complete.

Custom Flow

  1. Select Task and Checkpoint

  2. Select "Custom" Template

    • All options become editable at this time.
  3. Configure Options

    • Set item by item according to needs.
    • Pay attention to dependencies between options.
  4. Start Packaging


💡 Suggestion: Due to complex dependencies between packaging options, it is strongly recommended to use preset templates.

⚠️ Note: The paths for LoRA weights and base models must not contain Chinese or other special characters to avoid packaging failures.

Template Overview

TemplateDescriptionApplicable Scenario
Merge and Quantize (Default)Merge LoRA + Export GGUF + Quantize Q4_K_MStandard packaging flow after SFT training
Merge without QuantizeMerge LoRA + Export GGUF (No Quantization)Retain full precision, self-quantize later
Quantize Base Model OnlyExport GGUF + Quantize (No LoRA Merge)Pre-trained model or full fine-tuning
Export LoRA OnlyExport LoRA adapter as GGUF onlyScenarios requiring independent use of LoRA
CustomFully autonomous control of all optionsAdvanced users who understand parameter relationships

Template Details

Template 1: Merge Base Model and LoRA Weights, and Quantize (Default)

Option Configuration:

OptionValue
Merge LoRA weights to base model✅ On
Export base model as GGUF✅ On
Quantize model✅ On
Quantization typeQ4_K_M
Export LoRA as GGUF❌ Off

Execution Flow:

Base Model + LoRA Weights → Merge → Convert GGUF → Quantize → Output

Output Files:

  • merged_model.gguf (Unquantized version)
  • merged_model-Q4_K_M.gguf (Quantized version)

Applicable Scenarios:

  • Standard packaging after SFT fine-tuning.
  • Need to deploy to local inference engine.

Template 2: Merge Base Model and LoRA Weights, No Quantization

Option Configuration:

OptionValue
Merge LoRA weights to base model✅ On
Export base model as GGUF✅ On
Quantize model❌ Off
Export LoRA as GGUF❌ Off

Execution Flow:

Base Model + LoRA Weights → Merge → Convert GGUF → Output

Output Files:

  • merged_model.gguf (Full precision)

Applicable Scenarios:

  • Need to retain full precision.
  • Plan to use other tools for quantization.
  • Have sufficient VRAM/RAM to run full model.

Template 3: Quantize Base Model Only

Option Configuration:

OptionValue
Merge LoRA weights to base model❌ Off
Export base model as GGUF✅ On
Quantize model✅ On
Quantization typeQ4_K_M
Export LoRA as GGUF❌ Off

Execution Flow:

Base Model → Convert GGUF → Quantize → Output

Output Files:

  • {model_name}.gguf (Unquantized version)
  • {model_name}-Q4_K_M.gguf (Quantized version)

Applicable Scenarios:

  • Model packaging for Pre-training tasks.
  • Model packaging for full fine-tuning (non-LoRA).
  • Only need to quantize existing HuggingFace model.

Template 4: Export LoRA Only

Option Configuration:

OptionValue
Merge LoRA weights to base model❌ Off
Export base model as GGUF❌ Off
Quantize model❌ Off
Export LoRA as GGUF✅ On

Execution Flow:

LoRA Weights → Convert LoRA GGUF → Output

Exporting LoRA alone needs the training environment already installed. If this step fails, open Settings → System → Environment Configuration and Reinstall the environment that is already installed, then try again.

Output Files:

  • {checkpoint_name}-lora.gguf

Applicable Scenarios:

  • Need to distribute LoRA weights independently.
  • Base model already has GGUF version, only need to supplement LoRA.
  • Test different LoRA combinations.

Basic Configuration Parameters

Training task selection

AttributeValue
TypeDropdown Select
Required✅ Yes

Description: Select the training task to Quantize.

Optional Tasks:

  • Tasks with status "Completed"
  • Tasks with status "Stopped"
  • Tasks with status "Failed" (Available in some scenarios)

Auto-fill after selection:

  • Base model path
  • Output directory
  • LoRA checkpoint list (if LoRA task)

Base model path

AttributeValue
TypeDirectory Path
Required✅ Yes

Description: HuggingFace format base model directory.

Auto-fill: Automatically filled as the task's training model path after selecting task.

Requirements:

  • Directory must contain .safetensors format model weights.
  • Must contain config.json and other configuration files.
  • Suggest containing tokenizer.model (SentencePiece tokenizer file).

⚠️ Note: If tokenizer.model is missing in the directory, the system will try to backtrack from the base model path, but may fail.


LoRA checkpoint selection

AttributeValue
TypeDropdown Select
RequiredLoRA Task Only
ConditionDisplay only when task type is SFT and uses LoRA

Description: Select the LoRA checkpoint to Quantize.

Checkpoint Source: checkpoint-* subdirectories under task output directory.

Selection Suggestion:

  • Refer to Evaluation Module scores to select best checkpoint.
  • Usually select checkpoint at the end of training (larger steps).
  • If early stopping occurred, select the last checkpoint before early stopping.

Output directory

AttributeValue
TypeDirectory Path
Required✅ Yes

Description: Output directory for packaging artifacts.

Auto-fill: Defaults to task output directory.

Suggestion:

  • Use a dedicated directory to store packaging results.
  • Ensure sufficient disk space (files are still large after quantization).

Packaging Options Details

Merge LoRA weights to base model

AttributeValue
TypeSwitch
DefaultOn
Custom Mode✅ Modifiable
Template Mode❌ Locked

Description: Merge LoRA adapter weights into base model.

When On:

  • Generate complete model weights.
  • No need to load LoRA separately during inference.
  • File size equals complete model.

When Off:

  • LoRA weights remain independent.
  • Need to be used with base model.
  • Support dynamic switching of different LoRA.

Export base model as GGUF

AttributeValue
TypeSwitch
DefaultOn
Custom Mode✅ Modifiable
Template Mode❌ Locked

Description: Convert HuggingFace format model to GGUF format.

GGUF Format Advantages:

  • Native support by llama.cpp.
  • Single file contains all weights and configurations.
  • Support incremental loading, reducing memory requirements.

Conversion Process:

  1. Read HuggingFace model weights.
  2. Convert tensor format.
  3. Package tokenizer configuration.
  4. Write GGUF single file.

Quantize model

AttributeValue
TypeSwitch
DefaultOn
Custom Mode✅ Modifiable
Template Mode❌ Locked
DependencyNeed to enable "Export GGUF" first

Description: Perform quantization compression on GGUF model.

Quantization Effect:

  • Significantly reduce model size.
  • Reduce memory requirements during inference.
  • Moderate loss of precision (usually acceptable).

Quantization types

AttributeValue
TypeMulti-select Dropdown
DefaultQ4_K_M
ConditionDisplay only when "Quantize model" is enabled

Description: Select one or more quantization precisions.

Quantization Types Details

K-Quant Series (Recommended):

TypeSizePrecision LossRecommended Scenario
Q4_K_M ⭐~4.6GLowDefault Recommended, balance size and quality
Q5_K_M ⭐~5.3GVery LowPursue higher quality
Q4_K_S~4.4GLowSize priority
Q5_K_S~5.2GVery LowQuality priority
Q3_K_M~3.7GMediumExtreme compression
Q3_K_L~4.0GMedium LowCompromise between compression and quality
Q3_K_S~3.4GMediumSmallest 3-bit

Standard Quantization Series:

TypeSizeDescription
Q8_0~8.0G8-bit quantization, quality close to original
Q5_0~5.2G5-bit standard quantization
Q5_1~5.7G5-bit enhanced quantization
Q4_0~4.3G4-bit standard quantization
Q4_1~4.8G4-bit enhanced quantization
Q2_K~3.0G2-bit extreme compression

IQ Series (Intelligent Quantization):

TypebpwDescription
IQ4_XS4.25Intelligent 4-bit
IQ4_NL4.50Non-linear 4-bit
IQ3_M3.66Intelligent 3-bit Medium
IQ3_S3.44Intelligent 3-bit Small
IQ2_M2.70Intelligent 2-bit Medium
IQ2_S2.50Intelligent 2-bit Small
IQ1_M1.75Intelligent 1-bit Medium
IQ1_S1.56Intelligent 1-bit Small

Full Precision Formats:

TypeSizeDescription
F32~26G32-bit Float (Original Precision)
F16~14G16-bit Float
BF16~14GBFloat16 Format

Selection Suggestion:

ScenarioRecommended Type
General DeploymentQ4_K_M (Default)
Pursue QualityQ5_K_M or Q8_0
Memory LimitedQ3_K_M or IQ3_M
Extreme CompressionQ2_K or IQ2_S
Multi-version DistributionSelect multiple types to generate simultaneously

Export LoRA as GGUF

AttributeValue
TypeSwitch
DefaultOff
Custom Mode✅ Modifiable
Template Mode❌ Locked

Description: Export LoRA adapter independently as GGUF format.

Usage Scenarios:

  • Base model already has GGUF version.
  • Need to distribute lightweight LoRA files.
  • Test effects of different LoRA.

Output Files:

  • {checkpoint_name}-lora.gguf (Very small size, usually MB level)

Option Dependencies

Mutual Exclusion

Option AOption BRelationship Description
Merge LoRAExport LoRA OnlyChoose one, no independent LoRA after merge

Dependency Relationship

PrerequisiteDependent OptionDescription
Export GGUF = OnQuantize ModelQuantization requires GGUF file first
Quantize Model = OnQuantization Type SelectionType selection displays only after quantization enabled
LoRA TaskLoRA Checkpoint SelectionNot displayed for non-LoRA tasks

Flow Dependency

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Merge LoRA │ ──▶ │ Export GGUF │ ──▶ │  Quantize   │
└─────────────┘     └─────────────┘     └─────────────┘
      │                                        │
      │                                        ▼
      │                               ┌─────────────────┐
      │                               │ Quant Type(Multi)│
      │                               └─────────────────┘
      ▼
┌─────────────────┐
│ Export LoRA GGUF│ (Mutually exclusive with Merge)
└─────────────────┘

Packaging Log

Real-time logs are displayed during packaging:

Log TypeDescription
Merge LoRALoRA weight merge process
GGUF conversionFormat conversion process
QuantizationQuantization process
Command successStep completed

FAQ

Packaging Failed: tokenizer.model not found

Reason: Tokenizer file is missing in directory after LoRA merge.

Solution:

  1. Ensure base model directory contains tokenizer.model.
  2. Manually copy tokenizer.model to merged directory.
  3. Re-execute packaging.

Quantization Failed

Possible Reasons:

  • GGUF file not generated correctly.
  • Insufficient disk space.
  • Quantization tool missing.

Solution:

  1. Check if previous GGUF conversion was successful.
  2. Ensure sufficient disk space (at least 2 times model size).
  3. Check if llama-quantize tool exists.

Output File Too Large

Solution:

  • Select more aggressive quantization type (e.g., Q3_K_M, Q2_K).
  • Delete unwanted intermediate files (unquantized .gguf).

LoRA Checkpoint List Empty

Possible Reasons:

  • Task output directory does not exist.
  • Training did not produce checkpoints.
  • Non-LoRA task.

Solution:

  1. Confirm task actually used LoRA training.
  2. Check if checkpoint-* directories exist under task output directory.
  3. Ensure checkpoint saving was set during training.

Usage Suggestions

Quick Start

For most users:

  1. Select training task.
  2. Use default template (Merge and Quantize).
  3. Select checkpoint.
  4. Start packaging.

Advanced Usage

  • Multi-Quantization Versions: Select multiple quantization types to generate multiple versions at once.
  • Retain Original Precision: Use "Merge without Quantize" template, quantize with other tools later.
  • Independent LoRA: Use "Export LoRA Only" template, use with existing base model.

Deployment Suggestions

Deployment PlatformRecommended Quantization Type
High-end GPU (24G+)Q8_0 or F16
Mid-range GPU (12G)Q5_K_M
Low-end GPU (8G)Q4_K_M
CPU InferenceQ4_K_M or Q3_K_M
MobileIQ3_M or IQ2_S

Next Steps