Skip to content

server: /v1/models lists each model's input_types; a video it can't take is a 400, not a 500 (#3004) - #3019

Merged
ashhart merged 3 commits into
mainfrom
lead/models-input-types
Nov 14, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/models-input-types

Conversation

@ashhart

@ashhart ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #3004, in the shape @WebReflection proposed (credited as co-author).

What changes

  • Each /v1/models entry ends with input_types: ["text"], plus "image" with --vision, plus "video" when the checkpoint reads video and the server loads libtfvideo. Every other key keeps its bytes and order.
  • A video_url part sent to a model without video now gets HTTP 400 (invalid_request_error) instead of a 500 (server/videos.zig).
  • Both answers come from one value decided at startup (server/input_types.zig, published by srv.media()), so the listing and the refusals can't disagree. No new option.
  • One behaviour change: a server whose model reads video now loads libtfvideo at startup (through the same loader every video uses) instead of at the first video, and says once in its log when it is missing. Without it, the refusal is the plain "no video" message every model without video gets.
  • docs/api.md documents input_types; docs/vision.md says when libtfvideo loads.

Tests

  • test-model-discovery-host 36/36: the three input_types arrays, and the video refusal as a 400.

  • On main the new tests fail: missing key ("expected 6, found 5"), a null input_types, and "expected 400, found 500".

  • test-model-idle-host 72/72, test-model-capabilities-host 36/36, test-media-request-ownership-host 83/83 + 58/58, test-server-cpu 1,328 pass, 7 skipped.

  • test-golden: 0 unexpected differences. The 17 changed goldens each differ from main only by the inserted input_types key (and their Content-Length), checked mechanically.

  • zig fmt clean; lean 0 new.

  • Synthena (Ash's Agent)

ashhart and others added 3 commits November 14, 2026 10:01
…ake is a 400

A client could not tell from /v1/models whether a model takes image or
video parts, and a video_url part sent to a server whose model reads video
but which has no libtfvideo (GLM-5.3-Flash with the default image) ended in
HTTP 500 at the first video (#3004).

Each model entry now ends with "input_types": ["text"], plus "image" with
--vision, plus "video" when the checkpoint offers video and libtfvideo
loads. The keys before it keep their order and bytes. There is no new
option: the server decides it once at startup (input_types.zig), loading
libtfvideo with the loader every video uses, which keeps its answer, and
only when the model offers video. Server.media() takes its image and video
flags from the same Inputs, so every request route (chat, completions,
responses, messages, tokenize) refuses a video_url part on a server that
does not list "video" with the 400 an unsupported part gets
(invalid_request_error). The startup log names the missing library once.
If libtfvideo still fails at a video, that is now a 400 naming the library
instead of a 500.

The 17 server goldens holding a /v1/models reply gain the key on each
entry (the fake engine is text only) and 25 bytes of Content-Length per
entry, and nothing else. New tests in models_input_types_test.zig cover
the listing (text, image, image and video, and video without the library),
the 400 for both kinds of model without video, and the library refusal.
docs/api.md describes the key; docs/vision.md says when libtfvideo loads.

Co-authored-by: WebReflection <[email protected]>
@ashhart
ashhart force-pushed the lead/models-input-types branch from eab1e7e to b083373 Compare November 14, 2026 10:56
@ashhart
ashhart merged commit 4ddc28c into main Nov 14, 2026
11 of 19 checks passed
@ashhart
ashhart deleted the lead/models-input-types branch November 14, 2026 10:56
@ashhart

ashhart commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Thank you @WebReflection. This is merged into main with your commits under your own name, so you're credited as a TensorFold contributor.

ashhart added a commit to akol1/TensorFold that referenced this pull request Nov 14, 2026
ashhart added a commit to akol1/TensorFold that referenced this pull request Nov 17, 2026
kinetick-labs added a commit to kinetick-labs/TensorFold that referenced this pull request Nov 20, 2026
…per lists image and video input

- engine_capabilities.zig: media joins the Capability enum (upstream checks every Info boolean is one)
- status_routes.zig: /v1/models' input_types (upstream ashhart#3019) lists image and video when --vision-helper serves them
- models_input_types_test.zig: its undefined Server fixture sets vision_helper to null
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.

/v1/models: no input-modality discovery — clients can't tell whether a model accepts image/video parts

1 participant