Skip to content

Conversation

@cdoern
Copy link
Collaborator

@cdoern cdoern commented Dec 17, 2025

What does this PR do?

  • Add new /admin API (v1alpha) for administrative operations including provider management, health checks, version info, and route listing
  • Implement using FastAPI routers following batches pattern with proper request/response models
  • Endpoints: /admin/providers, /admin/providers/{id}, /admin/inspect/routes, /admin/health, /admin/version
  • Create admin module structure: models.py, api.py, fastapi_routes.py, init.py
  • Add AdminImpl in llama_stack/core combining provider and inspect functionality
  • Deprecate standalone /providers and /inspect APIs (remain functional for backward compatibility)
  • Consolidate duplicate types: ProviderInfo, HealthInfo, RouteInfo, etc. now defined once in admin.models

Test Plan

new admin integration suite, uses generated stainless SDK, and records new tests on this PR.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 17, 2025
@cdoern cdoern changed the title Admin feat: introduce /admin API for stack administration and operations Dec 17, 2025
@cdoern
Copy link
Collaborator Author

cdoern commented Dec 17, 2025

working through testing issues, some will fail on this PR while others should pass. This is because the tests use an unpublished client to test new API. This client will be published right after the PR merges so then CI will go green on main.

@cdoern
Copy link
Collaborator Author

cdoern commented Dec 17, 2025

tests work! but they fail due to legitimate resourcing issues with the admin group in the client: https://github.com/llamastack/llama-stack/actions/runs/20288111386/job/58267005772 will dig into this and fix tomorrow. PR should then be set to merge.

@mergify
Copy link

mergify bot commented Dec 17, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @cdoern please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

✱ Stainless preview builds

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

feat: introduce /admin API for stack administration and operations
⚠️ llama-stack-client-node studio · code

There was a regression in your SDK.
generate ⚠️build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/llama-stack-client-node/2c9e2ab11a42bb2192370880781e2faee633c17c/dist.tar.gz
⚠️ llama-stack-client-kotlin studio · code

There was a regression in your SDK.
generate ⚠️lint ✅test ❗

⚠️ llama-stack-client-go studio · code

There was a regression in your SDK.
generate ❗lint ❗test ❗

go get github.com/stainless-sdks/llama-stack-client-go@236906dda29ae103193096518ede546068d65286
⚠️ llama-stack-client-python studio · conflict

There was a regression in your SDK.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
Last updated: 2025-12-22 17:18:13 UTC

@cdoern cdoern force-pushed the admin branch 5 times, most recently from 954dd24 to 843b1c6 Compare December 17, 2025 21:45
@cdoern
Copy link
Collaborator Author

cdoern commented Dec 17, 2025

new /admin API tests pass when using the client generated by this PR, using workflow_dispatch to capture the changes to the various workflows in this PR: https://github.com/llamastack/llama-stack/actions/runs/20318245671/job/58368233361

one note @ashwinb , the tests pass and run but no recordings are generated when using record-if-missing. Any idea why that is? regardless, this looks good to go. @raghotham I can open a PR for just 843b1c6 if you'd prefer, but it also may make sense to merge it with this PR since this PR is the one "testing" these new changes to the workflows in the actions link above. WDYT? I am fine with either!

@ashwinb
Copy link
Contributor

ashwinb commented Dec 17, 2025

CI is red?

@cdoern
Copy link
Collaborator Author

cdoern commented Dec 18, 2025

CI is red?

@ashwinb so on these types of PRs, the replay integration tests will be red. but the action I linked to also runs the integration test using the newly generated client from the Stainless SDK job.

The reason CI is red is because llama_stack_client.alpha.admin doesn't exist in the published client, but it does in the generated client. But, when this PR merges, the new 0.4.0a14 client will be generated and main CI should go back to being green!

Let me know if that makes sense

@cdoern
Copy link
Collaborator Author

cdoern commented Dec 18, 2025

PR here with workflow changes @ashwinb #4408

Copy link
Member

@raghotham raghotham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving despite failures. Got clarification from @cdoern in the office hours

