Skip to content

server: expose effective context in model discovery - #483

Merged
ashhart merged 1 commit into
ashhart:zig-flashnextfrom
akol1:codex/model-context-metadata
Oct 9, 2026
Merged

ashhart merged 1 commit into
ashhart:zig-flashnextfrom
akol1:codex/model-context-metadata

Conversation

@akol1

@akol1 akol1 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Model-catalog clients currently cannot discover the configured context through /v1/models. Report equal context_length and max_model_len extensions from the loaded engine's effective prompt-plus-reply limit for every served name and alias. An unspecified window omits both fields. The default reply limit is never substituted for context capacity.

Related to #480 on the maintained native branch; the frozen Python implementation is unchanged.

The patch documents the contract, tests fitted contexts, aliases, unspecified capacity and the full u32 range, and updates only the affected model-list golden bodies and HTTP lengths.

Validation on the pinned Zig 0.17.0:

  • Regression reproduced over HTTP against the unchanged fake engine: configured 8192-token capacity was absent. The candidate reports 8192 for both names and omits the fields for an unspecified window.
  • Direct server/API host suites: 62 + 22 tests passed.
  • zig build test-golden -Dcpu=apple_m1: 312/319 equal, seven existing known differences, zero unexpected differences.
  • Lean checker: 513 inherited findings before and after; zero new findings. Formatting and diff checks pass.
  • Combined with the independent memory/benchmark contributions: clean merge, 68 + 22 host tests, 17 benchmark tests, route/auth HTTP checks and the same golden result.

The full test test-golden baseline is blocked by the unavailable Xcode Metal compiler. The golden harness emits inherited allocator-leak diagnostics on both baseline and candidate. No checkpoint/device performance qualification is claimed; no model-serving configuration or GPU computation changes. This draft makes those validation limits explicit for review.

Publication review covered the full tracked tree, changed fixtures and outgoing commit identity. No private operator identifiers, paths, credentials, prompts, model weights or runtime logs are included.

@akol1
akol1 marked this pull request as ready for review October 7, 2026 16:00
grearjake-star added a commit to grearjake-star/TensorFold that referenced this pull request Oct 8, 2026
…ngth, max_model_len)

/v1/models carried only ids, so model-catalog clients (magpie, Codex's context indicator and others)
could not discover the window the server admits, although /health already reports it. Each entry, for
the served name and every alias, now carries context_length and vLLM's max_model_len, both equal to
the app's effective prompt-plus-reply window; a window the engine does not know omits both fields
rather than guessing, and the reply limit is never substituted for it.

Upstream: requested in ashhart#480 (reported on a DGX Spark); the maintained-branch design
is akol1's ashhart#483 for the Zig server. Written fresh for the Python CUDA server.
Credit: nullburn (the report), akol1 (the contract this follows).
@ashhart
ashhart merged commit b6fd8e2 into ashhart:zig-flashnext Oct 9, 2026
@ashhart

ashhart commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Thanks @akol1 for effective context in model discovery. The local integration passed the all-target build, host/native/golden tests and three-platform host builds, with no additional lean findings. We retained your original commits and kept our integration changes separate.

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.

2 participants