Commit ef16dec
committed
Expose chat template, special tokens, and full metadata via ModelMeta
Enrich the existing getModelMetaJson native method and the ModelMeta wrapper
with three read-only introspection fields, so callers can inspect a loaded
model without a second round-trip:
- chat_template - the model's resolved Jinja template (getChatTemplate)
- special_tokens - bos/eos/eot (plus sep/nl/pad in the JSON) via
getBosTokenId/getEosTokenId/getEotTokenId
- metadata - the full GGUF key/value map via getMetadata(key), capped at
2 KB per value so large array metadata (tokenizer tokens/merges) cannot bloat
the JSON
No new native method or JNI signature change: the fields ride the existing
getModelMetaJson payload, and absent fields default cleanly on the Java side.
Verified: libjllama builds and links against b9842, loads cleanly
(NativeLibraryLoadSmokeTest), and the ModelMeta unit tests pass (11 total).1 parent b5ee309 commit ef16dec
3 files changed
Lines changed: 105 additions & 0 deletions
File tree
- src
- main
- cpp
- java/net/ladenthin/llama/value
- test/java/net/ladenthin/llama/value
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
767 | 767 | | |
768 | 768 | | |
769 | 769 | | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
770 | 779 | | |
771 | 780 | | |
772 | 781 | | |
773 | 782 | | |
774 | 783 | | |
775 | 784 | | |
| 785 | + | |
776 | 786 | | |
777 | 787 | | |
778 | 788 | | |
| |||
794 | 804 | | |
795 | 805 | | |
796 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
797 | 827 | | |
798 | 828 | | |
799 | 829 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
132 | 181 | | |
133 | 182 | | |
134 | 183 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
136 | 162 | | |
0 commit comments