Reference

Configuration

Kinference core configuration is read from a single TOML file, specified on the command line with --config.

An unrecognised top-level key is a startup error naming the key and listing the accepted ones. Keys inside a [section], and in the separate workers file, are tolerated and ignored.

Top level configuration #

KeyTypeDefaultEffect
listenstringrequiredgRPC bind address
admin_listenstringunsetHTTP bind address for the dashboard, /metrics and /readyz. If unset, all three endpoints will be disabled.
mock_modeboolfalseAnswer deterministically without ingest, scraping or tokenization

Miscellaneous configuration #

KeyTypeDefaultEffect
dashboard_max_workersinteger16How many workers the live dashboard can display.
metrics_poll_msinteger1000How frequently each worker’s /metrics is scraped
models_refresh_secsinteger30How frequently each worker’s /v1/models is polled
replay_timeout_msinteger60000Budget for one KV-event replay against a worker’s replay socket
observation_ttl_secsinteger600How long per-request bookkeeping is held awaiting caller feedback
body_max_total_kbinteger262144Server-wide request-body buffer cap, in KB (256 MiB)
body_max_request_kbinteger8192Per-request body cap, in KB (8 MiB)
body_ttl_secsinteger60Backstop release for a buffered body
body_idle_timeout_secsinteger30Maximum silence between PushBody chunks

Inference profile configuration #

Section: [profile]

Every worker set is associated with an inference profile that determines how expected latency is calculated, how prompts are tokenized, and other details. Profiles may be shared between worker sets.

Profile names must be non-empty and unique.

KeyTypeDefaultEffect
namestringrequiredName of the profile

Per-profile tokenization configuration #

Section: [profile]

In order to make use of KV-cache-aware load balancing, Kinference must template and tokenize new prompts in the exact same way that the workers do. The easy way to do this is with a round trip to the worker’s /render endpoint.

However, it can be significantly faster to avoid the round trip and handle this tokenization in-process. Kinference supports this for specific models.

KeyTypeDefaultEffect
tokenize.moderender | local | comparerenderHow prompts are tokenized. render calls the engine’s /render; local uses the in-process tokenizer; compare uses local and checks it against /render

http is accepted as an alias for render.

Per-profile latency prediction configuration #

Section: [profile.predictor]

Kinference computes the expected latency of a worker by combining a set of factors with coefficients. This section configures the coefficients.

KeyTypeDefault
base_msfloat400.0
forward_pass_msfloat0.0
queue_ms_per_entryfloat1000.0
attention_uncached_block_msfloat2.3
attention_uncached_per_every_block_msfloat0.009
cache_pressure_penalty_msfloat0.0
cache_pressure_saturated_thresholdfloat0.9
saturated_cold_ms_per_entryfloat10000.0
q_running_penalty_peak_msfloat700.0
q_running_penalty_peak_qrinteger2
q_running_penalty_falloff_qrinteger5
inflight_concurrent_capacityinteger5
expected_overlap_alphafloat1.0

Per-profile Endpoint picking configuration #

Section: [profile.picker]

Given a set of expected latencies, how should Kinference choose between them? This section configures its picking approach.

KeyTypeDefaultEffect
top_k_mininteger2Minimum candidate set size
top_k_fractionfloat0.2Candidate set as a fraction of eligible workers
tie_tolerance_msfloat50.0Predictions within this are treated as tied
inflight_trackingbooltrueCredit prefixes that in-flight requests are still prefilling
replication_threshold_pctfloat0.0Prompt-share threshold above which a prefix is replicated. 0 disables
replication_warm_targetinteger2Workers a replicated prefix should be warm on
replication_warm_threshold_fractionfloat0.5Overlap fraction counting as warm

Worker set configuration #

Section: [workerset]

An internally homogeneous set of workers: same model, same engine, same KV block size. Names must be unique and non-empty. At least one is required unless [kubernetes] enabled = true, which derives them from InferenceWorkerSet CRs instead.

KeyTypeDefaultEffect
namestringrequiredSet identity, and the workerset label on observations
profilestringrequiredMust name a defined [[profile]]
kv_block_sizeintegerrequiredTokens per block in the events these engines publish. Must be > 0
render_urlstringunsetOverride for the engine /render endpoint

kv_block_size must match what the engine actually publishes, which is not always its --block-size flag. A worker publishing a different value is evicted.

Worker set discovery configuration #

Section: [workerset.discovery]

