Files
junction/config.example
T
Hermes Agent 137113b0a2 junction: pf.conf-style policy router for model endpoints (C99/POSIX)
Rules are ordered and first-match-wins: model glob, path glob, required context,
hook/retry overrides, pass <endpoint>[,<endpoint>] [as <model>] or block.
Endpoints carry shell pre-hooks (exit != 0 = not yet, retried with backoff after an
optional wake command), an offline window after a failed connect, and two timeouts
(idle + total) so a thinking model logs still_working instead of looking hung.

tests/run.sh: 14 checks against C stubs (failing, gated, slow, dead endpoints).
2026-10-29 13:24:31 +00:00

78 lines
2.1 KiB
Plaintext

# junction.conf — pf.conf-style. keyword, arguments, braces. '#' starts a comment.
# Double quotes group words. Unknown keywords are a hard error with a line number.
listen 0.0.0.0:8090
chars_per_token 4
default_max_tokens 4096
connect_timeout_ms 1500
offline_hold_s 20
max_body_bytes 67108864
# --------------------------------------------------------------------- endpoints
endpoint peer1 {
base http://192.0.2.10:8081/v1
kind remote
context 64000
priority 20
timeout 600
idle_timeout 60
cooldown 120
hook /opt/junction/hooks/check-http.sh
}
endpoint peer2 {
base http://192.0.2.10:8082/v1
kind remote
context 64000
priority 20
timeout 600
idle_timeout 60
cooldown 120
hook /opt/junction/hooks/check-http.sh
}
endpoint workstation {
base http://192.0.2.20:8080/v1
kind local
context 128000
priority 10
timeout 1800
idle_timeout 30
cooldown 60
hook_retry 180
hook_backoff 5
wake /opt/junction/hooks/wake-wol.sh
hook /opt/junction/hooks/check-http.sh
hook /opt/junction/hooks/check-budget.sh
}
endpoint cloud {
base https://api.example.com/v1
kind cloud
context 200000
priority 90
timeout 900
idle_timeout 120
api_key_env EXAMPLE_API_KEY
}
# ------------------------------------------------------------------------- rules
# First matching rule wins. Rules may use:
# for <model-glob> need >N | <N | N path <glob>
# check hooks|none retry <seconds>
# pass <endpoint>[,<endpoint>...] [as <model>] | block
# Requests that need more context than the peers have go straight to the big box.
req need >64000 pass workstation, cloud
# Coding work: prefer the workstation, wake it, wait up to 5 minutes for the hooks,
# and hand it the model name it actually serves.
req for "*coder*" check hooks retry 300 pass workstation as "Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M"
req for "Qwen3.8-Flash-Next*" check hooks retry 60 pass workstation, peer1, peer2
# Cheap metadata calls never need a model at all.
req path "/v1/models" check none pass peer1, peer2, cloud
# Anything unseen is refused rather than silently sent to the cloud.
req for "*" block