ik_llama_opt/common
Marcel Coetzee 4d09e04501
common : add env vars for cache_type_k/v, mlock, k_cache_hadamard and enable env vars for all tools (#1402)
Two changes:

1. Add four missing environment variable bindings to
   gpt_params_parse_from_env():

   - LLAMA_ARG_CACHE_TYPE_K  (string, e.g. "q8_0")
   - LLAMA_ARG_CACHE_TYPE_V  (string, e.g. "q8_0")
   - LLAMA_ARG_MLOCK         (bool, "1"/"true")
   - LLAMA_ARG_K_CACHE_HADAMARD (bool, "1"/"true")

2. Call gpt_params_parse_from_env() from gpt_params_parse() so that
   ALL tools (llama-cli, llama-bench, etc.) respect env vars, not
   just llama-server. Env vars act as defaults; CLI flags override.

Follows the existing get_env() pattern and uses the same
LLAMA_ARG_ prefix convention as the other env vars.

Co-authored-by: Pipboyguy <>
2026-03-11 15:35:26 +01:00
..
cmake Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
jinja common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
CMakeLists.txt common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
base64.hpp llava : expose as a shared library for downstream projects (#3613) 2023-11-07 00:36:23 +03:00
build-info.cpp.in build : link against build info instead of compiling against it (#3879) 2023-11-02 08:50:16 +02:00
chat-parser-xml-toolcall.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
chat-parser-xml-toolcall.h Allow arbitrary arguments order for Q3C, Q3CN, and Qwen3.5 (#1352) 2026-03-03 15:39:16 +01:00
chat-parser.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
chat-parser.h Refactor chat and server file (#1062) 2025-12-15 08:27:20 +01:00
chat-peg-parser.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
chat-peg-parser.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
chat.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
chat.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
common.cpp common : add env vars for cache_type_k/v, mlock, k_cache_hadamard and enable env vars for all tools (#1402) 2026-03-11 15:35:26 +01:00
common.h server: add checkpoint tolerance and fix grammar_trigger init (#1346) 2026-03-02 07:45:32 +01:00
console.cpp check C++ code with -Wmissing-declarations (#3184) 2023-09-15 15:38:27 -04:00
console.h gguf : new file format with flexible meta data (beta) (#2398) 2023-08-21 23:07:43 +03:00
json-partial.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
json-partial.h Move minja and nlohmann/json to vendor (#802) 2025-09-27 09:12:35 +02:00
json-schema-to-grammar.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
json-schema-to-grammar.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
llguidance.cpp Tool calls support from mainline (#723) 2025-09-01 08:38:49 +03:00
log.cpp Refactor chat and server file (#1062) 2025-12-15 08:27:20 +01:00
log.h Server: refactor and rename functions (#1151) 2026-01-18 08:16:57 +02:00
ngram-cache.cpp spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-cache.h spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-map.cpp spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-map.h spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-mod.cpp spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-mod.h spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
peg-parser.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
peg-parser.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
regex-partial.cpp llama : add token matching support to llama-grammar (#1220) 2026-02-03 07:57:17 +02:00
regex-partial.h Tool calls support from mainline (#723) 2025-09-01 08:38:49 +03:00
sampling.cpp grammar: fix trigger pattern init error (#1365) 2026-03-05 07:54:41 +01:00
sampling.h fix adaptive p sampler rewinding too far back (#1359) 2026-03-04 13:26:25 +01:00
speculative.cpp Add MTP decoding support for GLM-4.x MoE (#1270) 2026-02-22 18:14:39 +01:00
speculative.h Add MTP decoding support for GLM-4.x MoE (#1270) 2026-02-22 18:14:39 +01:00
train.cpp Server: refactor and rename functions (#1151) 2026-01-18 08:16:57 +02:00
train.h sync : ggml (backend v2) (#3912) 2023-11-13 14:16:23 +02:00
unicode.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
unicode.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00