refactor: remove deprecated register/unregister model endpoints#5341
refactor: remove deprecated register/unregister model endpoints#5341leseb wants to merge 2 commits intollamastack:mainfrom
Conversation
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ llama-stack-client-node studio · conflict
✅ llama-stack-client-go studio · conflict
✅ llama-stack-client-openapi studio · code · diff
✅ llama-stack-client-python studio · conflict
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
6f09d37 to
6b0f2df
Compare
Remove the deprecated POST /v1/models (register_model) and DELETE
/v1/models/{model_id} (unregister_model) HTTP endpoints. The underlying
methods remain for internal use by routing tables during startup.
Also fix _filter_deprecated_schema() to filter at the operation level
instead of the path level, so non-deprecated GET operations are not
incorrectly included in the deprecated OpenAPI spec.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
6b0f2df to
a427ab4
Compare
…ints Note: the stainless spec gains 5 redundant nullable: true annotations on RegisterModelRequest fields. This is a pre-existing generator issue where _fix_schema_recursive adds nullable alongside anyOf with null. A follow-up PR will fix the generator to avoid redundant nullable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
Summary
Remove the deprecated
POST /v1/models(register_model) andDELETE /v1/models/{model_id}(unregister_model) HTTP endpoints. These were already markeddeprecated=Truein FastAPI.The underlying
register_model()andunregister_model()methods on the Models protocol and routing table remain — they are used internally for auto-registration at startup.Bug fix: deprecated spec filter
Also fixes
_filter_deprecated_schema()in the OpenAPI spec generator to filter at the operation level instead of the path level. Previously, if any operation on a path was deprecated (e.g.POST /v1/models), all operations on that path (including the non-deprecatedGET /v1/models) were incorrectly pulled into the deprecated spec.Known issue
The stainless spec gains 5 redundant
nullable: trueannotations onRegisterModelRequestfields. This is a pre-existing generator issue where_fix_schema_recursiveaddsnullablealongsideanyOfwith null type. A follow-up PR will fix the generator to produce deterministic output.What changed
src/llama_stack_api/models/fastapi_routes.py— removed register/unregister route handlersscripts/openapi_generator/schema_filtering.py— fixed deprecated spec to filter at operation levelscripts/openapi_generator/stainless_config/generate_config.py— removed register/unregisterTest plan
🤖 Generated with Claude Code