UnslothExportMerged
Python template · sinapsis_unsloth.templates.export.unsloth_export_merged
Overview
Template for exporting merged models with Unsloth.
Provides functionality to export Unsloth-optimized models either locally or to the Hugging Face Hub.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-unsloth==1.0.0uv pip install sinapsis-unsloth==1.0.0uv add sinapsis-unsloth==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Required
Default: null
Data type for model weights. Defaults to "auto".
Optional
Default: "auto"
Directory where models are cached. Defaults to SINAPSIS_CACHE_DIR.
Optional
Default: "/home/ariel/.cache/sinapsis"
Device mapping strategy for model parallelism. Defaults to "sequential".
Optional
Default: "sequential"
The name of the model to be used.
Required
Default: null
Whether to use 4-bit quantization. Defaults to True.
Optional
Default: true
Whether to use 8-bit quantization. Defaults to False.
Optional
Default: false
Random state for reproducibility. Defaults to 3407.
Optional
Default: 3407
Whether to use 16-bit quantization. Defaults to False.
Optional
Default: false
Maximum rank for LoRA layers. Defaults to 64.
Optional
Default: 64
Whether to enable fast inference mode. Defaults to False.
Optional
Default: false
Maximum sequence length for input data. Defaults to 2048.
Optional
Default: 2048
Whether to perform full fine-tuning. Defaults to False.
Optional
Default: false
Maximum GPU memory utilization as a fraction of total available memory. Defaults to 0.5.
Optional
Default: 0.5
Gradient checkpointing strategy. Defaults to "unsloth".
Optional
Default: "unsloth"
Configuration arguments for exporting the merged model.
Required
Default: null
Required
Default: null
The method to use for saving the export. Defaults to 'merged_16bit'.
Optional
Default: "merged_16bit"
Optional
Default: "5GB"
Optional
Default: 0.75
Optional
Default: false
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: UnslothExportMerged
class_name: UnslothExportMerged
template_input: InputTemplate
attributes:
model_args:
model_name: unsloth/DeepSeek-R1-Distill-Qwen-1.5B
max_seq_length: 2048
dtype: auto
load_in_4bit: true
load_in_8bit: false
load_in_16bit: false
full_finetuning: false
device_map: sequential
use_gradient_checkpointing: unsloth
fast_inference: false
gpu_memory_utilization: 0.5
random_state: 3407
max_lora_rank: 64
export_args:
save_path: artifacts/DeepSeek-R1-Distill-Qwen-1.5B-16-bit
max_shard_size: 5GB
maximum_memory_usage: 0.75
save_method: merged_16bit
push_to_hub: falseShow schema-based configuration skeleton
templates:
- template_name: "UnslothExportMerged"
class_name: "UnslothExportMerged"
attributes:
model_args:
dtype: "auto"
cache_dir: "/home/ariel/.cache/sinapsis"
device_map: "sequential"
model_name: "<required>"
load_in_4bit: true
load_in_8bit: false
random_state: 3407
load_in_16bit: false
max_lora_rank: 64
fast_inference: false
max_seq_length: 2048
full_finetuning: false
gpu_memory_utilization: 0.5
use_gradient_checkpointing: "unsloth"
export_args:
save_path: "<required>"
save_method: "merged_16bit"
max_shard_size: "5GB"
maximum_memory_usage: 0.75
push_to_hub: false
Inheritance
sinapsis_unsloth.templates.export.unsloth_export_base.UnslothExportBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.