llama.cpp
implement new jinja template engine
#18462
Merged

implement new jinja template engine #18462

ngxson merged 137 commits into ggml-org:master from ngxson:xsn/jinja_vm
ngxson
ngxson jinja vm
8d803014
ngxson lexer
15b7c50e
ngxson add vm types
a35fcb00
ngxson demo
a6e0ae7a
ngxson clean up
7ac8e98b
ngxson parser ok
8cea1ed6
ngxson binary_expression::execute
7ad6eb39
ngxson shadow naming
8d1e9a0d
ngxson bin ops works!
d8ef00e6
ngxson fix map object
5a041e65
ngxson add string builtins
15b3dbab
ngxson add more builtins
7ed11f78
ngxson wip
da7bbe58
ngxson use mk_val
c08f4ddf
ngxson eval with is_user_input
10835f27
ngxson render gemma tmpl ok
81310d29
ngxson track input string even after transformations
4ca114b0
ngxson support binded functions
45c19462
ngxson keyword arguments and slicing array
4331e9c8
ngxson use shared_ptr for values
7f17608e
ngxson add mk_stmt
64e29a58
ngxson allow print source on exception
acb0effa
ngxson fix negate test
db09a746
ngxson testing more templates
45df0c91
ngxson mostly works
9a8a45ff
ngxson add filter_statement
adad34f6
ngxson allow func to access ctx
c7f246e7
ngxson add jinja-value.cpp
55fe96a9
ngxson impl global_from_json
1784a57e
ngxson a lot of fixes
2a31c9a3
ngxson more tests
1cf25734
ngxson more fix, more tests
026730e8
ngxson more fixes
9e9a70f7
github-actions github-actions added testing
aldehir
ngxson
ngxson rm workarounds
9c0fa6f8
ngxson demo: type inferrence
4479c382
ngxson add placeholder for tojson
1b213ae5
ngxson improve function args handling
cbb37dd4
ngxson rm type inference
d34efd96
ngxson no more std::regex
a10fbc77
ngxson trailing spaces
61c25c3f
ngxson make testing more flexible
b23b5e3c
ngxson make output a bit cleaner
a66e4a4f
ngxson (wip) redirect minja calls
4b71c285
ngxson test: add --output
0f9f986a
ngxson fix crash on macro kwargs
dce256cf
ngxson add minimal caps system
e858b7a0
ngxson add some workarounds
9b79863d
ngxson rm caps_apply_workarounds
5d548387
ngxson get rid of preprocessing
04a96a71
ngxson more fixes
9b24eadf
ngxson fix test-chat-template
1de836b5
ngxson move test-chat-jinja into test-chat-template
50aa8ed2
ngxson rm test-chat-jinja from cmake
217afcd3
ngxson test-chat-template: use common
8fb879b7
ngxson fix build
cf521dc9
ngxson fix build (2)
16e5d524
ngxson rename vm --> interpreter
e392fef4
ngxson improve error reporting
25a884ec
ngxson correct lstrip behavior
85b0efe5
ngxson add tojson
99aa61ca
ngxson more fixes
8c01e0ec
ngxson disable tests for COMMON_CHAT_FORMAT_GENERIC
60a3a6a2
ngxson make sure tojson output correct order
13ddab2a
ngxson add object.length
4af1850b
ngxson fully functional selectattr / rejectattr
264dcea2
ngxson improve error reporting
2ca9d799
ngxson more builtins added, more fixes
7fbdf63d
aldehir create jinja rendering tests
90062624
aldehir fix testing.h path
c0add06c
aldehir adjust whitespace rules
644d2815
ngxson Merge pull request #72 from aldehir/jinja-vm-whitespace
14a87064
ngxson more fixes
77864903
ngxson temporary disable test for ibm-granite
a3b49003
ngxson r/lstrip behavior matched with hf.js
b0f73ef3
ngxson minimax, glm4.5 ok
b86364f4
ngxson add append and pop
d3c4f398
ngxson kimi-k2 ok
61bfd471
ngxson test-chat passed
88a923dd
aldehir fix lstrip_block
e44e813b
aldehir add more jinja tests
e8aef239
aldehir cast to unsigned char
6fac106b
ngxson allow dict key to be numeric
6106249e
ngxson Merge pull request #73 from aldehir/jinja-vm-whitespace-2
dba22e57
ngxson nemotron: rm windows newline
c26b408f
ngxson tests ok
7ad016e0
ngxson fix test
8be34f8b
ngxson rename interpreter --> runtime
0ef77951
ngxson fix build
e2927d01
ngxson add more checks
7b9434d9
ngxson bring back generic format support
9e6a61ad
ngxson fix Apertus
4052dec7
ngxson [json.exception.out_of_range.403] key 'content' not found
65890e77
ngxson rm generic test
acf62fbc
ngxson refactor input marking
c6fa4144
ngxson add docs
63c88579
ngxson fix windows build
e739f755
ngxson Merge branch 'master' into xsn/jinja_vm
238759b5
github-actions github-actions added examples
github-actions github-actions added server
ngxson ngxson force pushed from 36480293 to 238759b5 27 days ago
ngxson ngxson removed server
ngxson ngxson marked this pull request as ready for review 27 days ago
ngxson ngxson requested a review from ggerganov ggerganov 27 days ago
ngxson ngxson requested a review from pwilkin pwilkin 27 days ago
ngxson ngxson requested a review from aldehir aldehir 27 days ago
ngxson
ngxson clarify error message
44574371
CISC
CISC commented on 2026-01-10
CISC
CISC improved tests
42936c22
CISC split/rsplit with maxsplit
16d2d868
CISC non-inverse maxsplit
79ff4816
CISC
CISC commented on 2026-01-10
aldehir
aldehir commented on 2026-01-10
CISC
CISC commented on 2026-01-10
CISC implement separators for tojson and fix indent
bded39a1
CISC
ngxson Merge branch 'master' into xsn/jinja_vm
13fa1e61
ngxson i like to move it move it
82b889f0
ngxson rename null -- > none
12dd46ac
CISC
CISC commented on 2026-01-10
CISC
CISC commented on 2026-01-10
ngxson token::eof
0597a339
aldehir
ngxson some nits + comments
605ebe26
ngxson add exception classes for lexer and parser
967a2b6a
ngxson null -> none
d368f633
ngxson rename global -> env
2b624822
ngxson rm minja
e0e1d107
github-actions github-actions added documentation
github-actions github-actions added script
github-actions github-actions added python
ngxson
CISC
CISC commented on 2026-01-10
CISC
CISC commented on 2026-01-10
CISC
CISC commented on 2026-01-10
CISC
ngxson update docs
42979a93
ngxson
ngxson docs: add input marking caveats
7d8e9edc
pwilkin
CISC
CISC commented on 2026-01-11
CISC imlement missing jinja-tests functions
d440e035
ngxson
ngxson commented on 2026-01-11
ngxson
ngxson commented on 2026-01-11
CISC oops
08409b76
ngxson
ngxson
ngxson commented on 2026-01-11
CISC support trim filter with args, remove bogus to_json reference
81f632e5
CISC numerous argument fixes
a6043b3b
CISC updated tests
c68d16e3
CISC
CISC implement optional strip chars parameter
fffc6699
CISC use new chars parameter
40dac623
CISC float filter also has default
ac3abfe3
CISC always leave at least one decimal in float string
57833586
CISC
ggerganov jinja : static analysis + header cleanup + minor fixes
50568649
ggerganov
ggerganov
ggerganov approved these changes on 2026-01-15
ggerganov
ngxson
pwilkin
ngxson add fuzz test
f475f5bc
ngxson add string.cpp
abcd7766
ngxson fix chat_template_kwargs
a959ff8b
ngxson Merge branch 'master' into xsn/jinja_vm
78a0112d
ngxson nits
10a987ae
aldehir
aldehir approved these changes on 2026-01-15
github-actions github-actions added server
CISC fix build
70d9d9c5
CISC revert
acaf0170
CISC unrevert
8e1e6ae7
pwilkin
pwilkin approved these changes on 2026-01-15
ngxson add fuzz func_args, refactor to be safer
350d87da
ngxson
CISC
CISC commented on 2026-01-15
ngxson fix array.map()
25dac2e0
CISC
CISC commented on 2026-01-15
CISC
CISC approved these changes on 2026-01-15
ngxson loosen ensure_vals max count condition, add not impl for map(int)
e07af2bd
ngxson
CISC
pwilkin
ngxson
CISC
CISC hopefully fix windows
c9a94e77
CISC check if empty first
8a88770f
CISC
aldehir
CISC
CISC
CISC
CISC normalize newlines
ca8d4ca5
ngxson
ngxson ngxson merged c15395f7 into master 16 days ago
CISC CISC added jinja parser
kpouget

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone