Skip to content

Strip parameters out of requests to preserve default server values #174

@mostlygeek

Description

@mostlygeek

When swapping models chat clients may not have the recommended params for temp, top_p, etc for a specific model. Many inference back ends allow defaults values to be set but not protected from being overridden.

llama-swap can do a bit more here by stripping out parameters in the JSON request to v1/chat/completions. If the parameters exist in the request they are deleted.

For example in llama-server there are many params that could be deleted from a request.

What the design would look like is:

macros:
    DRY_params: "dry_multipler, dry_base, dry_allowed_length, dry_penalty_max_n"
models:
    mymodel: 
        cmd: ... 
        filters: 
            strip_params: "temperature, top_k, min_p, ${DRY_params}"

In this design:

  • a filters map is introduced. Defaults to an empty map
  • the strip_params is a comma delimited string. This makes it easy to substitute in macros. Defaults to "" (empty string)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions