Skip to content

Set --auto-truncate to true by default#829

Merged
alvarobartt merged 1 commit intomainfrom
auto-truncate-by-default
Feb 17, 2026
Merged

Set --auto-truncate to true by default#829
alvarobartt merged 1 commit intomainfrom
auto-truncate-by-default

Conversation

@alvarobartt
Copy link
Member

What does this PR do?

This PR sets the default value of --auto-truncate to true instead of false and instead of anyhow::bail! it just prints a tracing::warn! message when --auto-truncate false and the --max-batch-tokens is lower than the maximum input length. This PR helps reduce the failures when the model maximum input length is greater than the default --max-batch-tokens, leading to an increased deployment success rate on models without any arg other than the --model-id.

Thanks @vrdn-23, @michaelfeil and @kozistr for the feedback!

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines.
  • Did you write any new necessary tests? If applicable, did you include or update the insta snapshots?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@alvarobartt alvarobartt added this to the v1.9.0 milestone Feb 16, 2026
Copy link
Contributor

@kozistr kozistr left a comment

Choose a reason for hiding this comment

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

looks good to me!

// Raise an error when max_input_length is bigger than max_batch tokens to prevent an infinite loop in the queue
let max_input_length = if base_input_length > max_batch_tokens {
if !auto_truncate {
anyhow::bail!(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe, we could change this to tracing::warn if we want to do it silently!

Suggested change
anyhow::bail!(
tracing::warn!(

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that given than now --auto-truncate defaults to true, this will only panic when --auto-truncate false is provided and the max-model-len is greater than the --max-batch-tokens, so failing makes sense! The warning message would only apply when --auto-truncate is true or not provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh you're right. I misunderstood for a moment, thought it shouldn't be a panic when auto-truncate is false. Thanks for checking it!

@alvarobartt alvarobartt merged commit c78895c into main Feb 17, 2026
16 checks passed
@alvarobartt alvarobartt deleted the auto-truncate-by-default branch February 17, 2026 11:32
@vrdn-23 vrdn-23 mentioned this pull request Feb 20, 2026
5 tasks
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.

2 participants