-
Notifications
You must be signed in to change notification settings - Fork 81
fix(configure): handle mode embedding #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adds support for specifying the backend inference mode (completion or embedding) by extending the ConfigureRequest API and propagating the requested mode through the scheduler’s configuration logic instead of using the hard-coded completion mode. Sequence diagram for model configuration with mode supportsequenceDiagram
participant "compose (caller)"
participant "Scheduler"
participant "ModelManager"
participant "Loader"
"compose (caller)"->>Scheduler: POST /configure {Model, Mode, ...}
Scheduler->>ModelManager: GetModel(Model)
ModelManager-->>Scheduler: Model
Scheduler->>ModelManager: ResolveModelID(Model)
ModelManager-->>Scheduler: modelID
Scheduler->>Loader: setRunnerConfig(ctx, backend, modelID, Mode, runnerConfig)
Loader-->>Scheduler: (success or error)
Scheduler-->>"compose (caller)": Response
Class diagram for updated ConfigureRequest and Scheduler configurationclassDiagram
class ConfigureRequest {
+string Model
+string Mode
+int64 ContextSize
+[]string RuntimeFlags
+string RawRuntimeFlags
}
class Scheduler {
+Configure(w http.ResponseWriter, r *http.Request)
}
ConfigureRequest --> Scheduler : used in
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for handling embedding mode in the model configuration by introducing a Mode field to the ConfigureRequest struct and using a mode parser to determine the appropriate backend mode instead of hardcoding completion mode.
- Added
Modefield toConfigureRequeststruct to accept mode configuration - Implemented mode parsing logic to convert string mode to
BackendModeenum - Updated scheduler configuration to use parsed mode instead of hardcoded completion mode
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/inference/scheduling/api.go | Added Mode field to ConfigureRequest struct |
| pkg/inference/scheduling/scheduler.go | Updated Configure method to parse and use the mode from request |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary of ChangesHello @doringeman, 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 implements a crucial update to the model configuration API by introducing a Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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 introduces a Mode field to the ConfigureRequest to allow specifying whether a model should be configured for completion or embedding. The change correctly propagates this new mode to the runner configuration, replacing the previously hardcoded completion mode. My main feedback is to consider making the mode parsing stricter. Currently, an invalid mode string will silently default to completion, which could hide configuration errors from the user. It would be more robust to return an error for invalid modes.
Signed-off-by: Dorin Geman <[email protected]>
e1b36f5 to
d0ff172
Compare
<!--Delete sections as needed --> ## Description <!-- Tell us what you did and why --> ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> docker/model-runner#166 fixed in docker/model-runner#189. ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review Signed-off-by: Dorin Geman <[email protected]>
Part of a set of changes required to fix #166.
Next, I'll need to patch docker/model-cli, docker/compose-spec and docker/compose.In docker/model-cli I need to add a new flag--mode <completion|embedding> (default: completion).In docker/compose-spec I plan to add
modepart of ModelConfig. Now, the latter, together with the docker/model-cli change will be used in docker/compose to configure the model ondocker compose up.(I pushed to a branch in docker/model-runner so I can use this reference in docker/model-cli.)E.g.,
Note: The flag is now added twice, but it doesn't break llama.cpp.
E.g.,
Summary by Sourcery
Introduce a 'mode' parameter in the ConfigureRequest API and use it to determine the backend mode when configuring the model runner instead of always defaulting to completion mode.
Bug Fixes:
Enhancements: