Skip to content

fix(model): restore implicit defaults for model identifiers#640

Open
Pnkcaht wants to merge 2 commits intodocker:mainfrom
Pnkcaht:modelID
Open

fix(model): restore implicit defaults for model identifiers#640
Pnkcaht wants to merge 2 commits intodocker:mainfrom
Pnkcaht:modelID

Conversation

@Pnkcaht
Copy link
Contributor

@Pnkcaht Pnkcaht commented Feb 5, 2026

What is changed

  • Normalize shorthand model identifiers in docker model run, restoring implicit defaults and fixing model resolution.

Related issue

Diagram

flowchart LR
    A[docker model list] -->|mxbai-embed-large| B[docker model run]
    B --> C[normalizeModelIdentifier]
    C --> D[ai/mxbai-embed-large:latest]
    D --> E[Model Runner Engine]
Loading

Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Pnkcaht, 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 enhances the user experience for the docker model run command by introducing a mechanism to correctly interpret shorthand model identifiers. It ensures that users can provide simplified model names, which are then automatically expanded to their full, qualified form, thereby restoring implicit default values for organization and tags and fixing model resolution issues.

Highlights

  • Model Identifier Normalization: A new function, normalizeModelIdentifier, has been introduced to expand shorthand model references (e.g., 'mxbai-embed-large') into fully qualified identifiers (e.g., 'ai/mxbai-embed-large:latest') by restoring implicit default organization and tag values.
  • docker model run Command Update: The docker model run command now utilizes the normalizeModelIdentifier function to process user-provided model arguments, ensuring consistent model resolution and fixing issues with implicit defaults.

🧠 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
  • cmd/cli/commands/run.go
    • The RunE function for the newRunCmd now calls normalizeModelIdentifier on the first argument (args[0]) before assigning it to the model variable.
  • cmd/cli/commands/utils.go
    • Added a new function normalizeModelIdentifier which takes a model string and, if missing, prepends defaultOrg and appends defaultTag to create a fully qualified model identifier.
    • Added comments explaining the purpose and behavior of the normalizeModelIdentifier function, emphasizing round-trip consistency between docker model list output and subsequent CLI commands.
Activity
  • The pull request introduces a new feature to normalize model identifiers.
  • A new function normalizeModelIdentifier has been added to handle the expansion of shorthand model references.
  • The docker model run command has been updated to use this new normalization logic.
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.

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 reviewed your changes and they look great!


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 normalizeModelIdentifier function to restore implicit default organization and tags for model identifiers, which is a good improvement for user experience. The implementation correctly handles adding the default organization. However, the logic for adding the default tag has a potential issue where it can confuse a port in a registry hostname with a model tag. I've suggested a more robust check to handle this edge case.

Update strings.Contains in utils.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

Model ID naming issues

1 participant