Skip to content

feat(cli): add command 'llm svc model-configs' to list builtin/custom… - #318

Merged
Syspretor merged 2 commits into
sgl-project:mainfrom
diw-zw:0429-cfg
Apr 30, 2026
Merged

Syspretor merged 2 commits into
sgl-project:mainfrom
diw-zw:0429-cfg

Conversation

@diw-zw

@diw-zw diw-zw commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Previously, users had no way to discover which model IDs and run modes were available before running kubectl rbg llm svc run. When a user-defined model config overlapped with a built-in one, the entire built-in model was silently replaced (model-level merge), causing loss of non-overridden modes. This PR addresses both issues by:

  1. Introducing a discovery command so users can inspect supported models, engines, and resource presets before deployment.
  2. Switching to mode-level merge so user modes override only same-named built-in modes while preserving others.

Modifications

New Command: llm svc model-configs

  • Lists all available model configurations in a tabular format.
  • Default view shows MODEL ID, MODE, DESCRIPTION.
  • -o wide shows additional columns: ENGINE, SOURCE.

Documentation

  • Updated cmd/cli/README.md and doc/cli/kubectl-rbg-llm-svc.md with:
    • llm svc model-configs command description, flags, and examples.
    • Cross-reference explaining that model-configs helps discover deployable models before llm svc run.

Tests

  • Updated model_config_test.go assertions to reflect the new mode-level merge behavior:
    • Overridden modes carry the user file source.
    • Non-overridden built-in modes are preserved.
    • Last-file-wins semantics for duplicate user modes.
  • go test ./cmd/cli/... passes.

Files Changed

  • cmd/cli/cmd/llm/svc/model_configs.go (new)
  • cmd/cli/cmd/llm/svc/run/model_config.go
  • cmd/cli/cmd/llm/svc/run/model_config_test.go
  • cmd/cli/cmd/llm/svc/svc.go
  • cmd/cli/README.md
  • doc/cli/kubectl-rbg-llm-svc.md

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

Copy link
Copy Markdown

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 the kubectl rbg llm svc model-configs command to list available model configurations and refactors the model loading logic to support mode-level merging between built-in and user-defined configurations. Feedback identifies a bug in the mode merging logic where duplicates within the same file are not correctly handled, suggests validating the --output flag, recommends sorting modes for deterministic output, and points out a shallow copy issue with the Resources map in the configuration loader.

Comment thread cmd/cli/cmd/llm/svc/run/model_config.go
Comment thread cmd/cli/cmd/llm/svc/model_configs.go
Comment thread cmd/cli/cmd/llm/svc/run/model_config.go
Comment thread cmd/cli/cmd/llm/svc/run/model_config.go

@Syspretor Syspretor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

@Syspretor
Syspretor merged commit 990032c into sgl-project:main Apr 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants