Regenerate API client + add forwarder_max_concurrency wrapper (MLI-6875)#180
Conversation
Regenerates the API client from llm-engine main, picking up four months of schema drift since PR #176. All changes are additive: - forwarder_max_concurrency (CreateModelEndpointV1Request / UpdateModelEndpointV1Request / ModelEndpointDeploymentState) — MLI-6876 - queue_message_timeout_seconds (14 schemas) - task_expires_seconds (14 schemas) - ctx, input on ValidationError (pydantic v2 native fields) Verified non-breaking: - 0 paths/operations/schemas removed - 0 fields removed or type-changed - 0 fields newly required (Optional with default None) - Hand-written wrapper imports + signatures unchanged - Test suite: 20 passed, 4 skipped Wrapper changes (client.py only): - create_model_endpoint: add forwarder_max_concurrency kwarg + docstring - edit_model_endpoint: add forwarder_max_concurrency kwarg + docstring - update_if_exists path: forward the kwarg through to edit_model_endpoint Note: create_llm_model_endpoint is intentionally left unchanged because the upstream CreateLLM*ModelEndpointRequest schemas do not yet expose forwarder_max_concurrency — that would require a separate llm-engine PR. Version bumped to 0.4.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||
|
|
||
| class MetaOapg: | ||
| inclusive_maximum = 20 |
There was a problem hiding this comment.
Missing lower-bound constraint on
forwarder_max_concurrency
The OpenAPI spec defines exclusiveMinimum: 0.0 for this field (meaning the value must be ≥ 1), but the generator only emitted inclusive_maximum = 20 — there is no corresponding exclusive_minimum or inclusive_minimum. As a result, forwarder_max_concurrency=0 passes client-side schema validation and only fails at the server. The same gap exists in update_model_endpoint_v1_request.py. Since these are generated files the fix belongs in the upstream schema or the generator invocation, but it's worth tracking so callers get an early error rather than an opaque server rejection.
Prompt To Fix With AI
This is a comment left during a code review.
Path: launch/api_client/model/create_model_endpoint_v1_request.py
Line: 356
Comment:
**Missing lower-bound constraint on `forwarder_max_concurrency`**
The OpenAPI spec defines `exclusiveMinimum: 0.0` for this field (meaning the value must be ≥ 1), but the generator only emitted `inclusive_maximum = 20` — there is no corresponding `exclusive_minimum` or `inclusive_minimum`. As a result, `forwarder_max_concurrency=0` passes client-side schema validation and only fails at the server. The same gap exists in `update_model_endpoint_v1_request.py`. Since these are generated files the fix belongs in the upstream schema or the generator invocation, but it's worth tracking so callers get an early error rather than an opaque server rejection.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Not a blocker to this PR but a good catch. This is out of scope and a 0 field input will get a clear 422 rejection instead of silently failing.
The OpenAPI generator's import ordering doesn't match the repo's isort config, so CI's `isort --check-only launch` step failed. This commit is purely the output of `poetry run isort launch` — no semantic changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Regenerates the API client from the latest llm-engine OpenAPI schema and exposes
forwarder_max_concurrencyon the user-facing client. Companion to scaleapi/llm-engine#835 (MLI-6876).This regen also incidentally picks up four months of schema drift since #176 (Jan 2026). All changes are additive.
New fields exposed in the regen (all
Optional[int]with defaultNone)forwarder_max_concurrencyCreateModelEndpointV1Request,UpdateModelEndpointV1Request,ModelEndpointDeploymentStatequeue_message_timeout_secondstask_expires_secondsctx,inputValidationErrorNon-breaking change verification
pytest tests/)Wrapper changes (
launch/client.py)create_model_endpoint: newforwarder_max_concurrency: Optional[int] = Nonekwarg (pass-through, no client-side validation — server enforces1 ≤ N ≤ 20), docstring, and forwarded into the request payload.edit_model_endpoint: same.update_if_existsbranch insidecreate_model_endpoint: forwards the kwarg through toedit_model_endpoint.Out of scope
create_llm_model_endpointis intentionally untouched. The upstreamCreateLLM*ModelEndpointRequestfamily of schemas (vLLM, SGLang, etc.) did not gainforwarder_max_concurrencyin MLI-6876 — covering those would require a separate llm-engine PR. Worth tracking as a follow-up if there's a use case (the original Whisper bug that motivated this work used the generic endpoint path, not the LLM-specific one).Regen procedure
Used the documented
justfileworkflow:Version bumped to 0.4.2.
Test plan
poetry run pytest tests/— 20 passed, 4 skipped🤖 Generated with Claude Code
Greptile Summary
This PR regenerates the auto-generated API client from the latest llm-engine OpenAPI schema and exposes
forwarder_max_concurrencyon the user-facingLaunchClientwrapper. The regen is additive-only: 4 months of schema drift is picked up without removing any endpoints, operations, schemas, or existing fields.launch/client.py:forwarder_max_concurrency: Optional[int] = Noneadded to bothcreate_model_endpointandedit_model_endpoint, including theupdate_if_existsdelegate call and the direct-create payload path. Docstrings updated consistently.forwarder_max_concurrency(max=20),queue_message_timeout_seconds(min=1, max=43200), andtask_expires_seconds(min=1) added as optional nullable fields acrossCreateModelEndpointV1Request,UpdateModelEndpointV1Request,ModelEndpointDeploymentState, and 14 other schemas;input/ctxadded toValidationErrorfor pydantic v2 compatibility.pyproject.toml.Confidence Score: 5/5
Safe to merge — all changes are additive, no existing fields or endpoints are removed, and the new forwarder_max_concurrency kwarg is consistently threaded through every call path.
The wrapper changes are mechanical and well-scoped: the new kwarg is plumbed identically through the direct-create path, the update_if_exists delegate, and the edit path. The generated model changes are additive-only and match the upstream schema. No breaking changes were introduced.
No files require special attention.
Important Files Changed
Reviews (2): Last reviewed commit: "chore: apply isort to regenerated api_cl..." | Re-trigger Greptile