Skip to content

feat: add default runner configuration if none exists#621

Merged
ericcurtin merged 2 commits intomainfrom
add-default-runner-config
Feb 3, 2026
Merged

feat: add default runner configuration if none exists#621
ericcurtin merged 2 commits intomainfrom
add-default-runner-config

Conversation

@ilopezluna
Copy link
Contributor

Fixes #407

In Docker Desktop the context size field is expected to be found when showing request/responses:

const baseRecord = {
            id: request.id,
            model: requestData.model,
            contextSize: response.config?.['context-size'] || 4096,
            timestamp: parseInt(request.timestamp, 10),
            statusCode: request.status_code,
            request: requestData,
          };

When no explicit configuration call has been made, there is no runner configuration, so the field response.config.context-size is not populated.
This PR fixes that.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ilopezluna, 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 resolves an issue where the context-size field was not consistently present in the runner configuration, which is crucial for Docker Desktop's request/response display. It implements a mechanism to automatically generate a default runner configuration, populating it with the model's inherent context size, whenever an explicit configuration is absent. This ensures that all necessary configuration details are consistently available for reporting and user interface purposes.

Highlights

  • Default Runner Configuration: Introduced logic to create a default runner configuration if no explicit configuration is provided, ensuring that essential model parameters are always available.
  • Context Size Population: The default configuration now automatically retrieves and populates the context-size from the model's bundle runtime configuration, addressing an issue where this field was missing for display in Docker Desktop.
  • Code Refactoring: Performed a minor refactoring in the BundleForModel function within pkg/distribution/internal/store/bundles.go to simplify the error handling and return logic.

🧠 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.

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.

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

  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.

@ilopezluna ilopezluna requested a review from a team February 2, 2026 10:07
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The nested conditionals when building the default runnerConfig in loader.load are quite deep; consider extracting this logic into a small helper (e.g., defaultBackendConfigFromBundle(modelManager, modelID)) to make the flow easier to follow and to keep load() focused on orchestration.
  • Calling modelManager.GetBundle(modelID) inside load for the default config may introduce extra I/O or parsing; if a bundle is already available in this code path, consider reusing it or caching to avoid redundant bundle loading.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The nested conditionals when building the default runnerConfig in loader.load are quite deep; consider extracting this logic into a small helper (e.g., `defaultBackendConfigFromBundle(modelManager, modelID)`) to make the flow easier to follow and to keep load() focused on orchestration.
- Calling `modelManager.GetBundle(modelID)` inside `load` for the default config may introduce extra I/O or parsing; if a bundle is already available in this code path, consider reusing it or caching to avoid redundant bundle loading.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
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 introduces a feature to create a default runner configuration if one doesn't exist, primarily to ensure the context-size is available. The change in pkg/distribution/internal/store/bundles.go is a good stylistic refactoring. My main feedback is on pkg/inference/scheduling/loader.go, where the new logic can be improved by adding error logging and reducing code nesting for better readability and maintainability.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ericcurtin ericcurtin merged commit 6aca887 into main Feb 3, 2026
11 checks passed
@ericcurtin ericcurtin deleted the add-default-runner-config branch February 3, 2026 11:44
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.

Context size mismatch

2 participants