Skip to content

server : expose model architecture (modalities) in /v1/models#22709

Draft
julien-c wants to merge 1 commit intoggml-org:masterfrom
julien-c:server-models-modalities
Draft

server : expose model architecture (modalities) in /v1/models#22709
julien-c wants to merge 1 commit intoggml-org:masterfrom
julien-c:server-models-modalities

Conversation

@julien-c
Copy link
Copy Markdown
Contributor

@julien-c julien-c commented May 5, 2026

Overview

Adds an architecture object to each entry returned by /v1/models:

"architecture": {
  "input_modalities":  ["text", "image"],
  "output_modalities": ["text"]
}

image is included when the model's HF repo (or local model directory) contains an mmproj file. output_modalities is currently always ["text"].

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — Claude Code was used in an assistive capacity to apply edits, locate call sites, and trace the cascade/merge bug. Field naming, where to populate the flag, JSON shape, and verification against the running server were driven by me. I take full responsibility for the submitted code.

Adds an `architecture` object to each entry in /v1/models:

  "architecture": {
    "input_modalities":  ["text", "image"],
    "output_modalities": ["text"]
  }

`image` is included when the model's HF repo (or local model directory)
contains an mmproj file. Plumbing:

- common_cached_model_info gains input_modalities_image, set by scanning
  the HF cache for *mmproj*.gguf entries in the same repo.
- common_preset mirrors the flag; both load_from_cache and
  load_from_models_dir populate it.
- common_preset::merge OR-s the flag so it survives cascade().

output_modalities is currently always ["text"].
Comment on lines +1183 to +1186
json architecture {
{"input_modalities", input_modalities},
{"output_modalities", json::array({"text"})},
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the API shape from OpenRouter for instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant