Skip to content

refactor: simplify prefill handling and enhance resource configuratio…#146

Merged
iasthc merged 1 commit intomainfrom
145-simplifiy-creation-of-model-service
Mar 23, 2026
Merged

refactor: simplify prefill handling and enhance resource configuratio…#146
iasthc merged 1 commit intomainfrom
145-simplifiy-creation-of-model-service

Conversation

@ZhangEnYao
Copy link
Copy Markdown
Collaborator

…n in model service creation

@ZhangEnYao ZhangEnYao linked an issue Mar 20, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refactors the model service creation process by simplifying the handling of prefill configurations and enhancing how resources are configured. It introduces dynamic resource allocation logic for decode and prefill steps, centralizes environment variable settings for the engine, and cleans up the UI schema for resource inputs, leading to a more robust and maintainable service creation workflow.

Highlights

  • Simplified Prefill Handling: The prefill configuration is now consistently initialized and managed as an object, removing null assignments for more predictable behavior.
  • Enhanced Resource Configuration: Resource requests and limits for decode and prefill steps are streamlined in the UI, focusing on GPU memory, and dynamically calculated using new transformer functions for better control.
  • Standardized Engine Environment Variables: A new transformer function ensures a consistent set of environment variables are applied for the model engine, improving setup reliability and maintainability.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 refactors the model service creation form by simplifying how prefill data is handled and centralizing resource configuration logic in transformers. The changes are generally good, but I've found an issue with a side effect in one of the new transformer functions that could lead to incorrect state management. My feedback includes a suggestion to fix this.

Comment on lines +562 to +564
} else {
lodash.set(values, 'spec.prefill.resources', {});
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The transformer function should be a pure function that only operates on the value it receives (here, formValue). Modifying the external component-level values state directly is a side effect that can lead to unpredictable behavior and bugs.

The handleSubmit hook for this step already handles clearing the prefill data when the mode is not 'Disaggregation'. To prevent stale data from being present in the form's state when switching modes, you should clean up formValue within the transformer instead of modifying values.

I suggest unsetting the prefill property from formValue.

                        } else {
                            lodash.unset(formValue, 'prefill');
                        }

@iasthc iasthc merged commit d982efd into main Mar 23, 2026
8 checks passed
@iasthc iasthc deleted the 145-simplifiy-creation-of-model-service branch March 23, 2026 05:12
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.

Simplifiy Creation of Model Service

2 participants