Skip to content

feat: add --jinja flag for tool/function calling support#162

Merged
Defilan merged 1 commit intomainfrom
feat/jinja-tool-calling
Feb 21, 2026
Merged

feat: add --jinja flag for tool/function calling support#162
Defilan merged 1 commit intomainfrom
feat/jinja-tool-calling

Conversation

@Defilan
Copy link
Member

@Defilan Defilan commented Feb 21, 2026

Summary

  • Adds jinja (*bool) field to InferenceServiceSpec CRD, enabling Jinja2 chat template rendering via llama.cpp's --jinja flag
  • Required for tool/function calling with the OpenAI-compatible API (without it, tool calls fail with 500 tools param requires --jinja flag)
  • Adds support across K8s controller, Metal Agent, and CLI (llmkube deploy --jinja)

Changes

  • CRD: Jinja *bool field on InferenceServiceSpec with auto-generated deepcopy and CRD manifest
  • Controller: appendJinjaArgs() helper, called in constructDeployment()
  • Metal Agent: Jinja field in ExecutorConfig, read from CRD in ensureProcess()
  • CLI: --jinja flag on deploy command with display output and builder
  • Tests: 3 test cases (enabled, nil, false) following the flashAttention pattern
  • Sample: Updated sample manifest with jinja: true

Test plan

  • make generate passes
  • make manifests passes
  • make test passes (all existing + 3 new jinja tests)
  • make build compiles successfully
  • Manual: llmkube deploy <model> --jinja shows "Jinja: enabled"
  • Manual: InferenceService with jinja: true produces --jinja in container args

Closes #126

@Defilan Defilan force-pushed the feat/jinja-tool-calling branch from 1a23e02 to e0e3a4c Compare February 21, 2026 01:35
Add Jinja2 template rendering support to enable tool/function calling
with llama.cpp's OpenAI-compatible API. Without --jinja, tool calls
fail with 500 errors. This is required for models like Qwen3-32B and
Mistral Small 3.2 when using tools.

Changes:
- Add Jinja *bool field to InferenceServiceSpec CRD
- Add appendJinjaArgs helper in controller
- Add Jinja support to Metal Agent executor and config
- Add --jinja CLI flag to deploy command
- Add sample manifest entry and controller tests

Closes #126

Signed-off-by: Christopher Maher <chris@mahercode.io>
@Defilan Defilan force-pushed the feat/jinja-tool-calling branch from e0e3a4c to b8b6852 Compare February 21, 2026 01:37
@Defilan Defilan merged commit 47624ca into main Feb 21, 2026
15 checks passed
@Defilan Defilan deleted the feat/jinja-tool-calling branch February 21, 2026 01:44
@github-actions github-actions bot mentioned this pull request Feb 21, 2026
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --jinja flag for tool/function calling support

1 participant