From b73f367f22b6a7289dfeef1989ead8881bbfe181 Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Fri, 16 Jan 2026 22:43:25 -0800 Subject: [PATCH] config-schema.json,config.example.yaml: Update examples and schema --- config-schema.json | 28 +++++++++++++++++++++++++++- config.example.yaml | 23 +++++++++++++---------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/config-schema.json b/config-schema.json index 069b0dc5..8baa0cc4 100644 --- a/config-schema.json +++ b/config-schema.json @@ -188,11 +188,17 @@ "default": "", "pattern": "^[a-zA-Z0-9_, ]*$", "description": "Comma separated list of parameters to remove from the request. Used for server-side enforcement of sampling parameters." + }, + "setParams": { + "type": "object", + "additionalProperties": true, + "default": {}, + "description": "Dictionary of parameters to set/override in requests. Useful for enforcing specific parameter values. Protected params like 'model' cannot be overridden. Values can be strings, numbers, booleans, arrays, or objects." } }, "additionalProperties": false, "default": {}, - "description": "Dictionary of filter settings. Only stripParams is supported." + "description": "Dictionary of filter settings. Supports stripParams and setParams." }, "metadata": { "type": "object", @@ -320,6 +326,26 @@ "minLength": 1 }, "description": "A list of models served by the peer." + }, + "filters": { + "type": "object", + "properties": { + "stripParams": { + "type": "string", + "default": "", + "pattern": "^[a-zA-Z0-9_, ]*$", + "description": "Comma separated list of parameters to remove from the request. Useful for removing parameters that the peer doesn't support." + }, + "setParams": { + "type": "object", + "additionalProperties": true, + "default": {}, + "description": "Dictionary of parameters to set/override in requests to this peer. Useful for injecting provider-specific settings. Protected params like 'model' cannot be overridden. Values can be strings, numbers, booleans, arrays, or objects." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Dictionary of filter settings for peer requests. Supports stripParams and setParams." } } }, diff --git a/config.example.yaml b/config.example.yaml index 9814b050..39f74db2 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -70,16 +70,6 @@ sendLoadingState: true # all fields except for Id so chat UIs can use the alias equivalent to the original. includeAliasesInList: false -# apiKeys: require an API key when making requests to inference endpoints -# - optional, default: [] -# - when empty (the default) authorization will not be checked as llama-swap is default-allow -# - each key is a non-empty string -apiKeys: - - "sk-hunter2" - # hint, one liner: printf "sk-%s\n" "$(head -c 48 /dev/urandom | base64 )" - - "sk-gyCPiKUcIfPlaM4OSMZekkprgijPx6+OsmQs8Rsg0xZ9qpy6gKWsIKqHOk+cgXVx" - - "sk-+QtIn0Zjj4UHjiaZYiZEnru4mrwKM9RzhmJeK5SobNXLl8QMFXxGz1/2lEuvQpkb" - # macros: a dictionary of string substitutions # - optional, default: empty dictionary # - macros are reusable snippets @@ -110,6 +100,19 @@ macros: # - useful for paths, secrets, or machine-specific configuration "models_dir": "${env.HOME}/models" +# apiKeys: require an API key when making requests to inference endpoints +# - optional, default: [] +# - when empty (the default) authorization will not be checked as llama-swap is default-allow +# - each key is a non-empty string +apiKeys: + - "sk-hunter2" + # tip, one liner: printf "sk-%s\n" "$(head -c 48 /dev/urandom | base64 )" + - "sk-gyCPiKUcIfPlaM4OSMZekkprgijPx6+OsmQs8Rsg0xZ9qpy6gKWsIKqHOk+cgXVx" + + # use environment variable macros to keep secrets out of the config + - "${env.API_KEY_1}" + - "${env.API_KEY_2}" + # models: a dictionary of model configurations # - required # - each key is the model's ID, used in API requests