Skip to content

Conversation

@ekcasey
Copy link
Contributor

@ekcasey ekcasey commented Jun 25, 2025

@ekcasey ekcasey requested a review from xenoscopic June 27, 2025 15:37
@ekcasey ekcasey marked this pull request as ready for review June 27, 2025 15:38
Comment on lines 61 to 71
if modelCfg.ContextSize != nil {
args = append(args, "--ctx-size", strconv.FormatUint(*modelCfg.ContextSize, 10))
}

// Add arguments from backend config
if config != nil {
if config.ContextSize > 0 && !containsArg(args, "--ctx-size") {
args = append(args, "--ctx-size", fmt.Sprintf("%d", config.ContextSize))
}
args = append(args, config.RuntimeFlags...)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would unify the number-to-string conversion; strconv.Itoa is probably the most efficient (vs. strconv.FormatUint or fmt.Sprintf).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can use strconv.FormatInt and strconv.FormatUint for the backend config and artifact config respectively. strconv.Itoa accepts an int type rather than an int64. I was assuming we chose int64 in the backend config for a reason and wouldn't want to risk losing precision.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, roger that.

ekcasey and others added 2 commits June 27, 2025 10:47
Signed-off-by: Emily Casey <[email protected]>

Co-authored-by: Jacob Howard <[email protected]>
Signed-off-by: Emily Casey <[email protected]>
@ekcasey ekcasey requested a review from xenoscopic June 27, 2025 16:57
@ekcasey ekcasey merged commit de1ef38 into main Jun 27, 2025
4 checks passed
@ekcasey ekcasey deleted the context-size branch June 27, 2025 17:06
doringeman pushed a commit to doringeman/model-runner that referenced this pull request Oct 2, 2025
Enable automatic API version negotiation for the Docker client
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.

3 participants