* [feat]: add custom option for kt run

* [feat]: depth 3
This commit is contained in:
ErvinXie 2025-12-29 15:18:42 +08:00 committed by GitHub
parent 4b235cdaa4
commit 9539ab91eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 382 additions and 151 deletions

View file

@ -68,7 +68,8 @@ def _update_help_texts() -> None:
# Register commands
app.command(name="version", help="Show version information")(version.version)
app.command(name="run", help="Start model inference server")(run.run)
# Run command is handled specially in main() to allow extra args
# (not registered here to avoid typer's argument parsing)
app.command(name="chat", help="Interactive chat with running model")(chat.chat)
app.command(name="quant", help="Quantize model weights")(quant.quant)
app.command(name="bench", help="Run full benchmark")(bench.bench)
@ -429,6 +430,15 @@ def main():
if should_check_first_run and args:
check_first_run()
# Handle "run" command specially to pass through unknown options
if args and args[0] == "run":
# Get args after "run"
run_args = args[1:]
# Use click command directly with ignore_unknown_options
from kt_kernel.cli.commands import run as run_module
sys.exit(run_module.run.main(args=run_args, standalone_mode=False))
app()