Skip to content

feat: add WebUI model catalog projection - #1868

Merged
inureyes merged 8 commits into
mainfrom
feature/issue-1840-model-catalog
Sep 12, 2026
Merged

inureyes merged 8 commits into
mainfrom
feature/issue-1840-model-catalog

Conversation

@inureyes

@inureyes inureyes commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add authenticated catalog list, detail and explicit refresh adapters over the existing RouterPool, preserving source precedence, opaque catalog IDs and separate inference IDs without creating a second provider or model registry.
  • Reuse shared model-detection dispatch with bounded catalog probes: no tokenizer, provider, network or SafeTensors header/payload initialization during metadata inspection. Preserve raw model_type and bounded declared_architectures separately from resolved registry support and provider readiness.
  • Expose nullable metadata with reasons, strict filters and deterministic pagination (50 default, 200 maximum, 1,000 inventory bound), completeness, task/backend capabilities, and cache-only removal guidance.
  • Own bounded static metadata caches per router or single-model context; project current lifecycle and provider capabilities on every response. Explicit refresh is singleflight, detects same-size metadata changes and invalidates only its own cache; legacy reload and download changes advance the catalog epoch.
  • Reject symlinked evidence consistently across model-directory, managed-cache and preset discovery and config/index/shard/pooling metadata. Bound directory entries before filtering and redact errors.
  • Update OpenAPI, generated TypeScript, complete producer fixtures and English/Korean integration documentation and technical reports together.

Changes during review

  • Replaced an unsafe unrestricted detector and an independent family matcher with shared detection authority and bounded evidence probes.
  • Replaced the process-global cache and counter after normal parallel tests reproduced cross-catalog interference; added concurrent 1,000-entry catalogs, cached single-model/provider transitions, scoped metadata-acquisition checks and source guards.
  • Restored raw metadata semantics, removed heavy fingerprint work from warm polling, fixed provider capabilities after unload, and hardened nested/final symlink and oversized-error boundaries.

Validation

  • Full workspace and real-model gate at fafc5cf: 11,187 passed, 0 failed, 361 ignored; workspace clippy passed. Llama streamed 572 content characters, new admission during draining returned HTTP 400, worker exit was observed after stream drop, Granite returned Affirmative., and SIGINT completed 1/1 worker shutdowns.
  • Final combined gate at 808994e: catalog 32 library + 1 CLI, security 26 and discovery 2 passed under normal parallel execution; workspace all-target clippy, 40 contract fixtures, structural checks, fmt and diff checks passed. Shared detection/loader code did not change after the earlier full/real gate; the entire workspace is not claimed rerun at the final revision.
  • Feature-off check passed: cargo check --no-default-features --features metal,accelerate --lib --tests (existing feature-off warnings remain).
  • Both independent correctness and security reviews cleared the complete router and single-model cache boundaries at 808994e. The final follow-up commit only records verification and startup handoff documentation.

Environment exception and downstream integration

The user confirmed GB10 is down and explicitly authorized skipping unavailable GB10-required CI while continuing on passing local CI. No workflow/protection rule was changed, and unavailable jobs are not reported as passed. This PR makes no CUDA runtime or browser acceptance claim.

Production --webui mounting remains #1838. Router catalog handlers already offload metadata work. The single-model helper single_model_entry_from_state_with_cache is synchronous: #1838 must retain one per-application Arc and call it inside tokio::task::spawn_blocking; production single-model route offload/responsiveness is a downstream gate. Removal execution remains #1841.

Closes #1840

Refs #1834

@inureyes inureyes added status:review Under review type:enhancement New features, capabilities, or significant additions priority:high High priority area:models Model architectures, weights, loading, metadata labels Sep 12, 2026
inureyes added a commit that referenced this pull request Sep 12, 2026
Document the catalog authority, restricted detection probes, metadata limits, refresh execution ownership, and provider-facing integration boundaries in English and Korean.

Add bilingual PR #1868 reports that distinguish completed scoped validation from pending workspace and real-model gates, and record the user-approved exception for unavailable GB10 CI without claiming CUDA validation.

Refs #1840; Refs #1834
Expose bounded metadata-only WebUI catalog routes for router mode, including stable identities, pagination/filtering, truthful support/completeness metadata, and refresh operations without loading providers.

Refactor model detection behind shared probes so the catalog reuses loader dispatch while failing closed when variant classification would require SafeTensors headers.

Add schema fixtures and regression tests for bounded filesystem reads, provider capability projection, refresh singleflight, cache invalidation, and sanitized unknown reasons.
Add the project Apache-2.0 header to the new WebUI catalog test modules so the license-header gate accepts the issue #1840 additions.
Reject symlinked 1_Pooling parent directories during bounded catalog embedding detection and add HTTP refresh pagination coverage for 1000 discovered models.
Document the catalog authority, restricted detection probes, metadata limits, refresh execution ownership, and provider-facing integration boundaries in English and Korean.

