feat: add llama model_type support#2
Open
Krigsexe wants to merge 1 commit into
Open
Conversation
Map "llama" model_type to Qwen3 family since the architecture is identical (RMSNorm, RoPE, SwiGLU, GQA, no bias). The only difference is that Llama models do not use per-head QK norms, which is handled by checking the model_type string. This enables running Llama-architecture models like PleIAs/Baguettotron (321M params, 80 layers) directly on herbert-rs without conversion. Tested with Baguettotron-Q4 on Ryzen 5 3600 (AVX2): 38.8 tok/s decode, 188.9 tok/s prefill.
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.
Summary
"llama"to the supportedmodel_typevalues inconfig.rsQwen3family since the architecture is identical (RMSNorm, RoPE, SwiGLU, GQA, no bias, same SafeTensors layer naming)Motivation
Llama-architecture models like PleIAs/Baguettotron (321M params, 80 layers, Apache 2.0) cannot currently run on herbert-rs because the
model_type: "llama"is not recognized. The underlying architecture is functionally identical to Qwen3 -- same layer structure, same SafeTensors naming convention (model.layers.X.self_attn.q_proj.weight), same activation function.Changes
crates/core/src/config.rs: 3 changes, 1 file, +7/-3 linesTesting
Tested with PleIAs/Baguettotron (Q4 backend) on Ryzen 5 3600 (AVX2):