Skip to content

Proposal: allow arg.cpp to import/export configs from/to INI file #17850

Description

@ngxson

A while ago, we introduced the notion of "preset" in #10932 which was implemented using the existing arg.cpp infrastructure.

I'm now thinking about extending this into a new level. As the title said, I'm proposing adding an extension on top of arg.cpp that will allow import/export arguments from/to INI file

Use cases for this feature are:

Why choosing ini?

  1. It is simple to understand, simple to edit
  2. It provides multiple "sections" - each section can be used as a new preset
  3. The parser/writer can be simple - For example, this parser/writer is just ~700 LOC. We can do even better because we only use a subset of the language (only string value, no nested config)

Example of a config file:

(the config name is the env var name - already defined inside arg.cpp)

LLAMA_CONFIG_VERSION = 1

[gemma-4b-vision]
LLAMA_ARG_HF_REPO = ggml-org/gemma-3-4b-it-qat-GGUF
; this is a small model, I can offload everything to VRAM
LLAMA_ARG_N_GPU_LAYERS = 99999
LLAMA_ARG_N_CTX = 0
LLAMA_ARG_JINJA = true

[gemma-12b-vision]
LLAMA_ARG_HF_REPO = ggml-org/gemma-3-12b-it-qat-GGUF
; my system doesn't have enough VRAM, only offload some
LLAMA_ARG_N_GPU_LAYERS = 8
LLAMA_ARG_N_CTX = 0
LLAMA_ARG_JINJA = true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions