Skip to content

feat(router): bundle DeepSeek V4 tokenizer asset - #5377

Open
m199369309 wants to merge 9 commits into
xorbitsai:mainfrom
m199369309:feat/router-deepseek-tokenizer-asset
Open

feat(router): bundle DeepSeek V4 tokenizer asset#5377
m199369309 wants to merge 9 commits into
xorbitsai:mainfrom
m199369309:feat/router-deepseek-tokenizer-asset

Conversation

@m199369309

@m199369309 m199369309 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bundle the audited DeepSeek-V4-Flash-0731 tokenizer and encoding assets with Xinference
  • register built-in tokenizer assets alongside external registry entries
  • resolve built-in assets locally and verify revision/fingerprint consistency at runtime
  • expose and validate tokenizer asset origin in Router status and configuration
  • include source, license, and SHA-256 provenance metadata in the package

Dependency

Depends on #5376
Depends on #5371

Please merge the prerequisite PRs first. This PR is intentionally stacked and targets main for review.

Validation

  • pytest -q xinference/core/tests/test_tokenizer_asset_registry.py xinference/router/tests/test_config.py xinference/router/tests/test_runtime.py (28 passed)
  • focused pre-commit checks passed for non-vendored Python/manifest files
  • verified bundled source payload blobs against the audited backup and validated the built-in asset fingerprint

Please review now if convenient, but merge only after the dependency PRs have landed.

@XprobeBot XprobeBot added this to the v3.x milestone Aug 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an independent, token-aware router for DeepSeek-V4 on Xinference, including persistent SQLite storage for router configurations, an in-memory runtime registry, and RESTful endpoints for management and validation. Feedback on the changes highlights a potential resource leak in the chat completion proxy if non-HTTP exceptions occur before the client is closed, as well as a potential AttributeError in the supervisor's validation logic if process metadata is missing or null.

Comment thread xinference/api/restful_api.py Outdated
Comment thread xinference/core/supervisor.py Outdated
@m199369309
m199369309 force-pushed the feat/router-deepseek-tokenizer-asset branch 4 times, most recently from 92b6dfc to 7501a2b Compare August 18, 2026 18:08
- 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
m199369309 force-pushed the feat/router-deepseek-tokenizer-asset branch from fcc05b9 to 1b9f58b Compare August 21, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants