Skip to main content

Module inference

Module inference 

Source
Expand description

Inference configuration types.

Defines shared types for configuring LLM inference parameters (temperature, top_p, top_k, max_tokens, repeat_penalty, presence_penalty, min_p).

This module provides the core InferenceConfig type that is reused across:

  • Per-model defaults (Model.inference_defaults)
  • Global settings (Settings.inference_defaults)
  • Request-level overrides (flattened in ChatProxyRequest)
  • gglib proxy — per-request injection into OpenAI-format request bodies
  • gglib chat / gglib q — hierarchy resolution for the agentic loop

All surfaces resolve inference parameters through InferenceConfig::resolve_with_profile, which is the single source of truth for the hierarchy. InferenceConfig::resolve_with_defaults is the same resolution with no profile selected, for surfaces that have no notion of one.

Structs§

InferenceConfig
Inference parameters for LLM sampling.
ModelSamplingContext
Everything about the target model that changes how sampling resolves, independent of any specific request.

Enums§

DefaultsOrigin
Whether a model’s stored inference_defaults were set by the user or written automatically at import time.

Functions§

camel_to_snake 🔒
Convert a camelCase string to snake_case.
snake_to_camel 🔒
Convert a snake_case string to camelCase.