Pull requests / #1882

#1882 serve: /v1/models also gives the context size as `max_model_len` and `context_length`

open · @LeGeRyChEeSe · 0 commentaires · Sur GitHub

Server & APIModels & quants

Description

## Title

Issue: none found (searched 2026-10-10: max_model_len, context_length).

## Summary
`/v1/models` gives the context size only as `meta.n_ctx` (llama-server's name). Clients that size their context window
from the model list read other keys: `max_model_len` (vLLM's) or `context_length` (OpenRouter's). Without them they fall back to their own default, and
so they compact too early, or send more than the server takes.

The same value (`svc.reported_ctx()`) is now under all three names. `meta.n_ctx` is unchanged. One line, plus a
comment.

## Test
- `serve/test_server.py`, `test_model_discovery_and_props`: checks the two new keys next to `meta.n_ctx`.
- `python -m unittest -k model_discovery -k alias -k unload serve.test_server`: 9 tests, OK.

Sur le site

Liens install, modèles, releases.