Skip to content

Bind captured logprobs to ordered provider events - #1573

Closed
jonathan308 wants to merge 2 commits into
fix/cluster-qwen27-vision-residencyfrom
fix/cluster-event-bound-logprobs
Closed

jonathan308 wants to merge 2 commits into
fix/cluster-qwen27-vision-residencyfrom
fix/cluster-event-bound-logprobs

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

When a model produces tokens faster than HTTP consumes them, the separate logprob drain can attach future-token metadata to an earlier content frame. Carry captured metadata through the same ordered events as text, and let the canonical SDK chat encoder build both JSON and SSE responses. The provider's local and coordinator relays preserve that frame without injecting a second metadata payload.

This draft follows #1572 and pins mlx-swift-lm #350. The bridge emits metadata before its text, the scheduler applies the requested alternative limit, and metadata events do not count as warmup content. Exhaustive consumers explicitly handle or ignore the additive event case. Native arithmetic and capture capability gates are unchanged.

Before

flowchart TD
  E["EngineV2Bridge produces tokens"] --> T["Text events"]
  E --> Q["Shared metadata drain"]
  T --> C["Canonical chat frame"]
  Q --> D["Relay decorates later"]
  C --> D
  D --> R["Future metadata can reach earlier content"]
  classDef normal fill:#e8f1ff,stroke:#3366aa,color:#172b4d;
  classDef problem fill:#ffe5e5,stroke:#b42318,color:#5a1414;
  class E,T,Q,C normal;
  class D,R problem;
Loading

After

flowchart TD
  E["EngineV2Bridge produces tokens"] --> S["Ordered metadata then text"]
  S --> L["Scheduler applies request limit"]
  L --> C["SDK encodes consumed metadata with content"]
  C --> H["Local HTTP preserves frame"]
  C --> R["Coordinator relay preserves frame"]
  classDef normal fill:#e8f1ff,stroke:#3366aa,color:#172b4d;
  classDef fixed fill:#dcfce7,stroke:#27834a,color:#14532d;
  class E,S,L,C normal;
  class H,R fixed;
Loading

Validation: actual Common 362-source, Server 35-source and ProviderCore 875-source modules and whole-module objects compile. The focused executable passes 26 tests in six suites across ten final repeats, including all seven strict multi-token HTTP parity families, actual bridge ordering and warmup counting, request plumbing, parser holdback/flush, cancellation/error, terminal capture and pending bounds. Root documentation lint, impact checks and changelog check/preview pass. All production postimages match the reviewed snapshot; three documentation files preserve newer parent additions.

Independent correctness/refactor review is clear after repairing warmup counting and stale comments; all 59 provider/SDK files and 72 evidence hashes were checked. The removed side channel reduces duplicate ownership. No broader cleanup was warranted.

Limits: fabricated capable engines establish HTTP wiring, not live native capture. Unsupported native modes still reject logprobs. The existing 4096-entry pending bound and next-visible-content policy for unclassified reasoning/tool spans remain; trailing metadata without visible content is omitted from SSE. Full-package CI and Qwen full-artifact tensor validation remain open.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 23, 2026 4:12pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 23, 2026 4:12pm UTC
d-inference-landing Ready Ready Preview Oct 23, 2026 4:12pm UTC
darkbloom-status Ready Ready Preview Oct 23, 2026 4:12pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 23, 2026 4:12pm UTC

Request Review

This branch was successfully deployed

5 active deployments
Preview – d-inference — 7d5573cd Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 7d5573cd Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference-landing — 7d5573cd Deployed Oct 23, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 7d5573cd Deployed Oct 23, 2026 by vercel[bot]
Preview – darkbloom-status — 7d5573cd Deployed Oct 23, 2026 by vercel[bot]
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