Accept `context_length` alongside `max_model_len` in Pax `vllm` model discovery

Merged
MP
21h ago
+33-7

Summary

  • Accept context_length as a fallback when max_model_len is omitted or invalid in pydantic_ai_pax.models.vllm.ServedModel / discover().
  • Reject booleans and non-positive integers in ServedModel.optional_length so malformed values fall through cleanly.
  • Update src/pydantic_ai_pax/docs/reference.md and tests/pax/test_vllm.py.

Closes #15762


Summary by cubic

Adds context_length support to Pax's vLLM model discovery so models served by OpenAI-compatible gateways that omit max_model_len still get a context window.

  • Saves the advertised max_model_len first and falls back to context_length when it's missing or invalid.
  • Treats booleans and non-positive integers as missing for both fields.
  • Updates documentation and test coverage.

Closes #15762.