Skip to content

Config fields

hlid loads hlid.toml (or hlid.yaml) from its working directory, then applies environment overrides.

Top level

FieldTypeDefaultDescription
bind_addrstring127.0.0.1:8080Address and port hlid listens on (loopback by default; the sample config binds 0.0.0.0:8080 for Docker)
auth_keystringunsetAPI key required on every request. Unset + loopback bind = auth skipped
request_timeout_secsinteger120Max seconds to wait for an upstream response
observe_buffer_sizeinteger1000How many request captures the ring buffer keeps

[[backends]]

An ordered list — the first entry whose model_pattern matches wins.

FieldTypeRequiredDescription
model_patternstringyesGlob matched against the requested model name. * is the catch-all
urlstringyesBase URL of the backend server
dialectstringyesProtocol the backend speaks — see below
credential_refstringnoName of the env var holding this backend's API key

Dialects

ValueProtocol
openai-chatOpenAI Chat Completions (/v1/chat/completions)
openai-responsesOpenAI Responses (/v1/responses)
openai-completionsOpenAI Completions, legacy (/v1/completions)
anthropic-messagesAnthropic Messages (/v1/messages)

An invalid dialect string fails at startup, not at request time.

Environment overrides

VariableOverrides
HLID_BIND_ADDRbind_addr
HLID_AUTH_KEYauth_key

Backend credentials are always read from the environment via credential_ref — they have no file-based form by design.

Full example

toml
bind_addr = "0.0.0.0:8080"
auth_key = "sk-hlid-my-secret-key"
request_timeout_secs = 120
observe_buffer_size = 1000

[[backends]]
model_pattern = "llama-*"
url = "http://localhost:8081"
dialect = "openai-chat"

[[backends]]
model_pattern = "claude-*"
url = "https://api.anthropic.com"
dialect = "anthropic-messages"
credential_ref = "ANTHROPIC_API_KEY"

[[backends]]
model_pattern = "*"
url = "http://localhost:8081"
dialect = "openai-chat"

MIT licensed · built at the workbench