Repository navigation
serve: add llama.cpp-compatible discovery endpoints - #122
Merged
Merged
Conversation
Expose loaded-model metadata through /models and /v1/models. Add /props and single-slot /slots responses with existing API-key enforcement and regression coverage. Validation: all 30 server tests pass. Pi 0.87.1 discovered the loaded model with 262144-token context and thinking support, and completed a chat smoke test successfully. Fixes Niko1221#117. Co-authored-by: Codex (gpt-6-astra-medium) <noreply@openai.com>
Owner
This was referenced Sep 29, 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.
Fixes #117.
Add read-only metadata endpoints so clients such as Pi can discover the loaded model, context capacity, and thinking/image capabilities without receiving a 404 from
/props./modelsand/v1/modelslist only the loaded model, including its status, context limit, and input/output modalities./propsexposes the original chat template, configured generation defaults, context limit, model path, and engine version./slotsreports the single processing slot and its busy/idle state.Context capacity reflects the full configured context, not the smaller resident KV window. Image support is reported only when the vision component is loaded. Unconfigured sampling fields are omitted; shared settings take precedence over configuration defaults.
/props?model=<loaded-model-id>&autoload=falseis supported. Unknown models return 404. When the engine has stopped, model/slot lists are empty and/propsreturns 503.Example responses
Examples from a loaded, idle Q2 model with a 262,144-token context and vision disabled. The chat template is shortened for readability and the model path is replaced with a generic example.
GET /models(alsoGET /v1/models){ "object": "list", "data": [ { "id": "qwen3.8-flash-next-q2_0", "object": "model", "status": {"value": "loaded"}, "meta": {"n_ctx": 262144}, "architecture": { "input_modalities": ["text"], "output_modalities": ["text"] } } ] }GET /props{ "default_generation_settings": { "n_ctx": 262144, "params": { "temperature": 1.0, "top_p": 0.95, "top_k": 20, "min_p": 0.0, "presence_penalty": 0.0, "frequency_penalty": 0.0, "repeat_penalty": 1.0, "n_predict": -1 } }, "total_slots": 1, "model_alias": "qwen3.8-flash-next-q2_0", "chat_template": "[full original Jinja template omitted here]", "modalities": {"vision": false}, "models_autoload": false, "is_sleeping": false, "model_path": "models/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.gguf", "build_info": "Strata 0.1.21" }n_predict: -1means there is no fixed output cap beyond the remaining context. With a loaded vision component,/modelsreportsinput_modalities: ["text", "image"]and/propsreportsmodalities.vision: true.GET /slots[ { "id": 0, "n_ctx": 262144, "is_processing": false } ]is_processingbecomestruewhile the slot is processing a request.Validation