[build-system] # Minimum versions: setuptools for setup.py declarative usage, wheel for bdist_wheel requires = ["setuptools>=61", "wheel", "cmake>=3.16", "pybind11"] build-backend = "setuptools.build_meta" [project] name = "kt-kernel" # Version is dynamically read from ../version.py via setup.py dynamic = ["version"] description = "KT-Kernel: High-performance kernel operations for KTransformers (AMX/AVX/KML optimizations)" readme = "README.md" authors = [{ name = "kvcache-ai" }] # Use SPDX string form (table form deprecated in newer setuptools) license = "Apache-2.0" classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: C++", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", ] requires-python = ">=3.11" dependencies = [ # Core dependencies # Pinned, not a range: ktransformers, sglang-kt, accelerate-kt and transformers-kt # converged on 2.9.1, and the fine-tuning path depends on all of them agreeing. A CANN 9 # image that ships torch 2.10 therefore needs its torch-linked extensions rebuilt for # 2.9.1 rather than this bound relaxed -- see the Ascend tutorial. "torch==2.9.1", "safetensors>=0.4.0", "numpy>=1.24.0", # triton has no aarch64 wheels; the Ascend build does not use it. "triton>=2.0.0; platform_machine == 'x86_64' or platform_machine == 'AMD64'", "gguf>=0.17.0", # CLI dependencies "typer>=0.9.0", "rich>=13.0.0", "pyyaml>=6.0", "httpx>=0.25.0", "packaging>=23.0", ] [project.optional-dependencies] sglang = [ "sglang-kt", ] convert = [ "compressed-tensors>=0.7.0", ] test = [ "pytest>=7.0.0", "psutil>=5.9.0", ] [project.scripts] kt = "kt_kernel.cli.main:main" [project.urls] Homepage = "https://github.com/kvcache-ai" [tool.setuptools] packages = [ "kt_kernel", "kt_kernel.utils", "kt_kernel.sft", "kt_kernel.cli", "kt_kernel.cli.commands", "kt_kernel.cli.config", "kt_kernel.cli.utils", "kt_kernel.cli.completions", ] include-package-data = true [tool.setuptools.package-dir] kt_kernel = "python" "kt_kernel.utils" = "python/utils" "kt_kernel.sft" = "python/sft" "kt_kernel.cli" = "python/cli" "kt_kernel.cli.commands" = "python/cli/commands" "kt_kernel.cli.config" = "python/cli/config" "kt_kernel.cli.utils" = "python/cli/utils" "kt_kernel.cli.completions" = "python/cli/completions" [tool.setuptools.package-data] "kt_kernel.cli.completions" = ["*.bash", "*.fish", "_kt"] [tool.setuptools.exclude-package-data] # (empty) [tool.cpuinfer] # Custom section (example). You can place build options documentation here. # CPUINFER_CPU_INSTRUCT: NATIVE|FANCY|AVX512|AVX2 # CPUINFER_ENABLE_AMX: ON/OFF # CPUINFER_VERBOSE: 1/0 [tool.black] # Code style for Black formatter line-length = 120 target-version = ["py311"] exclude = ''' ( /(\. | build | dist | temp | __pycache__ | kt_kernel\.egg-info | third_party )/ ) '''