From 584b4f93c67cf9b3fa0a8d1127ba606782a5b9db Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Mon, 17 Aug 2026 02:36:33 +0200 Subject: [PATCH] add docs --- docs/development/HOWTO-add-model.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/development/HOWTO-add-model.md b/docs/development/HOWTO-add-model.md index 270e6b7356..fcc87f1651 100644 --- a/docs/development/HOWTO-add-model.md +++ b/docs/development/HOWTO-add-model.md @@ -29,6 +29,7 @@ The required steps to implement for an HF model are: ```python @ModelBase.register("MyModelForCausalLM") +@ModelBase.example("user/model") class MyModel(TextModel): model_arch = gguf.MODEL_ARCH.MYMODEL ``` @@ -37,10 +38,13 @@ or ```python @ModelBase.register("MyModelForConditionalGeneration") +@ModelBase.example("user/model") class MyModel(MmprojModel): model_arch = gguf.MODEL_ARCH.MYMODEL ``` +The `example` should point to a valid Hugging Face model that will be used for testing. You can add multiple models if necessary. Prefer a non-gated model, or tiny random weights if no such model exists. + 2. Define the layout of the GGUF tensors in [constants.py](/gguf-py/gguf/constants.py) Add an enum entry in `MODEL_ARCH`, the model human friendly name in `MODEL_ARCH_NAMES` and the GGUF tensor names in `MODEL_TENSORS`.