Skip to content

Make the proxy header timeout configurable and take action timeouts from manifests - #30

Merged
JaredP94 merged 3 commits into
mainfrom
feat/configurable-timeouts
Nov 2, 2026
Merged

JaredP94 merged 3 commits into
mainfrom
feat/configurable-timeouts

Conversation

@JaredP94

@JaredP94 JaredP94 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Description

  1. Proxy header timeout (ollama-proxy, lmstudio-proxy, omlx-proxy). An engine sends no headers until generation starts, so a request queued behind other work or waiting on a slow model load failed with 502 … timeout awaiting response headers after a hard-coded 120 s. Each proxy now takes --response-header-timeout, then NVPAIR_PROXY_RESPONSE_HEADER_TIMEOUT, then 120 s. Invalid/non-positive values keep the default. The default is unchanged on purpose: these proxies don't yet retry a candidate that stopped answering, so a longer wait would make a frozen node more expensive. Troubleshooting docs cover it (launchctl setenv on macOS). Adapted from Make proxy upstream response-header timeout configurable NVIDIA/Personal-AI-Router#83 ([Bug]: ollama-proxy: undocumented 120 s upstream response-header timeout turns a queued or cold-loading request into a 502 NVIDIA/Personal-AI-Router#57).
  2. Per-action timeouts (nvpair-engine-manager). The 10-minute header wait was given to Ollama run_model and any load_model by name; LM Studio's and oMLX's chat got 30 s. HTTP actions now declare timeout_s; the bundled run_model, load_model and chat actions declare 600. Adapted from Select action response-header timeouts from the manifest NVIDIA/Personal-AI-Router#93 ([Bug]: Action HTTP response-header timeout is selected by a hardcoded engine name, so only Ollama gets the long client NVIDIA/Personal-AI-Router#25).

Validation

go test ./... in all four modules, with resolver, transport and per-action tests. Confirmed broker and desktop spawn children with the inherited environment.

Risk

Low. Proxies 1.4.1 / 1.4.1 / 1.4.2, engine-manager 1.4.0.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off (git commit -s), certifying the Developer Certificate of Origin.
  • New or existing tests cover the change.
  • Relevant documentation is updated.
  • I checked the diff, changed filenames, and commit messages for credentials, private data, internal URLs, internal issue identifiers, and generated artifacts.
  • I recorded the validation commands and results above.
  • I bumped any affected component in services/versions.json, and described user-visible changes above so they reach the release notes.

Part of the upstream issue/PR review. Each branch is independent off main; they all bump services/versions.json, so the second one merged will need a trivial conflict resolution there.

JaredP94 and others added 3 commits November 2, 2026 20:47
An engine sends no headers until generation starts, so a request queued
behind other work, or waiting on a slow model load, failed through PAIR
with 502 "timeout awaiting response headers" after a hard-coded 120 s,
while the same request sent to the engine directly succeeded.

Each proxy now takes --response-header-timeout, then
NVPAIR_PROXY_RESPONSE_HEADER_TIMEOUT, then the 120 s default. The
proxies inherit the broker's environment, so on macOS
`launchctl setenv` reaches an app opened from the Finder. An invalid or
non-positive value keeps the default. The default is unchanged: these
proxies have no retry for a candidate that has stopped answering, so a
longer wait would make a frozen node more expensive.

Adapted from NVIDIA#83 (issue NVIDIA#57) for this fork's
three proxies.

Co-authored-by: Mallikh Kalkere <mkalkere@users.noreply.github.com>
Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
…nifest

The engine manager gave a 10-minute response-header wait to Ollama's
run_model and to any load_model by name, and 30 s to everything else, so
LM Studio's and oMLX's chat actions failed on a long prefill or a cold
load. An HTTP action now declares timeout_s in its manifest; the bundled
run_model, load_model and chat actions declare 600, and an action that
declares none keeps 30 s. Validation rejects a negative value or one on
a non-HTTP action.

Adapted from NVIDIA#93 (issue NVIDIA#25).

Co-authored-by: Aaron K. Clark <cryptojones@owasp.org>
Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
…r wait

Review follow-up. The local oMLX and LM Studio load actions now wait up
to 600 s for headers, but a load requested from a cluster peer still
used the 30 s client unless the engine was Ollama, and cancelling it
propagates to the peer's in-flight action. Every remote load now uses
the readiness client; the peer's own action timeout still bounds it.

Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
@JaredP94
JaredP94 force-pushed the feat/configurable-timeouts branch from 1872df9 to 0a6b9a8 Compare November 2, 2026 18:48
@JaredP94
JaredP94 merged commit 7640ad9 into main Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant