LocalAI/pkg/functions
Ettore Di Giacinto 34e054f607
fix(reasoning): support models with reasoning without starting thinking tag (#8132)
* chore: extract reasoning to its own package

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* make sure we detect thinking tokens from template

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* Allow to override via config, add tests

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2026-01-20 21:07:59 +01:00
..
grammars fix: handle multi-type arrays in JSON schema to prevent panic (#6495) 2025-10-17 11:07:37 +02:00
function_structure.go feat(grammar): add llama3.1 schema (#3015) 2024-07-26 20:11:29 +02:00
functions.go chore(refactor): move logging to common package based on slog (#7668) 2025-12-21 19:33:13 +01:00
functions_suite_test.go feat(grammar): add llama3.1 schema (#3015) 2024-07-26 20:11:29 +02:00
functions_test.go feat(functions): parse broken JSON when we parse the raw results, use dynamic rules for grammar keys (#2912) 2024-07-18 17:52:22 +02:00
iterative_parser.go feat(function): Add tool streaming, XML Tool Call Parsing Support (#7865) 2026-01-05 18:25:40 +01:00
json_mode.go refactor: break down json grammar parser in different files (#3004) 2024-07-25 08:41:00 +02:00
json_stack_parser.go feat(function): Add tool streaming, XML Tool Call Parsing Support (#7865) 2026-01-05 18:25:40 +01:00
parse.go fix(functions): do not duplicate function when valid JSON is inside XML tags (#8043) 2026-01-14 23:42:00 +01:00
parse_test.go fix(functions): do not duplicate function when valid JSON is inside XML tags (#8043) 2026-01-14 23:42:00 +01:00