docs: update HOWTO‑add‑model.md for ModelBase and new model classes#14874
Merged
CISC merged 1 commit intoggml-org:masterfrom Jul 25, 2025
Merged
docs: update HOWTO‑add‑model.md for ModelBase and new model classes#14874CISC merged 1 commit intoggml-org:masterfrom
CISC merged 1 commit intoggml-org:masterfrom
Conversation
CISC
requested changes
Jul 25, 2025
Collaborator
CISC
left a comment
There was a problem hiding this comment.
Thanks for noticing and taking the time to clean this up! :)
aecbeb6 to
8a35e33
Compare
CISC
reviewed
Jul 25, 2025
This patch updates the example in docs/development/HOWTO-add-model.md to reflect recent changes after `TextModel` and `MmprojModel` were introduced. It replaces the outdated `Model` base class with `TextModel` or `MmprojModel` and updates the registration example accordingly. Signed-off-by: Wook Song <wook16.song@samsung.com>
8a35e33 to
0ab7123
Compare
CISC
approved these changes
Jul 25, 2025
gabe-l-hart
added a commit
to gabe-l-hart/llama.cpp
that referenced
this pull request
Jul 25, 2025
* origin/master: docs : update HOWTO‑add‑model.md for ModelBase and new model classes (ggml-org#14874) ggml : remove invalid portPos specifiers from dot files (ggml-org#14838) context : restore preemptive sched reset when LLAMA_SET_ROWS=0 (ggml-org#14870) mtmd : fix 32-bit narrowing issue in export-lora and mtmd clip (ggml-org#14503) rpc : check for null buffers in get/set/copy tensor endpoints (ggml-org#14868) sched : fix multiple evaluations of the same graph with pipeline parallelism (ggml-org#14855) musa: upgrade musa sdk to rc4.2.0 (ggml-org#14498) sync : ggml cmake : fix usage issues (ggml/1257) ggml-cpu : remove stdlib include from repack.cpp (ggml/1276) context : perform output reorder lazily upon access after sync (ggml-org#14853) chat : fix kimi-k2 chat template (ggml-org#14852) sycl: fixed semantics of block offset calculation (ggml-org#14814) llama : fix MiniCPM inference after Granite Four changes (ggml-org#14850) docs: add libcurl-dev install hint for Linux distros (ggml-org#14801) metal : fix fusion across different encoders (ggml-org#14849) sycl: fix undefined variable in work group size check (ggml-org#14843) convert : text-only support for GLM-4.1V-9B-Thinking (ggml-org#14823) CUDA: fix overflow in FA, tune performance (ggml-org#14840) CUDA: fix compilation with GGML_CUDA_F16 (ggml-org#14837)
blime4
referenced
this pull request
in blime4/llama.cpp
Feb 5, 2026
…(#14874) This patch updates the example in docs/development/HOWTO-add-model.md to reflect recent changes after `TextModel` and `MmprojModel` were introduced. It replaces the outdated `Model` base class with `TextModel` or `MmprojModel` and updates the registration example accordingly. Signed-off-by: Wook Song <wook16.song@samsung.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello llama.cpp team,
While working through the
docs/development/HOWTO‑add‑model.mdguide to add a new model, I noticed that the example still uses@Model.register("MyModelForCausalLM")andclass MyModel(Model).In #13023, the model base class was renamed from
ModeltoModelBase, and more recently,TextModelandMmprojModelwere introduced. Following the current documentation now leads to anAttributeError.This PR updates the example to use
@ModelBase.register("MyModelForCausalLM")andclass MyModel(ModelBase), bringing the documentation back in line with the current code.Because
TextModelandMmprojModelwere added, some of the methods that need to be overridden in a new model class have also changed — this PR does not address those changes.If you guys don't mind. I plan to submit a follow‑up PR that updates the override instructions accordingly.
It’s a small fix that should prevent confusion for new contributors, and I intend to continue improving the HOWTO in subsequent PRs. Thank you for your time and consideration.