KeyTypeDefaultEffect
modestatic | kubernetesstaticWhere workers come from
workers_filepath—Required for static. See Workers file
service_namestring—Required for kubernetes. The Service whose EndpointSlices are watched
namespacestringinheritedNamespace to watch

Worker set discovery defaults configuration #

Section: [workerset.discovery.defaults]

Ports used when discovery finds no named port. Named ports themselves are not configurable here — they come only from an InferenceWorkerSet CR, so a [[workerset]] in this file resolves ports by these defaults alone.

KeyTypeDefault
http_portinteger8000
zmq_portinteger5557
replay_portintegerunset

Static workers file configuration #

The file named by workers_file, containing a flat [[workers]] list. Both worker_id_num and worker_id_str must be unique across every worker set.

KeyTypeDefaultEffect
worker_id_strstringrequiredExposed over gRPC and in logs
worker_id_numintegerrequiredKeys the fleet-wide telemetry and metrics registries
model_namestringrequiredFilters label-matched engine metrics
zmq_endpointstringrequiredThe engine’s KV-event PUB socket. Optional only when mock_mode is true
replay_endpointstringunsetThe engine’s replay socket. Unset means live-only ingest
metrics_urlstringunsetThe engine’s /metrics. Unset leaves load fields at zero
http_urlstringunsetThe engine’s HTTP base, for /render and /v1/models
endpointstringderivedAddress returned to callers. Derived from http_url when unset
pod_name, namespace, node_name, node_ip, pod_ip, availability_zone, instance_typestringunsetTopology labels, for the dashboard and observations

The engine type is not configured here. It is detected from the engine’s own /v1/models response and used only for display.

Top-level tokenization configuration #

Section: [tokenize]

KeyTypeDefaultEffect
pool_max_idle_per_hostintegerunsetIdle HTTP connections kept per engine
local.mount_dirpathunsetLooked up as {mount_dir}/{model}/tokenizer.json. Unset fetches from the Hub
local.warmupbooltrueLoad each model’s tokenizer at worker registration

Metrics configuration #

Section: [metrics]

KeyTypeDefaultEffect
tenant_labels"none" | "all" | list of strings"none"Which tenants get their own tenant label. See Metrics

A value other than "none", "all" or a list is a startup error.

Policy configuration #

Section: [policy]

KeyTypeDefaultEffect
enabledboolfalseWatch the kinference.buoyant.io CRDs and honor PickRequest.inference_pool
namespacestringallNamespace to watch

With this off, a request naming an InferencePool is routed on load alone.

Kubernetes configuration #

Section: [kubernetes]

Derive worker sets from InferenceWorkerSet CRs instead of [[workerset]] blocks. Requires at least one [[profile]], since every CR names one.

KeyTypeDefaultEffect
enabledboolfalseWatch InferenceWorkerSet CRs
namespacestringallNamespace to watch
selectorstringunsetLabel selector limiting which CRs are honored

[kubernetes.discovery_defaults] takes the same keys as [workerset.discovery.defaults] and applies to every derived set.

Authz Kubernetes token review configuration #

Section: [token_review]

Validate Kubernetes bearer tokens for callers that cannot reach the apiserver themselves. Needs create on tokenreviews in authentication.k8s.io.

KeyTypeDefaultEffect
enabledboolfalseServe TokenReview on the gRPC listener
default_deadline_msinteger2000Budget for one apiserver round-trip
positive_ttl_secsinteger60How long an authenticated result is cached
negative_ttl_secsinteger10How long a denied result is cached
max_cache_entriesinteger4096Cache size cap

Enabling this without available Kubernetes credentials is a startup error.

Rate limiting configuration #

Section: [rate_limit]

KeyTypeDefaultEffect
enabledboolfalseServe RateLimiter on the gRPC listener

The only implementation admits every reservation and tracks no budget. Enabling it logs a warning saying so.

Kubernetes leader election configuration #

Section: [leader_election]

Lease-based election, gating CRD status writes so replicas do not fight over them.

KeyTypeDefaultEffect
enabledboolfalseContend for the Lease
lease_namestring"bllmp"Lease object name. Must be non-empty
namespacestringinheritedLease namespace
lease_duration_secsinteger15Lease validity
renew_grace_secsinteger10Renew once within this of expiry. Must be less than lease_duration_secs
retry_secsinteger2Retry interval after a failed Lease operation

All three intervals must be greater than zero.