Cli implement#182
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive CLI for managing LLM models, including configuration, pulling, and running models, with a plugin-based architecture for different model sources, storage backends, and inference engines. However, critical command injection vulnerabilities have been identified where user-supplied input (model IDs and revisions) is directly concatenated into shell commands executed within Kubernetes Jobs, allowing arbitrary command execution within the Job containers. Robust shell escaping for all dynamic components or avoiding shell execution is highly recommended. Additionally, there are high-priority issues concerning concurrency and data correctness, and medium-priority improvements for user experience and error handling. Please review the detailed comments for specifics.
85d03f4 to
36e129f
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
Implements a pluggable kubectl rbg llm CLI, including config management, model source/storage/engine plugins, and interactive chat support against running inference services.
Changes:
- Add plugin interfaces + built-in implementations for storage (PVC/OSS), sources (HuggingFace/ModelScope), and engines (vLLM/SGLang)
- Introduce CLI config file handling (YAML), plus
llmsubcommands (config, run, pull, models, list, delete, chat) - Add extensive Go unit tests across CLI, config, and plugin packages
Reviewed changes
Copilot reviewed 60 out of 566 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Adds CLI dependencies (readline/term/yaml.v3) needed for interactive UX and config parsing |
| cmd/cli/util/util.go | Adds helpers to create controller-runtime client / REST config for CLI operations |
| cmd/cli/plugin/util/util.go | Adds config validation + masked input utilities for interactive configuration |
| cmd/cli/plugin/util/util_test.go | Tests config validation behavior |
| cmd/cli/plugin/storage/interface.go | Introduces storage plugin interface, registry, and config validation entrypoints |
| cmd/cli/plugin/storage/interface_test.go | Tests storage registry behaviors (unknown type, registration, fields) |
| cmd/cli/plugin/storage/pvc.go | Adds PVC storage plugin implementation |
| cmd/cli/plugin/storage/pvc_test.go | Tests PVC storage plugin behavior and config validation |
| cmd/cli/plugin/storage/oss.go | Adds OSS storage plugin with Secret/PV/PVC provisioning via controller-runtime client |
| cmd/cli/plugin/source/interface.go | Introduces source plugin interface + registry + validation |
| cmd/cli/plugin/source/interface_test.go | Tests source registry behaviors |
| cmd/cli/plugin/source/huggingface.go | Adds HuggingFace source plugin templating logic |
| cmd/cli/plugin/source/huggingface_test.go | Tests HuggingFace source templating, including injection-safety checks |
| cmd/cli/plugin/source/modelscope.go | Adds ModelScope source plugin templating logic |
| cmd/cli/plugin/source/modelscope_test.go | Tests ModelScope source templating and secret precedence |
| cmd/cli/plugin/engine/interface.go | Introduces engine plugin interface + registry + validation |
| cmd/cli/plugin/engine/interface_test.go | Tests engine registry behaviors |
| cmd/cli/plugin/engine/vllm.go | Adds vLLM engine plugin template generator |
| cmd/cli/plugin/engine/vllm_test.go | Tests vLLM engine config/defaults/template generation |
| cmd/cli/plugin/engine/sglang.go | Adds SGLang engine plugin template generator |
| cmd/cli/plugin/engine/sglang_test.go | Tests SGLang engine config/defaults/template generation |
| cmd/cli/config/config.go | Adds CLI YAML config model + load/save + CRUD for storages/sources/engines |
| cmd/cli/config/config_test.go | Adds tests for config path resolution, load/save, and CRUD behaviors |
| cmd/cli/cmd/llm/llm.go | Registers the llm command and new subcommands; imports plugins for registration side-effects |
| cmd/cli/cmd/llm/llm_test.go | Verifies subcommand registration and expected flags |
| cmd/cli/cmd/llm/utils.go | Adds model-id sanitization and YAML printing helpers |
| cmd/cli/cmd/llm/utils_test.go | Tests model-id sanitization logic |
| cmd/cli/cmd/llm/models.go | Adds llm models job-based storage scanner and table output |
| cmd/cli/cmd/llm/models_test.go | Tests list-models Job construction and no-panic printing |
| cmd/cli/cmd/llm/list.go | Adds llm list command to list CLI-created RoleBasedGroups and print a table |
| cmd/cli/cmd/llm/list_printer.go | Adds tabwriter-based list output formatter |
| cmd/cli/cmd/llm/list_test.go | Tests list command metadata and table formatting |
| cmd/cli/cmd/llm/delete.go | Adds llm delete command to delete RoleBasedGroups by name |
| cmd/cli/cmd/llm/delete_test.go | Tests deletion using fake clientset primitives |
| cmd/cli/cmd/llm/pull_test.go | Adds tests for pull job helpers and injection-safe metadata writing |
| cmd/cli/cmd/llm/run_test.go | Adds tests around run command flags and run context resolution |
| cmd/cli/cmd/llm/run/models.yaml | Adds embedded model/mode presets used by run |
| cmd/cli/cmd/llm/run/model_embed.go | Embeds models.yaml into the binary |
| cmd/cli/cmd/llm/run/model_config.go | Adds model/mode config loader and matcher (exact / wildcard / default) |
| cmd/cli/cmd/llm/metadata/metadata.go | Adds label/annotation constants and RunMetadata struct for CLI-created RBGs |
| cmd/cli/cmd/llm/config/config.go | Adds llm config umbrella command and subcommand wiring |
| cmd/cli/cmd/llm/config/config_test.go | Tests config command wiring and subcommand presence |
| cmd/cli/cmd/llm/config/storage.go | Adds storage config subcommands (add/get/use/set/delete) |
| cmd/cli/cmd/llm/config/storage_test.go | Tests storage config subcommand metadata and flags |
| cmd/cli/cmd/llm/config/source.go | Adds source config subcommands (add/get/use/set/delete) |
| cmd/cli/cmd/llm/config/source_test.go | Tests source config subcommand metadata and flags |
| cmd/cli/cmd/llm/config/engine.go | Adds engine config subcommands (set/get/reset) |
| cmd/cli/cmd/llm/config/engine_test.go | Tests engine config subcommand metadata and flags |
| cmd/cli/cmd/llm/config/misc.go | Adds config view and interactive config init wizard |
| cmd/cli/cmd/llm/config/misc_test.go | Tests interactive helpers (ReadLine/selectPlugin) used by the wizard |
| cmd/cli/cmd/llm/chat/chat.go | Adds llm chat interactive/non-interactive chat client with port-forwarding |
| cmd/cli/cmd/llm/chat/client.go | Implements OpenAI-compatible /v1/chat/completions client (streaming + non-streaming) |
| cmd/cli/cmd/llm/chat/portforward.go | Manages kubectl port-forward subprocess lifecycle |
| cmd/cli/cmd/llm/chat/chat_test.go | Adds tests for chat client, REPL behavior, and helper functions |
| cmd/cli/cmd/llm/benchmark/benchmark.go | Updates benchmark code path to use v1alpha2 RBG API |
| .golangci.yml | Suppresses dupl linter for llm config command files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d9120ff to
cd6b80d
Compare
Ⅰ. Motivation
Ⅱ. Modifications
Ⅲ. Does this pull request fix one issue?
fixes #XXXX
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.