Skip to content

server: refactor modalities handling - #30015

Open
ngxson wants to merge 2 commits into
masterfrom
xsn/improve_server_model_type
Open

ngxson wants to merge 2 commits into
masterfrom
xsn/improve_server_model_type

Conversation

@ngxson

@ngxson ngxson commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Some refactor planned from #29987

Note that common_get_decision_type current can take the gguf path and manually open it to grab the metadata. If we have similar logic in the same future, it will be important to have one gguf_context that can be reused by multiple calls

Requirements

@github-actions github-actions Bot added documentation Improvements or additions to documentation server labels Oct 5, 2026
@ngxson
ngxson changed the base branch from xsn/improve_server_model_type_base to master October 5, 2026 21:33
@ngxson
ngxson marked this pull request as ready for review October 5, 2026 21:55
@ngxson
ngxson requested a review from a team as a code owner October 5, 2026 21:55

@ServeurpersoCom ServeurpersoCom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, dropping the child report entirely is cleaner than validating it, and the video limitation is documented.

@angt

angt commented Oct 5, 2026

Copy link
Copy Markdown
Member

Maybe I missed something, but child report was required to update the modality and help pi discover the model without restarting the router or reloading the model. Video support was a free bonus with that.

@ngxson

ngxson commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

@angt my intention was to not parse child-reported /models data because whatever already in router's meta.architecture.to_json() must match child's "architecture" field

note sure if you found any cases where this may break?

for example:

  • router detects child to have output: text, decision
  • then, when child is launch, its "architecture" output modalities should also report: text, decision

in other words, I want to design it such that both router and child produce the same "architecture", even though they may take 2 different code paths. this way, there is no need to sync them

@angt

angt commented Oct 6, 2026

Copy link
Copy Markdown
Member

@ngxson the case I was thinking of is a preset to a model that isn't downloaded yet so the router fallback to text and they will differ

@ngxson

ngxson commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

hmm, make sense. in this case, we should have an event called model_mutated that get fired whenever child mutate the model file, so that router should update

pushing a new commit now

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

It seems dropping the default initializer of architecture in server_model_meta turns CI red (-Werror=missing-field-initializers on GCC arm64), it should be put back with = {}.

Comment thread tools/server/server.cpp
common_models_handler_apply(models_handler, params);
server_download_tracker tracker;
common_models_handler_apply(models_handler, params, child.is_child() ? &tracker : nullptr);
if (tracker.mutated) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If 2 presets use the same GGUF, the first one download the file and notify the router, but not the second one? 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can just force a refresh when a child is ready ?

This branch has not been deployed

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

Labels

documentation Improvements or additions to documentation server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants