Felipe97/llama-cpp-compiled
01.1k
1# llama.cpp INI Presets2 3## Introduction4 5The INI preset feature, introduced in [PR#17859](https://github.com/ggml-org/llama.cpp/pull/17859), allows users to create reusable and shareable parameter configurations for llama.cpp.6 7## Using Presets with the Server8 9When running multiple models on the server (router mode), INI preset files can be used to configure model-specific parameters. Please refer to the [server documentation](../tools/server/README.md) for more details.10 11### Using a Hugging Face Preset12 13> [!IMPORTANT]14>15> Please only use presets that you can trust! Unknown presets may be unsafe16 17You can push your preset to Hugging Face Hub and share with other users by:181. Creating an empty model repository on Hugging Face192. Creating a `preset.ini` file in the root directory of the repository20 21Example of a `preset.ini`:22 23```ini24[*]25ctx-size = 026mmap = 127kv-unified = 128parallel = 429spec-default = 130 31[Qwen3.5-4B]32hf = unsloth/Qwen3.5-4B-GGUF:Q4_K_M33ctx-size = 26214434batch-size = 204835ubatch-size = 204836top-p = 1.037top-k = 038min-p = 0.0139temp = 1.040 41[gpt-oss-120b-hf]42hf = ggml-org/gpt-oss-120b-GGUF43ctx-size = 26214444batch-size = 204845ubatch-size = 204846top-p = 1.047top-k = 048min-p = 0.0149temp = 1.050chat-template-kwargs = {"reasoning_effort": "high"}51```52 53The preset will be loaded similarly to the `--models-preset` option. Therefore, you can also override certain params via CLI arguments:54 55```sh56# Force temp = 0.1, overriding the preset value57llama-cli -hf username/my-preset --temp 0.158```59 60### Named presets61 62If you want to define multiple preset configurations for one or more GGUF models, you can create a blank HF repo containing a single `preset.ini` file that references the actual model(s):63 64```ini65[*]66mmap = 167 68[gpt-oss-20b-hf]69hf = ggml-org/gpt-oss-20b-GGUF70batch-size = 204871ubatch-size = 204872top-p = 1.073top-k = 074min-p = 0.0175temp = 1.076chat-template-kwargs = {"reasoning_effort": "high"}77 78[gpt-oss-120b-hf]79hf = ggml-org/gpt-oss-120b-GGUF80batch-size = 204881ubatch-size = 204882top-p = 1.083top-k = 084min-p = 0.0185temp = 1.086chat-template-kwargs = {"reasoning_effort": "high"}87```88 89You can then use it via `llama-cli` or `llama-server`, example:90 91```sh92llama-server -hf user/repo:gpt-oss-120b-hf93```94 95Please make sure to provide the correct `hf-repo` for each child preset. Otherwise, you may get error: `The specified tag is not a valid quantization scheme.`96 97## System-level config98 99The system-level config, added in PR [#26118](https://github.com/ggml-org/llama.cpp/pull/26118), allows sharing the same set of options among multiple tools and examples. Unlike the sections above, it is not limited to the server.100 101These files are loaded on startup if present. A later file overrides an earlier one:1021. System-wide: `/etc/llama.cpp/config.ini` (or `%PROGRAMDATA%\llama.cpp\config.ini` on Windows)1032. User-level: `$XDG_CONFIG_HOME/llama.cpp/config.ini`, `~/.config/llama.cpp/config.ini` by default (or `%APPDATA%\llama.cpp\config.ini` on Windows)104 105The config file is applied first, then its options are overridden by ENV variables, CLI arguments and model presets (in router mode).106 107Note:108- Only the `[*]` and default sections are used; options written before any section header belong to "default. Named sections are ignored109- Tool-specific options can be specified, but will be ignored (with a warning) if the example doesn't support it<br/>Example: if you specify `port = 1234`, only `llama-server` will use it, other examples will ignore it110- `model` or `hf-repo` are not recommended to be configured system-level, because it may introduce conflicts<br/>Example: a `hf-repo` in the config file still takes effect when you pass `-m` on the command line, so you may load a different model than expected111 