Skip to content

refactor: remove deprecated register/unregister model endpoints#5341

Open
leseb wants to merge 2 commits intollamastack:mainfrom
leseb:fix-deprecated-models
Open

refactor: remove deprecated register/unregister model endpoints#5341
leseb wants to merge 2 commits intollamastack:mainfrom
leseb:fix-deprecated-models

Conversation

@leseb
Copy link
Copy Markdown
Collaborator

@leseb leseb commented Mar 27, 2026

Summary

Remove the deprecated POST /v1/models (register_model) and DELETE /v1/models/{model_id} (unregister_model) HTTP endpoints. These were already marked deprecated=True in FastAPI.

The underlying register_model() and unregister_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-deprecated GET /v1/models) were incorrectly pulled into the deprecated spec.

Known issue

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 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 handlers
  • scripts/openapi_generator/schema_filtering.py — fixed deprecated spec to filter at operation level
  • scripts/openapi_generator/stainless_config/generate_config.py — removed register/unregister
  • Regenerated all OpenAPI specs

Test plan

  • Pre-commit passes (API Spec Codegen, breaking changes check)
  • Deprecated spec no longer contains GET /v1/models
  • Main spec unchanged (GET endpoints remain)

🤖 Generated with Claude Code

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 27, 2026
@leseb leseb marked this pull request as draft March 27, 2026 16:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✱ Stainless preview builds

This PR will update the llama-stack-client SDKs with the following commit message.

refactor: remove deprecated register/unregister model endpoints

Edit this comment to update it. It will appear in the SDK's changelogs.

llama-stack-client-node studio · conflict

Your SDK build resulted in a merge conflict between your custom code and the newly generated changes, but this did not represent a regression.

llama-stack-client-go studio · conflict

Your SDK build resulted in a merge conflict between your custom code and the newly generated changes, but this did not represent a regression.

llama-stack-client-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

llama-stack-client-python studio · conflict

Your SDK build resulted in a merge conflict between your custom code and the newly generated changes, but this did not represent a regression.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-27 17:19:45 UTC

@leseb leseb force-pushed the fix-deprecated-models branch 3 times, most recently from 6f09d37 to 6b0f2df Compare March 27, 2026 16:58
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>
@leseb leseb force-pushed the fix-deprecated-models branch from 6b0f2df to a427ab4 Compare March 27, 2026 17:07
…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>
@leseb leseb marked this pull request as ready for review March 27, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant