feat(ui): add Token Router management - #5378
Open
m199369309 wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a token-aware router feature for DeepSeek-V4 on Xinference, adding both frontend UI components and backend services to manage routing between short- and long-context model backends. The review feedback highlights several critical issues to address before merging: performance bottlenecks from creating httpx.AsyncClient per request and using copy.deepcopy on chat history; event loop blocking during synchronous asset validation; Python 3.8/3.10 compatibility issues with cancel_futures, asyncio.to_thread, and TimeoutError handling; a potential TypeError if template_kwargs contains a 'messages' key; and a minor typo in a string literal.
m199369309
force-pushed
the
feat/token-router-ui
branch
3 times, most recently
from
August 18, 2026 18:08
a826225 to
fe37a89
Compare
- P1-1: stop executing asset Python in the Supervisor; validation is static (manifest, checksum, path safety, file hashes) and smoke tests are removed. - P1-2: Router workers measure the asset fingerprint and asset.json revision after real loading and report them through the heartbeat; the Supervisor compares against measured values, with TOCTOU checks. - P2: propagate asset capabilities into RouterConfig and enforce them on the request path (tools/thinking) and during rule validation.
The CI optional deps (diffusers -> huggingface-hub>=1.23) resolve click to 8.4.x, which removed CliRunner(mix_stderr=...) and captures stdout/stderr separately by default. The two failing cmdline tests assumed click <8.2 semantics: - test_cmdline_model_path_error: drop mix_stderr=False (unused by the test). - test_cmdline_of_custom_model: assert on result.output (combined streams on both click <8.2 mix_stderr default and click >=8.4 capture='sys'), since list_model_registrations writes its table to stderr.
m199369309
force-pushed
the
feat/token-router-ui
branch
from
August 21, 2026 02:33
45bd480 to
fa28725
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/token-routermanagement page and navigation/permission integrationDependency
Depends on #5375
Depends on #5376
Please merge the prerequisite PRs first. This PR is intentionally stacked and targets
mainfor review.Validation
npm run lint(passed with existing repository warnings only)npm run build(passed;/token-routerexported successfully)Please review now if convenient, but merge only after the dependency PRs have landed.