| 1 |
"""GGUF export pipeline — convert trained adapters to Ollama-consumable files. |
| 2 |
|
| 3 |
Heavy imports (`torch`, `peft`, |
| 4 |
`transformers`) stay deferred; subprocess calls to the vendored |
| 5 |
`llama.cpp` tools go through `dlm.export.quantize.run_checked`. |
| 6 |
""" |
| 7 |
|
| 8 |
from __future__ import annotations |
| 9 |
|
| 10 |
from dlm.export.errors import ( |
| 11 |
ExportError, |
| 12 |
ExportManifestError, |
| 13 |
PreflightError, |
| 14 |
SubprocessError, |
| 15 |
UnknownExportTargetError, |
| 16 |
UnsafeMergeError, |
| 17 |
VendoringError, |
| 18 |
) |
| 19 |
from dlm.export.manifest import ( |
| 20 |
EXPORT_MANIFEST_FILENAME, |
| 21 |
ExportArtifact, |
| 22 |
ExportManifest, |
| 23 |
load_export_manifest, |
| 24 |
save_export_manifest, |
| 25 |
) |
| 26 |
from dlm.export.plan import ( |
| 27 |
DEFAULT_QUANT, |
| 28 |
QUANT_BYTES_PER_PARAM, |
| 29 |
ExportPlan, |
| 30 |
QuantLevel, |
| 31 |
resolve_export_plan, |
| 32 |
valid_quants, |
| 33 |
) |
| 34 |
from dlm.export.runner import ExportResult, run_export |
| 35 |
|
| 36 |
__all__ = [ |
| 37 |
"DEFAULT_QUANT", |
| 38 |
"EXPORT_MANIFEST_FILENAME", |
| 39 |
"ExportArtifact", |
| 40 |
"ExportError", |
| 41 |
"ExportManifest", |
| 42 |
"ExportManifestError", |
| 43 |
"ExportPlan", |
| 44 |
"ExportResult", |
| 45 |
"PreflightError", |
| 46 |
"QUANT_BYTES_PER_PARAM", |
| 47 |
"QuantLevel", |
| 48 |
"SubprocessError", |
| 49 |
"UnknownExportTargetError", |
| 50 |
"UnsafeMergeError", |
| 51 |
"VendoringError", |
| 52 |
"load_export_manifest", |
| 53 |
"resolve_export_plan", |
| 54 |
"run_export", |
| 55 |
"save_export_manifest", |
| 56 |
"valid_quants", |
| 57 |
] |