Qwodel
API Reference

The main entry point for all quantization operations.

from qwodel import Quantizer

Constructor

Quantizer(
    backend,
    model_path,
    output_dir="./quantized_models",
    progress_callback=None,
    **backend_kwargs
)
ParameterTypeRequiredDescription
backendstrYesBackend to use: "awq", "gguf", or "coreml".
model_pathstrYesPath to the source model. Can be a local directory, .gguf file, or HuggingFace model ID.
output_dirstrNoDirectory to save the output. Defaults to ./quantized_models.
progress_callbackCallableNoOptional callback (percent: int, stage: str, message: str) for progress updates.
**backend_kwargsAnyNoBackend-specific arguments — see each backend page.

Methods

quantize(format, **kwargs) → Path

Runs the quantization process.

ParameterTypeRequiredDescription
formatstrYesQuantization format string (e.g., "int4", "Q4_K_M", "float16").
**kwargsAnyNoRuntime overrides for backend-specific parameters.

Returns: Path to the quantized model file or directory.


get_model_info() → Dict

Returns metadata about the quantized model.

KeyTypeDescription
source_modelstrPath to the input model.
quantized_modelstrPath to the output model.
backendstrBackend used.
file_sizeintOutput file size in bytes.
input_formatstrDetected format of the source model.

list_formats(backend=None) → Dict (static)

Lists available quantization formats.

ParameterTypeDescription
backendstr | NoneSpecific backend name, or None to list all.

list_backends() → List[str] (static)

Returns a list of all registered backend names.


Convenience function

from qwodel import quantize

quantize(
    model_path="./my-model",
    output_dir="./output",
    backend="gguf",
    format="Q4_K_M"
)
ParameterTypeRequiredDescription
model_pathstrYesPath to source model.
output_dirstrYesOutput directory.
backendstrYesBackend name.
formatstrYesQuantization format.
progress_callbackCallableNoOptional progress callback.
**kwargsAnyNoAdditional backend/format arguments.

Logging

qwodel uses Python's standard logging module:

import logging
logging.basicConfig(level=logging.INFO)

Logger names: AWQQuantizer, GGUFQuantizer, CoreMLQuantizer.