@cdoern
Copy link
Collaborator Author

cdoern commented Dec 18, 2025

once this merges, llama-stack-client0.4.0a14 will be cut, and main should be green. There might be a blip for a second where it's red, but should be transient.

@cdoern
Copy link
Collaborator Author

cdoern commented Dec 18, 2025

rebased to get the CI changes.

  - Add new /admin API (v1alpha) for administrative operations including provider management, health checks, version info, and route listing
  - Implement using FastAPI routers following batches pattern with proper request/response models
  - Endpoints: /admin/providers, /admin/providers/{id}, /admin/inspect/routes, /admin/health, /admin/version
  - Create admin module structure: models.py, api.py, fastapi_routes.py, __init__.py
  - Add AdminImpl in llama_stack/core combining provider and inspect functionality
  - Deprecate standalone /providers and /inspect APIs (remain functional for backward compatibility)
  - Consolidate duplicate types: ProviderInfo, HealthInfo, RouteInfo, etc. now defined once in admin.models
  - Test new API using Stainless SDK in integration tests

Signed-off-by: Charlie Doern <cdoern@redhat.com>
@cdoern
Copy link
Collaborator Author

cdoern commented Dec 18, 2025

@cdoern cdoern requested a review from ashwinb December 19, 2025 23:53
admin:
methods:
list_providers: get /v1alpha/admin/providers
inspect_provider: get /v1alpha/admin/providers/{provider_id}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this feels odd

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating between this or

/v1alpha/admin/providers
/v1alpha/admin/{provider_id}

same for the other "nested" routes, I am unsure how much nesting we want/don't want. Either way it is alpha so we can change it if we want!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably have other resources like attributes for abac in /admin. So, suggest leaving /providers in there. And like @cdoern mentioned, its still alpha, so we can change it later if this doesnt feel right.

@cdoern cdoern merged commit 258c52c into main Dec 22, 2025
38 of 42 checks passed
@cdoern cdoern deleted the admin branch December 22, 2025 17:11
@cdoern cdoern linked an issue Dec 22, 2025 that may be closed by this pull request
@cdoern cdoern removed a link to an issue Dec 22, 2025
@cdoern cdoern linked an issue Dec 22, 2025 that may be closed by this pull request
r-bit-rry pushed a commit to r-bit-rry/llama-stack that referenced this pull request Dec 22, 2025
…lamastack#4401)

- Add new /admin API (v1alpha) for administrative operations including
provider management, health checks, version info, and route listing
- Implement using FastAPI routers following batches pattern with proper
request/response models
- Endpoints: /admin/providers, /admin/providers/{id},
/admin/inspect/routes, /admin/health, /admin/version
- Create admin module structure: models.py, api.py, fastapi_routes.py,
init.py
- Add AdminImpl in llama_stack/core combining provider and inspect
functionality
- Deprecate standalone /providers and /inspect APIs (remain functional
for backward compatibility)
- Consolidate duplicate types: ProviderInfo, HealthInfo, RouteInfo, etc.
now defined once in admin.models

new admin integration suite, uses generated stainless SDK, and records
new tests on this PR.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
r-bit-rry pushed a commit to r-bit-rry/llama-stack that referenced this pull request Dec 23, 2025
…lamastack#4401)

# What does this PR do?

- Add new /admin API (v1alpha) for administrative operations including
provider management, health checks, version info, and route listing
- Implement using FastAPI routers following batches pattern with proper
request/response models
- Endpoints: /admin/providers, /admin/providers/{id},
/admin/inspect/routes, /admin/health, /admin/version
- Create admin module structure: models.py, api.py, fastapi_routes.py,
init.py
- Add AdminImpl in llama_stack/core combining provider and inspect
functionality
- Deprecate standalone /providers and /inspect APIs (remain functional
for backward compatibility)
- Consolidate duplicate types: ProviderInfo, HealthInfo, RouteInfo, etc.
now defined once in admin.models

## Test Plan

new admin integration suite, uses generated stainless SDK, and records
new tests on this PR.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
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.

create /admin API stub

4 participants