Principle:Ggml org Llama cpp Legacy Model Conversion
| Knowledge Sources | |
|---|---|
| Domains | Model_Conversion |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Legacy Model Conversion is the principle of transforming models from older or alternative formats into the current GGUF format supported by llama.cpp.
Description
This principle covers conversion scripts and tools for migrating models from legacy formats to GGUF. This includes updating the HF-to-GGUF converter's model registry, converting older GGML-format models to GGUF, converting llama2.c checkpoint formats, handling legacy LLaMA model structures, and converting PyTorch checkpoints to HuggingFace format as an intermediate step. These tools ensure backward compatibility and provide migration paths as the GGUF format evolves.
Usage
Apply this principle when working with models in older formats that need to be converted to the current GGUF format, when adding support for new model architectures to the conversion pipeline, or when the GGUF format specification changes and existing converters need updates.
Theoretical Basis
Model format conversion requires understanding the tensor layout, naming conventions, data types, and metadata structures of both the source and target formats. Each conversion tool maps tensors from the source format's naming scheme to GGUF's standardized tensor naming, handles data type conversions (e.g., float32 to float16), and populates GGUF metadata fields from the source model's configuration files. The conversion process must preserve numerical accuracy while potentially reorganizing tensor storage order and applying format-specific transformations such as permuting attention weight matrices.
Related Pages
- Implementation:Ggml_org_Llama_cpp_Convert_HF_To_GGUF_Update
- Implementation:Ggml_org_Llama_cpp_Convert_Llama_GGML_To_GGUF
- Implementation:Ggml_org_Llama_cpp_Convert_Llama2c_To_GGML
- Implementation:Ggml_org_Llama_cpp_Convert_Legacy_Llama
- Implementation:Ggml_org_Llama_cpp_Convert_PT_To_HF
- Heuristic:Ggml_org_Llama_cpp_Warning_Deprecated_Legacy_Converters