Repository navigation
feat(server): detect stalled engines and support model-card lookup - #3692
Open
Jaeyeong-CHOI wants to merge 3 commits into
Open
Jaeyeong-CHOI wants to merge 3 commits into
Jaeyeong-CHOI wants to merge 3 commits into
Conversation
Probe chat templates before folding unsupported system and post-tool turns.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add opt-in stalled-engine health checks and OpenAI model-card lookup
Addresses #3633. A loaded, idle server still returns the b10621 health response. Both server CLIs accept --stall-timeout (or MLXCEL_STALL_TIMEOUT); when enabled, a scheduler that has work but stops stepping returns 503 Engine stalled. New arrivals cannot postpone the deadline. The next step or idle transition restores readiness.
The /models/{id} and /v1/models/{id} routes look up the same cards as the inventory, including side models and IDs with slashes. An unknown ID returns the OpenAI model_not_found envelope. Router mode looks up visible cards without loading the model; the existing /models/sse endpoint retains its meaning.
On Spark1, we served Qwen3-0.6B weights with the published
mistralai/Mistral-7B-Instruct-v0.3chat template. On the unpatched binary, both a later system message and a user turn immediately after a tool result returned HTTP 400 from/v1/chat/completions. With the patch, both returned 200./apply-templateconfirmed the later system text, tool result, follow-up text and call ID survived. This tests the Mistral template, not Mistral model weights. The shared renderer probes before folding either order. The Mistral Small 3.2 template already renders later system turns and does not accept tool turns at all.No output-parser change: upstream removes leading CR/LF after reasoning/tool blocks. With Qwen3-0.6B-4bit, raw output contained a closing think tag and two newlines before “First”, while parsed JSON and SSE content both started with “First”.
Validation on DGX Spark1
On commit
fc876f905, the CUDA build, Clippy with warnings denied, formatting and 232 focused tests passed (4 template tests ignored). Live Qwen serving returned 200 for health and chat. The isolated unpatched binary returned 404 for the listed aliaslab/Qwen3-0.6Bon both lookup routes; the patched binary returned 200 with the listed card and the expected JSON error for a missing ID. The stall/recovery sequence was tested at the HTTP handler, not by hanging a live GPU.The full CUDA gate on that commit found one patch regression: the runtime-settings schema omitted the new startup field. The follow-up commit classifies it as a read-only integer and updates the 119-field invariant. The other two gate failures,
mlx_test_guard_coverageandstep3p7_parity, reproduced separately on the isolated unpatched checkout.On the final commit,
8d6a74698(tree867ea22a133ccc5fc18fd7ee0d4c50334e58efa0, matched on Spark1), formatting and all 14 CUDA runtime-settings tests passed, including the schema invariant and field fixture. A separate catalog check found English and Korean labels for all 142 fixture fields and sub-fields. The full CUDA gate was rerun on this exact commit: 18,647 passed, 2 failed, 540 ignored. Both failures matched the unpatched baseline: mlx_test_guard_coverage reported the same missing guard and step3p7_parity failed the same padded-prefill assertion. No new failure was observed. Live smoke was not rerun after the settings-only changes.Upstream comparison: the branch is based on
a8eb71599; a local merge-tree check against upstream97b63a2e8found no conflicts. The hypothetical merge tree was not built or tested.