fix(provider): v0.7.1 — engine_v2 allowlist uses fleet catalog ids (drop HF repo ids)#504
Conversation
…pt-oss-20b, gemma-4-26b-8bit, gemma-4-26b-qat-4bit), drop HF repo ids v0.7.0 gated Engine V2 on HuggingFace repo ids (mlx-community/...) that no production provider advertises — the fleet uses coordinator-catalog ids, so v2 never engaged and every box silently ran the legacy engine (confirmed against the prod provider registry). Allowlist now matches the real fleet ids; QAT-4bit included (validated: strict batch-invariance + faster).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR contains only a version bump, a doc-comment clarification, and an engine-v2 model allowlist update; no security controls are added, removed, or structurally altered, but the allowlist change deserves one targeted look against T-007/T-012. Trust boundaries touched
Per-threat assessment
One item worth a second look (not a blocking finding)
The matching rule tries both the full supplied This matters for T-007/T-027 only if the coordinator's model catalog also validates the org prefix when a provider advertises a model ID; if catalog admission is purely on the short ID, there is no regression here. Recommend confirming that
New attack surface not covered by an existing threatNone introduced by this diff. SEC-* findings resolvedNone — this PR does not close any open finding. 🔐 Threat model: |
ethenotethan
left a comment
There was a problem hiding this comment.
Automated Code Review — Layr-Labs/d-inference#
Verdict: COMMENT
Security — ✅ No issues found
Performance — ✅ No issues found
Type_diligence — ✅ No issues found
Additive_complexity — ✅ No issues found
✅ All four passes clean. No issues found.
🤖 Automated review by Centaur · DAR-186
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fc36793e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "mlx-community/gemma-4-26b-a4b-it-8bit", | ||
| "gpt-oss-20b", | ||
| "gemma-4-26b-8bit", | ||
| "gemma-4-26b-qat-4bit", |
There was a problem hiding this comment.
Remove the VLM build from the v2 allowlist
For gemma-4-26b-qat-4bit in production, this allowlist entry is never honored: the load path computes slotIsVLM (ProviderLoop+ModelLoading.swift:330) and makeEngineV2BridgeForSlot returns nil for VLM slots before calling EngineV2Config.selection (ProviderLoop+EngineV2.swift:83-89). The live test comments identify the prod QAT build as shipping vision_config, so v0.7.1 still serves that model through the legacy engine while the new default allowlist and rollout messaging imply v2 coverage; either don't advertise QAT as default-v2 or update the VLM/CBv2 path so it can actually build a bridge.
Useful? React with 👍 / 👎.
fix(provider): v0.7.1 — engine_v2 allowlist uses fleet catalog ids
Root cause
v0.7.0 shipped Engine V2 (ContinuousBatchingV2) default-on, but gated
behind a per-model allowlist whose entries were HuggingFace repo ids:
The production fleet does not advertise those ids. Verified against the prod
DB, online providers advertise the coordinator-catalog model ids:
gpt-oss-20bgemma-4-26b-8bitgemma-4-26b-qat-4bitEngineV2Config.modelAllowlistedmatches case-insensitively on the full idand the last
/path component, on both sides. The catalog ids and the HFrepo ids share no matching component (e.g. last component
gpt-oss-20b-mxfp4-q8≠gpt-oss-20b), soselection()returned.legacyfor every real model — Engine V2 never engaged anywhere. The whole fleet
silently ran the legacy
BatchedEngine, exactly as if v2 had never shipped.Fix
Replace the allowlist with the three coordinator-catalog ids the fleet
actually advertises, and drop the HF repo ids entirely:
All three were parity/soak-validated on real weights:
gpt-oss-20bandgemma-4-26b-8bitare the two 8-bit / GPT-OSS production models;gemma-4-26b-qat-4bitpassed strict batch-invariance and benchmarked faster.Doc comments in
EngineV2Config.swift(and theengine_v2config-key doc inProviderConfig.swift) are re-framed: these are coordinator-catalog / fleetmodel ids, not HuggingFace repo ids. Matching semantics are unchanged
(case-insensitive; exact or trailing-
*prefix glob; full id and last pathcomponent tried on both sides).
Version bumped to 0.7.1 (
ProviderCore.version, coordinatorLatestProviderVersion).Kill switch / rollback
Unchanged and still absolute:
DARKBLOOM_ENGINE_V2=0(orfalse/no/off)forces legacy for that provider, beats config, no release needed.
DARKBLOOM_ENGINE_V2_MODELS="gpt-oss*,gemma-4*"(comma-separated exact ids or trailing-
*globs) overrides the default.already falls back to legacy with a WARN
engine_v2_fallbacktelemetry event(model id + reason), so a bad engine can never take a box down silently.
Before / After
flowchart TB subgraph Before["Before (v0.7.0) — v2 inert fleet-wide"] A1[request: model gpt-oss-20b] --> B1[provider: EngineV2Config.selection] B1 --> C1{"allowlist =\nmlx-community/gpt-oss-20b-MXFP4-Q8,\nmlx-community/gemma-4-26b-a4b-it-8bit"} C1 -->|"no id/last-component match"| D1[selection = .legacy] D1 --> E1[legacy BatchedEngine] end subgraph After["After (v0.7.1) — v2 engages on prod models"] A2[request: model gpt-oss-20b] --> B2[provider: EngineV2Config.selection] B2 --> C2{"allowlist =\ngpt-oss-20b,\ngemma-4-26b-8bit,\ngemma-4-26b-qat-4bit"} C2 -->|"exact match"| D2[selection = .v2] D2 --> F2[EngineV2Factory.makeBridgeIfSelected] F2 -->|builds| G2[EngineV2Bridge / CBv2 engine] F2 -->|init throws| H2[legacy fallback + WARN engine_v2_fallback] C2 -->|"non-allowlisted (e.g. qwen3-8b)"| D2b[selection = .legacy] D2b --> E2[legacy BatchedEngine] endTests
EngineV2BridgeTests.swift:defaultAllowlist()rewritten: positives nowgpt-oss-20b,gemma-4-26b-8bit,gemma-4-26b-qat-4bit+ a case-insensitive variant; theold HF repo ids are asserted rejected (the exact v0.7.0 miss), plus
qwen3-8b,llama-3.3-70b,"", and a different gemma quant(
gemma-4-27b-it-4bit).selectionMatrix(),factoryInitFailureFallsBack(),factorySelectedBuilds()updated to use the real fleet ids as their allowlisted examples so they still
exercise the
.v2path.EngineV2ProductionWiringTests.swift:initFailureFallsBackWithTelemetry()used the old HF id under the defaultallowlist to reach the makeEngine throw. Under the new allowlist that id
gates out to legacy before makeEngine, so it was switched to
gpt-oss-20b—otherwise the fallback-telemetry assertion would silently stop being
exercised.
swift test --filter EngineV2is green;go build ./...compiles.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.