Repository navigation
server: add include_params to GET /v1/models, read from the model spec - #787
Merged
Merged
Conversation
GET /v1/models?include_params=true adds a "params" array to each entry: the options.request rows the model's schema-v1 spec declares, passed through as written. An enum row that names a preset also carries the preset's values, so a client needs no copy of the preset table. A model whose spec is not yet on schema_version 1 returns "params": []. The spec is resolved the way model_accepts_request_option resolves it: per-model or server spec override first, then the GGUF's embedded spec, then the installed model_specs/. It works without the WebUI built. The array is computed once at registration in refresh_model_option_flags, beside the accepts_* flags and for the same reason: the embedded-spec read is too slow for the request thread. The parallel runtime carries it across a reconfigure like the flags. The flag is opt-in, so existing responses are unchanged. Refs 0xShug0#775 Co-Authored-By: Claude Opus 5.5 <[email protected]>
0xShug0#786 documents OmniVoice, Qwen3-TTS and Qwen3-ASR options in their specs without moving them to schema_version 1, and include_params returned [] for them because it required a v1 spec. Read options.request from the resolved spec whatever its version. Older-format specs skip the typed validator, so rows that are not objects are left out, and a preset is expanded only when the framework knows it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
@Navier8 Thanks! PR merged. |
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #775. As discussed there, this adds only
include_paramsand reads it from the model specs, notwebui/configs/model_params.json.What it does
GET /v1/models?include_params=true(or=1) addsparamsto each model entry.paramsholds theoptions.requestrows from the model's schema-v1 spec, exactly as the spec writes them:name,type,required,description, anddefault/min/maxwhere given.presetalso gets the preset'svalues, so a client needs no copy of the preset table. Rows that already listvaluespass through unchanged."params": []. Older-format specs are read too; since they skip the typed validator, rows that aren't objects are skipped, and apresetis expanded only when the framework knows it.=false, the response is byte-for-byte what it was.The spec is resolved the same way
model_accepts_request_optionresolves it: a per-model or servermodel_spec_overridefirst, then the GGUF's embedded spec, then the installedmodel_specs/. Only the same missing or legacy contract errors are caught. Nothing depends on the WebUI being built.The array is computed once in
refresh_model_option_flags, next to theaccepts_*flags. It's computed there for the reason given in their comment: reading the embedded spec on the request thread is slow. On the parallel runtime it's carried across a reconfigure in the same way as the flags. Bothruntime.cppandparallel_runtime.cppget the same change, andapp/server/README.mddocuments the flag.Runtime validation
Setup. Windows 11, CPU release build (
scripts/build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_server, then again with-NativeModelManagerfor the reload test). The server was started with--configand four models registered:paramsomnivoiceomnivoice[]asrqwen3_asr[]moonshinemoonshine_asrmoonshine-streaming-tiny-q8_0.ggufmoonshine-overridemoonshine_asrmodel_spec_override: a copy of the spec with one addedtext_chunk_moderow using"preset": "text_chunk_mode_full", to exercise preset expansionChecks, run on both the serial runtime and
--parallel-jobs 2:include_paramsabsent orfalse: noparamskey on any entry.include_params=trueand=1: themoonshinerows are identical tomodel_specs/moonshine_asr.jsonoptions.request, compared as parsed JSON.audio_chunk_modekeeps its ownvalues.moonshine-overridematches its spec plus"values": ["word_budget","tag_aware","japanese","endline"]on the preset row.include_params=1&include_session_options=true: both fields present.params.--ui-management,POST /v1/models/loadonmoonshinewith the override spec moved itsparamsfrom 3 rows to 4 ("reconfigured": true) on both runtimes./v1/audio/transcriptionsonmoonshineandasrreturned "The quick brown fox jumps over the lazy dog." before and after, on both runtimes.Not tested: CUDA, Vulkan or Metal builds. The change touches no backend code. A deployment build (
AUDIOCPP_DEPLOYMENT_BUILD) wasn't tested either; it resolves specs through the samefind_contract_spec_path. I haven't added a unit test because the existing server fixtures don't register a model with a spec. I'm happy to add one if you'd like it and can point me at the fixture you'd prefer.Follow-up
#786 adds the options for OmniVoice and the Qwen3 families, which is what I needed. The OmniVoice spec PR I opened (#789) is closed in its favour.
🤖 Generated with Claude Code