Repository navigation
Provider 0.10.2: prepare release; explain why a model load cannot reclaim memory - #1603
Conversation
… on GLM
OpenRouter's provider-readiness test input-video-base64 failed on
glm-5.3-flash with 400 invalid_media. The clip is a variable-frame-rate
QuickTime movie (211 frames in 10.833 s), and GLM5NextProcessor refused it
with unsupported("variable-frame-rate video"), which the scheduler maps to
multimodal_rejected and then invalid_media.
- Bump mlx-swift-lm to the GLM5Next decoder fix: frames are indexed in
presentation order and timed by the track's average rate, as in the
reference loader (Layr-Labs/mlx-swift-lm#340).
- Admit data:video/mov (OpenRouter's documented QuickTime label) and
data:video/x-m4v on the shared media ingest. MemoryBackedVideoAsset
still identifies MP4 or QuickTime from the bytes.
- Scheduler-level regression test with the real OpenRouter fixtures and a
label-alias ingest test; docs and changelog fragment.
The Super media binding refused any encoded body over 8 MiB as invalid input, so OpenRouter's input-video-url readiness test (a 6.9 MB MP4 the coordinator inlines into a 9.3 MB body) failed with invalid_media. Raise NemotronSuperServingPolicy.maximumEncodedBodyBytes to 40 MiB, which holds one part at the shared 25 MiB inline-media cap as base64 and any body the provider's transports deliver, and make encodedHeaderQuote use it as its single bound. A body above it now fails as media_too_large. The media charge quotes and the default prefix bank follow the larger bound. Add NemotronSuperOpenRouterVideoTests: both OpenRouter readiness clips pass ingress, inspection, the pinned template's prompt, the media plan and every frame's decode, and serve on the tiny installed fixture.
…Flash
OpenRouter's reasoning-content-return readiness task carries tools and
returns the model's reasoning on an assistant tool-call turn. GLM refused
it with 400 invalid_request while MiMo and Nemotron Super serve it.
Every GLM-only refusal of a shape both passing families accept is removed:
- strict tool declarations: served without constrained decoding; every
auto call is already validated against its declared schema before it is
exposed (ToolConstraintValidation.validate).
- empty-string history arguments read as {} (vLLM, MiMo and Super parity).
- reasoning: null, null reasoning members and include_reasoning: null are
unset; reasoning.summary/generate_summary levels are no-ops.
- top-level thinking as a Boolean or GLM's API object
{"type":"enabled"|"disabled","clear_thinking":Bool}.
Reasoning returned as OpenRouter's `reasoning` string or `reasoning_details`
text entries now renders as the template's reasoning_content instead of an
empty thinking block. Contradictions, unknown reasoning members,
preserve_thinking, forced tool choices and hidden reasoning stay refused.
…ests NemotronSuperOpenRouterVideoTests copied NemotronSuperVideoBindingTests' tiny-fixture video owner (same tower, budget, load lease, context and teardown checks) and its generation-event recorder. Reuse videoOwner(contextLength:), VideoOwner.close() and SuperVideoEvents instead, and drop the unused MLXLMCommon import. Correct two test comments: the inlined link makes a body of more than 9 MB here (9.39 MB once JSONSerialization escapes slashes, not 9.3), and only invalid input, not every other binding refusal, still leaves as invalid_media.
The 40 MiB encoded-body bound made the 8 MiB case pass ingress; it was refused only by the context bound the next case already covers. Over local HTTP the body bound is unreachable because the 32 MiB upload limit answers 413 first (tested above), and the binding's over-cap refusal is covered by oversizeBodyIsMediaTooLarge.
… the changelog Required refactor pass; no behavior change. - Bump libs/mlx-swift-lm 54227bab -> 6aef0a5d (Layr-Labs/mlx-swift-lm#340), which removes decodeFrames' frame-rate parameter left unused by the variable-frame-rate fix and updates two comments that still described constant-frame-rate-only decoding. - The shared inline-video path also serves MiMo V2.6: MiMoV26EncodedMediaIngress calls MediaIngest.decodeVideo directly, so it admits the new video/mov and video/x-m4v labels too. Say so in the changelog fragment.
Owner decision. OpenRouter sends data:video/quicktime;base64, which every model already admits: Nemotron Super passed OpenRouter's base64 readiness test with OpenRouter's label, and the recorded request size fits that 28-character header exactly. The aliases also made the shared ingest accept labels that Nemotron Super, in the provider and the coordinator, still refuses. - MediaIngest.decodeVideo again admits only data:video/mp4;base64 and data:video/quicktime;base64; MediaIngest.swift, MediaIngestTests.swift and the T-050 threat-model wording match master. - The routing test keeps the real video/quicktime and video/mp4 readiness cases and drops the video/mov variant. - Docs and the changelog fragment keep only the variable-frame-rate fix. The SDK pin and the GLM regression test are unchanged.
…the GLM path The platform conformance fixtures hold OpenRouter's real tool-test bodies (orIncidentOmitted, orIncidentAuto): the Boston weather prompt with a strict, closed-schema get_current_weather tool and reasoning disabled. Replay both byte for byte (hash-checked), the same body with tool_choice none, and a five-step tool conversation built from them, through the coordinator and local decode paths, the tool-stream handler, the GLM policy and the shipped template. On master's policy every case fails with "strict tool decoding is not qualified" (invalid_request); with the fix they render.
… OpenRouter PR
Behavior-preserving refactor pass over the reasoning/strict commits. Correct the stale test name in docs/developer/test.md and say the captured requests are held byte for byte and hash-checked, cite RawControls.returnedReasoning precisely, list thinking: null in the changelog, name the conversation helper's merged assistant fields, drop an unused controls binding and a decode that remoteAndLocalInputs already performs.
OpenRouter's response-format-json-object and structured-output tests got 400 invalid_request: GLM's prompt policy refused every JSON response_format. GLM's native engine refuses sampler token constraints, so the Flint-style grammar is not available; GLM now follows the prompt-plus-withheld-validation contract Nemotron Super uses: - The service's response_format instruction renders through the shipped template; json_schema compiles to the shared fail-closed subset (compileResponseSchema now also requires explicit types, the check Flint already ran after it). - GLM JSON requests route reasoning through the native channel splitter, so reasoning streams while the answer is withheld until generation ends. The answer is extracted (fences and surrounding prose removed), decoded, checked (root object, or ToolConstraintValidation.satisfies) and exposed once; anything else is a content-free 422. - Withheld output records its generation time on the usage signal, so the relay's pre-content deadline and TTFT anchor see the first generated token, as they already do for withheld Flint reasoning. - JSON with tools, unsupported schemas and JSON with image or video input stay 400s. No constraint is installed, so these rows keep MTP.
…st-validation
OpenRouter's tool-choice-required and tool-choice-function tests got 400
from the coordinator ("inference-enforced tool_choice (required/named) is
not supported for model glm-5.3-flash"): no provider listed GLM under
tool-constraint protocol v1, and the provider itself refused forced
choice in GLM's prompt policy and in ToolChoiceEnforcementPolicy.
GLM's native engine refuses sampler constraints, so forced choice uses
the structured post-validation strategy Qwen 3.5/3.8 and Nemotron use:
- ToolChoicePromptPolicy's forcing instruction renders through the
shipped template; a named choice offers only the selected function.
- Forced GLM rows split reasoning on the native typed channel (as JSON
mode does) and the native GLM parser withholds the call until end of
stream; ToolConstraintValidation must accept it (function, schema,
cardinality) before it is exposed. Visible text or a missing,
malformed, truncated or schema-invalid call is a 422
tool_noncompliance with nothing exposed.
- The forced strategy requires the native GLM parser.
- Providers advertise the managed GLM identities (glm-5.3-flash and the
local qualification download) under tool-constraint protocol v1, so
the coordinator's existing capability gate routes these requests to
them without a coordinator change.
- Image or video input with a forced choice is refused with 400 before
any media work, as JSON mode is. No constraint is installed, so these
rows keep MTP.
…lm-constrained-decoding
GLM5NextManagedLoad now wraps the loaded tokenizer in GLM5NextThinkingTokenizer, which requires <think> and </think>. The synthetic managed fixture never gained them, so every opt-in DARKBLOOM_TEST_GLM5_MANAGED_SYNTHETIC suite that loads it failed with "tokenizer lacks the <think> tokens" before building an engine. CI does not run these suites, so the drift went unnoticed. ordinaryFactoryRunsTextHTTPImageAndProtectedEmbeddedMTP passes again on an M3 Ultra (17 s).
GLM-5.3-Flash and MiMo V2.6 serve from native-tracked CBv2 engines. EngineV2.validateRequest refuses a topLogprobs row or a token constraint on them with an SDK-internal error, which the bridge reported as "engine_v2 submit failed": a 500 generation_failure. The coordinator counts 500s as provider sickness, so two logprobs requests cooled every GLM provider for five minutes and its requests without tools were shed as 429 "no provider for model ... is available right now", the failure OpenRouter's top-logprobs test recorded. EngineV2Bridge.nativeOutputControlRefusal refuses those requests first, before any service or KV reservation, as the new MultiModelBatchSchedulerEngineError.unsupportedOutputControl: 400 invalid_request with reason client_error, which never strikes the breaker. The non-throwing submit path carries the same marker in-band. GLM5NextLogprobsTests submits logprobs to the protected native GLM bridge built from the synthetic managed fixture: 500 generation_failure before, typed 400 after, and the engine keeps serving.
…) into feat/glm-constrained-decoding
Load admission, KV budgets, cold-load capacity and the doctor/status "usable now" figure all read SystemMemory.availableBytes, which counted Mach free + inactive pages. Active file-backed pages counted as used, so on an M5 Ultra whose page cache held the just-downloaded and re-hashed GLM weights (vm_stat free 2.4 GB, active 55.7 GB, inactive 208.7 GB) the provider reported 170.8 GB usable and refused GLM-5.3-Flash's 185.4 GB cold load until `sudo purge`. The default `reclaimable` policy now counts free pages plus the file-backed page cache (external_page_count) and volatile purgeable pages. Speculative read-ahead pages sit inside both free_count and external_page_count and are counted once. Anonymous pages, active or inactive, and compressor pages are never counted. `free-only` is unchanged. Tests reproduce host #1's counters (171.0 GiB usable before, refused; 211.5 GiB after, admitted) and keep anonymous and compressed pressure refused.
The reclaimable policy now takes the larger of the former free + inactive measure and the page-cache measure (free − speculative + file-backed + purgeable). The page-cache measure alone gave less on a shared Mac with much inactive anonymous memory: on an M3 Ultra running other builds, doctor reported 77.6 GB usable where the former measure gave 93.0 GB. Taking the maximum keeps that case unchanged while active page cache still never blocks a load (host #1: 171.0 GiB -> 211.5 GiB). The page-cache measure itself still counts no anonymous or compressed memory; tests assert it separately, that the combined figure is exactly the larger measure, and the busy shared-Mac sample.
…ut-control refusal #1561 now refuses logprobs and token constraints on native-tracked engines before submit (EngineV2Bridge.nativeOutputControlRefusal), and GLM's protected engine is native-tracked. GLM JSON mode and forced tool_choice are prompt-steered and validated after generation, so they must reach that engine with neither. The capability tests now record every submission the scheduler makes and evaluate the production refusal on it as GLM's native-tracked engine: each served JSON and forced request carries no token constraint and no logprobs, so it is admitted. A logprobs row threaded the way the coordinator handler threads it is refused, so the check is not vacuous.
OpenRouter tests every capability on our Super endpoint (tools, all tool_choice modes, json_object, strict json_schema, reasoning on and off). Replaying each test shape, derived from the captured OpenRouter tool request, through the owner's relay path (inbound decode, native controls, response format preparation, request plan, pinned template, output parser) admits all of them except a JSON response format combined with tools: the request plan refused that pair with 400 (unsupportedControl). Serve it. The plan no longer refuses the pair, and the output validates the format only for an answer: a turn that calls tools returns its calls, with any text unchanged, and an answer without calls must be JSON for the format (422 otherwise). A required or named tool_choice still needs its call. NemotronSuperOpenRouterCapabilityTests replays all 20 shapes (10 tests, reasoning enabled and disabled) and validates a compliant response for each, streamed and complete; the captured request's SHA-256 is pinned to the platform conformance fixture. The live HTTP test now serves both a call and a JSON answer for a JSON format with tools, and refuses prose with 422.
GLM aligns the reasoning OpenRouter returns on earlier assistant turns (`reasoning`, `reasoning_details`) with the decoded messages by index. For a JSON response_format, MLXOpenAIService first inserts its instruction turn after the leading system turns, so the counts differed by one and the capture was dropped: those turns rendered an empty thinking block in every JSON-mode multi-turn request. The alignment now skips that inserted turn, at the position the service inserts it (`OpenAIResponseFormatSupport.preparedRequest`). The capability tests serve a JSON-mode conversation through the service, with and without a leading system turn: returned `reasoning` and `reasoning_details` render byte for byte like `reasoning_content`.
Pin mlx-swift-lm to baca4acf (#340 head plus "capture logprobs on GLM5-Next native engines"): the GLM page-bank contract now qualifies logprob capture, and EngineV2.acceptsLogprobRows reports it. EngineV2Bridge.nativeOutputControlRefusal keeps the typed 400 for a native engine that does not capture logprobs (MiMo) and for token constraints on any native engine, and lets GLM logprob rows through to the engine. On the coordinator relay the existing channel and SSE splice return them as OpenAI logprobs.content entries. A GLM logprob row samples through the ordinary sampler and never drafts. GLM has no request-scoped target-only fallback, so steps that include it decode target-only, as they do beside a GLM image row; output stays exact and other rows speculate again once it finishes. GLM5NextLogprobsTests now asserts served logprobs on the protected native bridge built from the synthetic managed fixture: one entry per generated token with the requested alternatives, descending, chosen token first under greedy decoding, no drafts for the logprob row, and a later plain request that still speculates.
The non-throwing submitTokenized wrapper re-yields two typed refusals as their content-free in-band markers: tokenBudgetExhausted (capacity) and unsupportedOutputControl (a native engine's refused logprobs row or token constraint). Both had identical catch bodies; fold them into one multi-pattern catch. Both throws already finalized their prefix-cache lookup, and fromSchedulerMessage maps each marker back to the same typed error, so the 400 invalid_request (client_error) and capacity outcomes are unchanged.
…mat with tools) into the consolidated Super PR
The merged logprobs support (f02327a) gave EngineV2Bridge.nativeOutputControlRefusal a capturesLogprobs argument and made GLM's native engine serve logprob rows. The capability tests still called the three-argument form, so the provider test products did not build, and their control asserted that GLM refuses a logprobs row. The scripted engine now evaluates the check for a given capture capability. Each served response keeps GLM's decision (captures logprobs) in nativeRefusals, which every JSON and forced row still asserts is nil, and adds the decision of a native engine that cannot capture logprobs (MiMo). The control, now nativeEngineEvidenceAdmitsGLMLogprobsButRefusesNonCapturingEngines, asserts GLM admits the logprobs row and the non-capturing engine refuses it with the output-control prefix, so the evidence stays non-vacuous.
…182 GB A GLM-5.3-Flash coordinator start read all 182 GB five times: the startup registration hash, a pre-load WeightHasher pass, the native loader's SHA-256 of every core file, the tensor reads and a post-load WeightHasher pass (M5 Ultra: 25 s per hash pass, about 150 s to warm). Standalone starts did four of them (141 s to listen on the M5). The managed load already SHA-256-verifies every manifest file against the catalog-pinned manifest before serving: core files in the native reader before any header is parsed or payload read, the rest in verifyAuxiliaryContents before the tokenizer loads, with file identities rechecked through construction. It now records that result (GLM5NextManagedLoad.verifiedArtifactSHA256, the manifest aggregate, which is the value WeightHasher reports for those files) and both ProviderLoop and StandaloneServer publish it instead of bracketing the load with two more full passes. Integrity before serving is unchanged; the dropped post-load pass only re-read disk, never the loaded bytes, and any modification through the file system changes ctime, which the load's identity checks refuse. Coordinator-mode startup registration now reuses the last fully verified hash of a managed-load model while every hashed file keeps its device, inode, size and modification and status-change times (VerifiedWeightHashStore, ~/.darkbloom/verified-weights.json, 0600). The load verifies again before serving, so a stale or edited record can misstate the registration claim but cannot serve unverified bytes. Any changed file is hashed in full and re-recorded. The load logs its phases (auxiliary verification, core verification, tensors and construction). scripts/benchmarks/glm_load_timeline.py turns a provider log into a timeline. The synthetic GLM fixtures gain the <think>/</think> tokens the serving tokenizer has required since #1516, so the gated managed and provider-loop suites run again.
…logprobs refactor pass
Refactor pass for GLM JSON mode, structured outputs and forced tool_choice. Behavior is unchanged. - GLM5NextPromptPolicy.withholdsOutput names the requests whose output GLM withholds until it validates: a JSON response_format or a required/named call. The scheduler's media refusal and its text-path channel split and withheld-output recording each spelled that set separately; both now read the one predicate, so they cannot drift. - The JSON-mode returned-reasoning alignment names its index (instructionIndex) and says why it is the last leading system turn. - docs/developer/test.md describes the capability tests' current control: GLM admits a logprobs row that the same output-control check refuses for a native engine without logprobs capture.
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 27 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); OpenRouter compatibility: GLM-5.3-Flash and MiMo-V2.6-Flash requests no longer refused (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx-swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift-lm#362), #1594); Provider diagnostics: refusal reasons and load memory (#1592, #1603); MLX stack (#1596); Desktop release workflow (#1580). Apply 12 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed.
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 27 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); OpenRouter compatibility: GLM-5.3-Flash and MiMo-V2.6-Flash requests no longer refused (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx-swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift-lm#362), #1594); Provider diagnostics: refusal reasons and load memory (#1592, #1603); MLX stack (#1596); Desktop release workflow (#1580). Apply 14 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed.
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 20 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); GLM-5.3-Flash OpenRouter request controls (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx- swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift- lm#362), #1594); Provider diagnostics (#1592); MLX stack (#1596); Desktop release workflow (#1580). Apply 12 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed. Co-authored-by: Jonathan Spangler <5055076+jonathan308@users.noreply.github.com>
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Human review required: CI did not complete the security review. A maintainer must review the saved findings and remaining scope. A green advisory job is not security clearance; do not manually rerun the paid scan. Failure diagnostics: Coverage: 42/218 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. Bedrock: 12 request(s), 551360 uncached + 0 cache-read + 0 cache-write input / 9492 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately. |
…ot diagnostics branch The tree is this branch's head (82a5de2: #1603 plus the squash of #1600's release preparation) plus exactly #1599's changes. A plain merge from the pre-#1592 merge base would have re-added the 27 changelog fragments that the release preparation folded into CHANGELOG.md, because master's squash adds them; this commit keeps them folded. #1599's own fragment (landing-agent-documents.md) stays pending for the next release.
This PR now completes provider 0.10.2
|
…ation Merges Layr-Labs/d-inference master f9d1af3 (#1603, "Provider 0.10.2: prepare release"), 32 commits past the merge base b004e23, into #1407 030fa64. 67 files changed on both sides: 29 conflicted, 38 auto-merged and reviewed. Gitlinks keep the cluster values (libs/mlx 79d2ebe8, libs/mlx-swift 59ff16af, libs/mlx-swift-lm 84112479) for the coordinator to re-pin to the merged native stack and SDK. Master's code, and the follow-up commit, need the merged SDK (master's 2026-10-22 SDK API changes). Conflicts: - GLM prompt and tool policy: master serves reasoning exclusion, required/named tool_choice and validated JSON output on every GLM slot, and removed reasoningExclusionUnsupported. Took master's GLM5NextPromptPolicy, NativeToolStreamRouter (withholdReasoning also counts the withheld reasoning) and ToolChoiceEnforcementPolicy. The cluster's pair-only gates are superseded and removed: admitsReasoningExclusion, glm5PairExcludesReasoning and the pair parameters of forcedStrategy and validateNativeControls (auto-merged callers in ToolStreamPreparation, ToolConstraintFactory and ProviderPromptContractPipeline follow). The pair keeps its single-call instruction for automatic choice with parallel_tool_calls false, folded into master's ToolChoicePromptPolicy.prepare before the GLM JSON contract is attached, so the rewrite cannot drop it. - Scheduler: master's refusal of withheld output with media comes before the cluster's pair media dispatch; the cluster's timed prompt preparation takes master's prompt-token cache scope (tokenizeMeasured gains the same branch as tokenize), so single-Mac keeps prompt-token reuse. - Local API: both logprob sources, master's raw-body owner channel and the cluster API's plumbing with reasoning-token counts. - Coordinator path: master's typed nativeControlsRefusal in both places. - ProviderLoop: cluster member guards first, then master's Autopilot model set, downloads and candidate verification (never on a member). - Package.swift: master's traits: [] on the SDK plus libs/darkbloom-cluster. - Registration, LaunchAgent, downloader, status, WeightHasher, translation markers, CLI subcommands, loop configuration: both sides. - changelog.d/glm53-native-prerequisites.md: master rendered it into v0.10.0 and deleted it; kept only the cluster's unreleased peer-status bullet. No other cluster fragment is in master's CHANGELOG.md. - Docs: both sides, later stamps; the Autopilot page states that a member downloads nothing. GLMPairForcedOutputTests follow the merged contract: exclusion validates and forced output takes the GLM strategy on every slot. A new case checks that only the pair adds the single-call instruction and that the JSON contract survives it. Tested with the following commit and the merged native stack checked out (mlx-swift 31cc0ce merge/56, core 95938c4b merge/35, mlx-c 8a50797b + main build-only, SDK 3feac5c7 merge/308): see the follow-up commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
When a model load is refused for memory, the refusal and
darkbloom statusnow say why resident memory could not be reclaimed. This PR only adds diagnostics. Autopilot policy, eviction, holds and load-gate decisions do not change.. Not evictable: <model> (<GB>: <reasons>). For example:Not evictable: glm-5.3-flash (171.3 GB: Autopilot hold until 2026-10-25T18:31:01Z; 1 request in flight; adopted by Autopilot outside the selected models).and all loaded models are actively serving, even though the model was idle. It now saysand no loaded model can be evicted, followed by the list.eviction_exclusions(each non-evictable model and why) and the liveserving_selection.darkbloom statusadds four lines:Serving outside the enabled model filter, with the reason the model serves;Autopilot placements, with each hold's expiry;Not evictable for a load now;Recorded <age> ago, under the last load error.darkbloom autopilot statusaddsAdopted (serving outside the selection)andHeld: <model> until <UTC> (<left>).Why
A provider operator saw this refusal for Nemotron 3.5 Super:
Insufficient memory (34.8 GB of LOAD room, need 83.6 GB) even after evicting every idle model (16.8 GB reclaimable) — refusing without evicting. At the time, GLM-5.3-Flash was resident and serving, although theirenabled_modelsfilter did not include it. Nothing on the machine said why GLM was serving or why it could not be evicted.The refusal only meant that GLM was not an eviction candidate at that moment. The gate (
evictableModelSlots) skips a resident model for any of six reasons and threw away which one applied:Reproduction: two causes, one status
UnreclaimableLoadMemoryTestsreproduces the refusal byte for byte under both hypotheses. It runs CPU-only, with the realProviderLoop, the real Autopilot command path and Super's real LOAD gate, on a scripted 256 GB machine with inert slots and no weights. The real CLI binary, run against the daemon state each scenario writes, reproduces the reporteddarkbloom status.lease_seconds = 0,hold_seconds = 3600, as the coordinator sends it) adopts GLM outside the selection and holds it. The lease clears, so the phase readswaiting, but GLM keeps serving.enabled_modelswas edited afterwards. A running daemon applies the filter only at its next start.Once the hold expires,
darkbloom statusis identical line for line under H1 and H2. While a hold is active, status showsCold load blocked (memory)instead of the reportedPreload skipped (no eviction), so the reported status rules out an active hold at that moment.darkbloom autopilot statustells the two apart:darkbloom autopilot statusLast transition: succeeded,Reason: coordinator placement,Target: glm-5.3-flash;--json:live.adopted_models: ["glm-5.3-flash"]Adopted (serving outside the selection): glm-5.3-flash, and while heldHeld: glm-5.3-flash until <UTC> (<left>)With this PR,
darkbloom statusnames the cause directly:Serving outside the enabled model filter: glm-5.3-flash (adopted by an Autopilot operation)Serving outside the enabled model filter: glm-5.3-flash (in the running daemon's selection; the saved filter applies after a restart)Before
Behavior
%%{init: {"flowchart": {"wrappingWidth": 400}}}%% flowchart LR classDef ctx fill:#f1f5f9,stroke:#64748b,color:#0f172a classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d V["filter: Super, Gemma<br/>resident: Gemma 16.8 GB,<br/>GLM 171.3 GB (outside the filter)"]:::ctx V -->|"Super load"| R["Insufficient memory … even after<br/>evicting every idle model …<br/>— refusing without evicting<br/>(no model named, no reason)"]:::bad V -->|"Super load, nothing evictable"| R2["Insufficient memory …<br/>and all loaded models<br/>are actively serving<br/>(false: GLM is held, not serving)"]:::bad V -->|"darkbloom status"| S["saved filter and warm models:<br/>nothing says why GLM serves"]:::bad V -->|"darkbloom autopilot status"| A["no adoption or hold lines"]:::badCode flow
%%{init: {"flowchart": {"wrappingWidth": 400}}}%% flowchart LR classDef code fill:#e0e7ff,stroke:#4f46e5,color:#1e1b4b classDef data fill:#fef3c7,stroke:#b45309,color:#451a03 classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d P["evictableModelSlots()<br/>inline filter, six predicates"]:::code P -->|"evictable or not"| G["slot cap, evictUntilAvailable,<br/>evictUntilNemotronSuperFits"]:::code G -->|"refuse"| T["fixed refusal text<br/>(the reason is dropped)"]:::bad D[("DaemonState<br/>warm, advertised,<br/>autopilot snapshot")]:::data --> C["status, autopilot status<br/>(saved filter, warm models)"]:::badAfter
Behavior
%%{init: {"flowchart": {"wrappingWidth": 400}}}%% flowchart LR classDef ctx fill:#f1f5f9,stroke:#64748b,color:#0f172a classDef good fill:#dcfce7,stroke:#15803d,color:#14532d V["filter: Super, Gemma<br/>resident: Gemma 16.8 GB,<br/>GLM 171.3 GB (outside the filter)"]:::ctx V -->|"Super load"| R["same text, then<br/>Not evictable: glm-5.3-flash (171.3 GB:<br/>Autopilot hold until …Z; 1 request<br/>in flight; adopted by Autopilot …)"]:::good V -->|"Super load, nothing evictable"| R2["Insufficient memory …<br/>and no loaded model can be evicted.<br/>Not evictable: glm-5.3-flash (…)"]:::good V -->|"darkbloom status"| S["Serving outside the enabled model filter<br/>Autopilot placements (hold expiry)<br/>Not evictable for a load now<br/>Last model-load error … Recorded … ago"]:::good V -->|"darkbloom autopilot status"| A["Adopted (serving outside the selection)<br/>Held: glm-5.3-flash until … (… left)"]:::goodCode flow
%%{init: {"flowchart": {"wrappingWidth": 400}}}%% flowchart LR classDef code fill:#e0e7ff,stroke:#4f46e5,color:#1e1b4b classDef new fill:#cffafe,stroke:#0e7490,color:#083344 classDef data fill:#fef3c7,stroke:#b45309,color:#451a03 classDef good fill:#dcfce7,stroke:#15803d,color:#14532d X["evictionExclusions()<br/>model → reasons<br/>(same six predicates)"]:::new X --> P["evictableModelSlots()<br/>residents without an entry"]:::code P --> G["slot cap, evictUntilAvailable,<br/>evictUntilNemotronSuperFits<br/>(decisions unchanged)"]:::code X --> Rec["evictionExclusionRecords()<br/>EvictionExclusion.summary"]:::new G -->|"refuse"| T["refusal text<br/>+ Not evictable: …"]:::good Rec --> T Rec --> D[("DaemonState<br/>+ eviction_exclusions<br/>+ serving_selection")]:::data D --> C["StatusCommand+Residency,<br/>AutopilotStatusCommand"]:::goodColors: grey = situation, indigo = existing code, cyan = new code, amber = daemon state, red = missing or false output, green = new operator-visible output. A refusal and a
darkbloom statusline come from the same renderer (DaemonState.EvictionExclusion.summary), so they cannot drift apart.Exact messages from the reproduction (real refusals and real CLI output)
Interface effects
Refusal text:
loadErrorStatusCodeis unaffected:.modelLoadFailedstill maps to 503, and the slot refusal still matchesslot.evictUntilAvailable,evictUntilNemotronSuperFits) of loads that may evict, and only when a resident model was excluded.Coordinator: nothing new reaches it. Routed requests carry only the failure code and status (
loadInferenceFailure), and failedload_modelpushes carry no reason (see follow-up 3).Daemon state (
daemon-state.json): two optional, additive keys.serving_selectioneviction_exclusions, withmodel,resident_gb,reasons,hold_expires_at_ms,requests_in_flightandadopted_by_autopilot.Older files still decode. Only the CLI and the tests read these keys.
No changes to: protocol, heartbeat, telemetry, Autopilot policy, eviction or holds.
Docs:
model-autopilot.md,hardware-support.md,inference.md,cli-reference.md,troubleshooting.md.Changelog:
changelog.d/explain-unreclaimable-load-memory.md.Validation
Setup. All runs are CPU-only control-plane tests. Each run used a temporary
CFFIXED_USER_HOME,HOME,DARKBLOOM_STATE_FILE, loaded-models file and verified-weights file. The sha256 of~/.darkbloom/usage-history.jsonand of every top-level file in~/.darkbloomwas unchanged before and after every run.What "before" means. "Before" is #1592's code at
e72d1e2c2with this PR's tests applied, rebuilt withprovider-swift/Sourcesrestored toe72d1e2c2. The counts match the original fail-before run onmaster(6e7382332). "After" is this PR's head,f0a66f72e, which is #159286d16da06plus this PR. The focused and CLI status runs below were repeated after each merge of #1592: on6de3cb640,3d42ff4a6,c1e70fb81, and on a tree identical tof0a66f72e.CI fix (
3d42ff4a6, test-only). The first CI run (6de3cb640) failed 8 of these tests in Provider Unit Tests. Each was a test that runs the admin Autopilot operation, and the operation returnedstatus: failed(InferenceError.modelLoadFailed).reserveRaiseKeepsSurvivorsServiceable→fleetKVBudgetBytes) reads machine memory from the engine slot hooks, or fromProcessInfo.physicalMemoryif no hooks are installed. The fixture scripts a 256 GB machine but installed no hooks, so the suites passed only on a 256 GB Mac.hw.memsizeas 24 GiB to the test process (asysctlbynameinterposer) reproduces CI exactly: the same 8 tests fail with the same 25 issues. With the fix, the focused tests pass 53/53 at 8, 16, 24 and 64 GiB and on the real 256 GiB. CI on3d42ff4a6was fully green.UnreclaimableLoadMemoryTests(H1/H2 reproduction)UnevictableResidentReportTestsModelLoadEvictionAndAdmissionTests,ModelLoadRefusalTests(two exact-message assertions updated)StatusResidencyTestsStatusCommandTests,StatusCommandRunTests:up 10m,up 1h1m)Broader regression on
6de3cb640(3d42ff4a6changes only these two suites' fixture):MIMO_V26_SERIAL_LOAD_FIXTURESfixture environment, which is unset here, and fail atXCTUnwrapthe same way onmaster.ModelsLocationCommandTests.missingEnvironmentImportRefusesWithoutMutation, which picks<temp HOME>/hubunder the test harness and fails the same way on the code before the refactor pass.Limitations
make provider-test.AutopilotTinyModelTests), which was not run.darkbloom autopilot status, start banner or the coordinator's operation records would decide it.3d42ff4a6. The pass below covers the code through96e4e62f1. The later test-only fixture fix was not re-reviewed by a refactor subagent.Merge order
Merge after #1592; then #1600 (release) is restacked on this PR.
Refactor pass
Refactor pass: CHANGED (
96e4e62f1, independent refactor subagent, behavior-preserving).Status.compactDurationnow delegates to the sharedDurationFormatting.compact(identical output on 800,019 inputs). The docs and changelog now say exactly which refusals carryNot evictable:: slot-cap and eviction-gate refusals of loads that may evict, listing only the models excluded from eviction. No change to refusal text, daemon-state JSON, Autopilot policy or tests. Focused provider tests 53/53; CLI 687/688, the one failure a temp-HOMEModelsLocationCommandTestscase that fails the same way on the pre-refactor code.docs-check,docs-impact-check(origin/master) andchangelog-checkpass.Proposed follow-ups (not in this PR)
runStartupPreloadGate()runs once per process. A model skipped for memory at start stays unloaded until a request or a restart loads it.enabled_modelsedits. A running daemon re-reads only Autopilot policy and download settings, so a changed filter waits for a restart. Status now says so.InferenceErrorhas noLocalizedError, so a failedload_modelreportsThe operation couldn’t be completed. (ProviderCore.InferenceError error 0.). Coordinate with the platform's load-failure classifier first.Commits
All are SSH-signed and show as Verified on GitHub.
6e7382332UnevictableResidentReportTests,StatusResidencyTests, and two updated exact-message assertions8aa42b96f96e4e62f180b75f4fdfe4f353db(only conflict:troubleshooting.md's freshness stamp; kept2026-10-25)6de3cb640e72d1e2c2(prompt-refusal logging;inference.mdandcli-reference.mdauto-merged with both sides kept)3d42ff4a6c1e70fb81d8e78e204(GLM request-shape fixes;inference.mdandcli-reference.mdauto-merged with both sides kept)f0a66f72e86d16da06(MiMo tool-result name fix;inference.mdauto-merged with both sides kept)