Add bilingual PR #1868 reports that distinguish completed scoped validation from pending workspace and real-model gates, and record the user-approved exception for unavailable GB10 CI without claiming CUDA validation.

Refs #1840; Refs #1834
@inureyes
inureyes force-pushed the feature/issue-1840-model-catalog branch from 92943a1 to 65059aa Compare September 12, 2026 13:44
Catalog GETs now reuse bounded metadata by router catalog epoch and generation instead of walking fingerprints on every poll, while runtime lifecycle/provider fields stay projected from current pool state.

Raw config model_type and declared_architectures remain exact bounded DTO fields, and explicit refresh/reload/download paths advance cache visibility for same-size metadata edits without reading weights.

Refs #1840
Record the final catalog cache validation, 40-fixture contract gate, static checks, and root real-model smoke results so the pre-merge report no longer lists those gates as pending.

Refs #1840
Distinguish the earlier full-workspace and real-model evidence from the final catalog/security combined gate, and record both independent review clearances.

Document the synchronous cached single-model accessor so startup integration retains a per-application cache and offloads metadata acquisition instead of polling the filesystem on the request executor.

Validation: documentation-only changes after the passing 808994e combined gate; git diff --check. Refs #1840 and #1834.
@inureyes inureyes added status:done Completed and removed status:review Under review labels Sep 12, 2026
@inureyes
inureyes merged commit 5505aae into main Sep 12, 2026
14 of 16 checks passed
@inureyes
inureyes deleted the feature/issue-1840-model-catalog branch September 12, 2026 15:41
inureyes added a commit that referenced this pull request Sep 14, 2026
…clean (#1889)

## Summary

Restores the `OpenXLA feature compile` CI job, which has failed on `main` since 2026-09-12 16:12 and therefore fails on every open PR. No behavior changes on any feature set.

## Cause

The job's second step is `cargo check --no-default-features --features xla-diagnostics --all-targets` under `RUSTFLAGS="-D warnings"`. Because `default = ["surgery", "webui"]`, that step builds with the WebUI off.

The last success on `main` was `9ead2b7d` (2026-09-12 04:43) and the first failure `70386ac6` (2026-09-12 16:12). The only commits between them are the WebUI series: #1857, #1860, #1865, #1868, #1864. They registered their routes behind `#[cfg(feature = "webui")]` but left the handlers, validators, constants, request types and imports those routes use outside the gate. With `webui` off all of it is dead code, and `-D warnings` makes each an error.

I checked before writing this that it was not already fixed elsewhere: current `origin/main` still carries the imports and its latest CI run still fails the job, `lablup/mlxcel-internal` was last pushed on 2026-09-10 and predates the breakage, and no merged or open PR fixes it.

## Change

Every orphaned item is gated on `webui`, matching the gate its only callers already carry.

- `src/server/router_server.rs`: 35 handlers, validators, constants and types, plus the `router_lifecycle`, `HeaderMap`, `Uri`, `AxumPath` and `RouterModelAction` imports only they use.
- `src/server/app.rs`: six axum imports.
- `src/models/mod.rs`: six detection re-exports used only by `server::webui`. `is_sequence_classification_architecture` stays ungated because `src/rerank/mod.rs` uses it.
- `src/server/auth.rs`: `with_extra_key`, called only from the WebUI security setup in `startup.rs`.
- `src/server/router_server_tests.rs`: `restore_env_var`, used only by a webui-gated test.

Gating the first layer exposed a second layer of imports that only the gated items used, so this was iterated until the compiler reported nothing. The only deleted lines are import lists being split; no logic is touched.

## Verification

Reproduced first on `main`: `cargo check --no-default-features --features cuda --lib --tests` reports 42 warnings in the `mlxcel` crate.

After the change, every `cargo check` below reports zero warnings and zero errors in workspace crates:

| features | targets |
|---|---|
| `--no-default-features --features cuda` | `--lib --tests` |
| `--features cuda` (defaults on) | `--lib --tests` |
| `--no-default-features --features cuda,webui` | `--lib --tests` |
| `--no-default-features --features cuda,surgery` | `--lib --tests` |
| `--no-default-features --features cuda` | `--all-targets` |
| `--features cuda` (defaults on) | `--all-targets` |

The `--all-targets` rows cover bins, benches and examples, where a gated item used by another target would have been a hard compile error rather than a warning. `cargo fmt --all -- --check` is clean.

Not built locally: the `xla-iree` feature itself. The `OpenXLA feature compile` job on this PR is the check for it, and it is the job this PR exists to turn green.

## Follow-up for open PRs

PR #1872 edits `src/server/router_server.rs` and carries the same imports, so it will need a rebase once this lands. A rebase request will be posted there.
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:models Model architectures, weights, loading, metadata priority:high High priority status:done Completed type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(webui): expose a truthful model catalog and capabilities

1 participant