Files
tokenspeed/python/pyproject.toml
0bd13e7584 feat(cli): forward --trust-remote-code to SMG (#3987)
## Summary

Forward the effective `--trust-remote-code` setting from `ts serve` to
SMG so the gateway can render text chat with a checkpoint's custom
Python tokenizer. The engine receives the supplied trust flags in order.
When both forms are present, the last form determines whether the
gateway receives the opt-in.

## Dependency

This change depends on the SMG Python renderer and its startup opt-in.
[smg-project/smg#9376](https://github.com/smg-project/smg/pull/9376)

The `tokenspeed-smg` dependency is updated to `1.16.0.post20261203`.

## Test Plan

- `pre-commit run --all-files` passed.
- `python -m pytest -q test/cli/test_argsplit.py` passed 47 tests,
including defaults, both flag forms, and repeated settings.
- Exercised `ts serve` offline with a locally built SMG wheel, a local
checkpoint, and a CPU fake backend. The enabled case matched the
reference Python prompt token IDs. The disabled case returned the opt-in
error.

---------

Signed-off-by: tuanzhangCS <26617745+tuanzhangCS@users.noreply.github.com>
Signed-off-by: tuanzhangCS <tuan@lightseek.org>
Co-authored-by: tuanzhangCS <26617745+tuanzhangCS@users.noreply.github.com>
Co-authored-by: minedec <37043133+minedec@users.noreply.github.com>
2026-12-03 20:45:31 +08:00

110 lines
3.5 KiB
TOML
Executable File

# Copyright (c) 2026 LightSeek Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
[build-system]
requires = ["setuptools==83.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "tokenspeed"
version = "0.1.1"
description = "TokenSpeed is a speed-of-light LLM inference engine."
readme = "README.md"
requires-python = ">=3.11"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
]
dependencies = [
# Floor at the first release line with cp312 wheels: when PyPI serves a
# bad Content-Type for a dependency's index page (observed for multidict),
# pip skips it and silently backtracks aiohttp to pre-1.0 releases that no
# longer declare it; those cannot even import on Python 3.12. With every
# admissible aiohttp requiring multidict, the same flake instead fails the
# resolver and the CI install retry loop handles it.
"aiohttp>=3.9",
"compressed-tensors",
"dill",
"einops",
"fastapi",
"hf_transfer",
"huggingface_hub",
"modelscope",
"msgspec",
"ninja",
"numpy",
"openai>=2.24.1",
"openai-harmony",
"orjson",
"packaging",
"partial-json-parser",
"peft",
"pillow",
# Weighted histogram updates use internals covered by the reporter tests.
"prometheus-client>=0.26.0,<0.27",
"psutil",
"pybind11",
"pydantic",
"py-spy",
"pytest>=9",
"pytest-asyncio",
"python-multipart",
"pyzmq",
"requests",
"setproctitle",
"tiktoken",
"torch",
"torchvision",
"tokenspeed-kernel>=0.1.5.dev0",
"tokenspeed-mooncake>=0.3.13.post20261119",
"tokenspeed-engine>=0.1.1.dev0",
"tokenspeed-smg==1.16.0.post20261203",
"tokenspeed-smg-grpc-proto==0.5.0.post20261121",
"tokenspeed-smg-grpc-servicer==0.16.0.post20261121",
"tokenspeed-xgrammar==0.2.9.post20261125",
"tqdm",
"transformers==5.12.0",
"uv",
"uvicorn",
"viztracer",
]
[project.scripts]
tokenspeed = "tokenspeed.cli:main"
ts = "tokenspeed.cli:main"
[project.urls]
"Homepage" = "https://github.com/lightseekorg/tokenspeed"
[project.optional-dependencies]
ascend-memory-saver = ["torch-npu-memory-saver==0.1.7"]
runai = ["runai-model-streamer>=0.16.1"]
[tool.setuptools]
license-files = ["LICENSE", "THIRDPARTYNOTICES"]
[tool.setuptools.packages.find]
include = ["tokenspeed*"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"triton" = { msg = "Use tokenspeed_triton instead." }
"torch.compile" = { msg = "Write the fused kernel directly in Triton instead." }