mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2618] [CLOSED] serve: /v1/models meta carries llama-server's model facts (n_params, … #4171
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2618
Author: @Pix13
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:feat/models-meta-gguf📝 Commits (1)
03eb9b6serve: /v1/models meta carries llama-server's model facts (n_params, size, ftype, ...) from the GGUF headers📊 Changes
2 files changed (+155 additions, -1 deletions)
View changed files
📝
serve/server.py(+62 -1)📝
serve/test_server.py(+93 -0)📄 Description
Title
serve: /v1/models meta carries llama-server's model facts (n_params, size, ftype, ...) from the GGUF headers
Issue: none found (searched 2026-10-15: n_params, ftype, /v1/models meta). Related: #1882 (other context keys, same
dict; the two merge without overlap).
Summary
llama-server's
/v1/modelsgives each model ametawithn_params,size,ftype,n_vocab,n_ctx_trainand
n_embd. Strata gives onlyn_ctx. Proxies and dashboards that read llama-server's model list (for exampleOlla's Models panel) show the parameter count, the quantisation and the size on disk from these keys, and leave
them blank for a Strata endpoint.
This change reads them from the
--nativeGGUF's headers (tools/gguf_reader.py, no tensor data), over everyshard of a split model, the first time
/v1/modelsis asked for, and keeps them:n_params: the elements of every tensor in every shardsize: the shards' bytes on diskftype: llama.cpp'sllama_model_ftype_name()label ofgeneral.file_type("Q8_0","IQ3_S - 3.4375 bpw")n_vocab,n_ctx_train,n_embd:tokenizer.ggml.tokens,<arch>.context_length,<arch>.embedding_lengthOnly the facts found are given. A missing shard gives no
n_params/size(rather than a wrong one); an enginewithout a GGUF (pack only, the mock engine) or a GGUF that cannot be read gives the old
meta, and an unreadablefile is said once on stderr.
meta.n_ctxis unchanged and stays the engine's.What it leaves alone: the engine, every other endpoint, requests. On opt-in: the change only adds keys to a dict
whose existing keys keep their values; llama-server always sends them, so I did not put them behind a setting.
Happy to add one if you prefer.
Measured
Header read, on Rocky 9.8 (files in the page cache):
Q8_0IQ3_S - 3.4375 bpwBoth run with this change since 2026-10-15 (2x RTX 3090 and a V100); Olla shows
177B/Q8_0/175.30 GB.Test
serve/test_server.py, newModelMeta: a two-shard GGUF written by the test (named by either shard), a missingshard, no GGUF, an unreadable GGUF (said once), and
/v1/modelswith an alias.python -m unittest discover -s serve -p 'test_*.py' -t .: 789 tests, 2 failures that fail onmaintoowithout this change (
test_keepawake ... early_close,test_responses.NoLeakedSampler, timing-dependent here).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.