tokunseba
Reference

Configuration

Every key in config.toml, what it does, and what it defaults to.

tokunseba config show              # print the file, and its path
tokunseba config show --path-only  # just the path
tokunseba config set tiers.tier3 true

The file lives at ~/.tokunseba/config.toml and is plain TOML. Editing it by hand is fine; tokunseba restart picks up the change.

config set validates the key against the known schema, so a typo is refused rather than silently written into a section nothing reads.

proxy

[proxy]
port = 7777
store_bodies = true
cache_ttl = ""
KeyDefaultWhat it does
port7777The loopback port the proxy listens on
store_bodiestrueKeep whole request bodies, which is what explain and replay read. Turn off to store less
cache_ttl""Ask for a longer prompt-cache lifetime, e.g. 1h. Off by default because the trade only pays for a particular rhythm of work

tiers

[tiers]
lossless = true
reach_preserving = true
tier3 = false
KeyDefaultTier
losslesstrueTier 1, reversible
reach_preservingtrueTier 2, reach preserving
tier3falseTier 3, opt in

Prefer tokunseba tier enable 3 over setting this directly. The command tells you what the tier is permitted to change before it changes anything.

tier3

[tier3]
effort_routing = false
model_routing = false
local_routing = false
redact_secrets = false
annotate_injections = false
local_model = ""
rules = []

[tier3.model_map]

Nothing here is on merely because tiers.tier3 is on.

KeyDefaultWhat it does
effort_routingfalseLower the reasoning effort on a turn that does not need it
model_routingfalseSwap one model for another on the same upstream, via model_map
local_routingfalseSend easy chitchat and writing turns to local_model
redact_secretsfalseReplace credentials before the request leaves this machine
annotate_injectionsfalseLabel tool results that look like they are addressing the assistant
local_model""Which model the local upstream should be asked for
rules[]Routing rules. Manage with tokunseba route, not by hand
model_map{}from-model = "to-model" pairs for model_routing

judge

[judge]
enabled = false
backends = ["rules", "laya"]
laya_model = "convaiinnovations/laya"
laya_device = "auto"
gate_threshold = 0.8
timeout = 5.0
inline = false
warm = false
KeyDefaultWhat it does
enabledfalseWhether the local judge model may be used
backendsrules, layaTried in order; the first available and confident one wins
laya_modelconvaiinnovations/layaWhich weights to fetch
laya_deviceautocpu, mps, cuda, or pick the best available
gate_threshold0.8A signal below this is discarded entirely
timeout5.0Seconds before the judge is treated as unsure
inlinefalseJudge on the request path rather than beside it
warmfalseLoad the weights at proxy startup rather than on first use

gate_threshold is the single most consequential number here. See The judge.

thresholds

[thresholds]
truncate_lines = 300
truncate_tokens = 6000
cache_min_tokens = 1024
local_truncate_tokens = 1500
KeyDefaultWhat it does
truncate_lines300Lines kept when nothing better applies
truncate_tokens6000Token budget for the same
cache_min_tokens1024Smallest prefix worth adding a cache breakpoint to
local_truncate_tokens1500A tighter budget when the destination is a local model with a smaller window

Try a change before committing to it:

tokunseba replay --since 7d --set thresholds.truncate_lines=120

retention

[retention]
days = 90
auto_prune = true
keep_bodies_days = 14

See Retention. Prefer tokunseba retention keep.

budget

[budget]
daily_tokens = 0
hard_stop = false
KeyDefaultWhat it does
daily_tokens0A daily token ceiling. 0 means no ceiling
hard_stopfalseRefuse requests past the ceiling rather than only recording budget_exceeded

upstreams

[upstreams.anthropic]
base_url = "https://api.anthropic.com"
kind = "anthropic"

[upstreams.ollama]
base_url = "http://127.0.0.1:11434"
kind = "ollama"

kind is one of anthropic, openai, gemini, ollama, and decides which protocol the endpoint speaks. Anything OpenAI-compatible uses openai.

Manage these with tokunseba models add and tokunseba models rm, which guess the kind from the URL and probe the endpoint before saving it. config set deliberately does not accept upstream URLs: changing where requests go is not a knob a typo should be able to turn.

failover

[failover]
enabled = false

[failover.routes]

When the upstream fails, retry the same model somewhere else. Records failover_used. Off by default.

Environment variables

VariableWhat it does
TOKUNSEBA_HOMEWhere everything lives. Default ~/.tokunseba
TOKUNSEBA_NO_SESSION_ENVDo not read or write login-session variables
TOKUNSEBA_NO_WARMNever load the judge at startup, whatever the config says

On this page