Skip to main content

Module inference_profile

Module inference_profile 

Source
Expand description

Named, cross-model sampling profiles.

A profile is a named, sparse InferenceConfig that a client selects per request by appending :{name} to the model it asks for — qwen3.6:coding. It exists because a single gglib proxy serves clients with incompatible sampling needs: coding agents want low-temperature determinism while conversational UIs want something warmer. Both hit the same model name, so per-model inference_defaults alone cannot tell them apart.

The {name}:{variant} shape follows the existing council virtual models (gglib-council:interactive) and Ollama’s universal name:tag convention, which is what makes the variants render and select correctly in OpenAI-compatible clients like OpenWebUI.

§Profiles are sparse

Only the fields a profile explicitly sets are Some; the rest stay None and fall through to the layers below (per-model defaults, then global settings, then the hardcoded fallback). This is what makes one global profile safe to apply across heterogeneous model architectures: a coding profile that sets only temperature and top_p still lets a thinking model contribute its own presence_penalty from InferenceConfig::reasoning_profile. A profile that carried a value for every field would silently erase per-model tuning that exists for good architectural reasons.

See InferenceConfig::resolve_with_profile for the full merge order.

Structs§

InferenceProfile
A named sampling profile applied on top of a model’s own defaults.

Enums§

ProfileNameError
Why a profile name was rejected.

Constants§

MAX_PROFILE_NAME_LEN
Maximum length of a profile name.
RESERVED_PROFILE_NAMES
Names that cannot be used for a profile because they already mean something as a :{suffix} on a model id.

Functions§

builtin_templates
Starting-point profiles a user can install and then edit.
validate_name
Validate a profile name.