Skip to content

[None][feat] Add per-request stream_interval_ms support#5

Open
quan-deepinfra wants to merge 3 commits intodeep-main-v1.3.0rc5-eagle3-k25visionfrom
interval-ms
Open

[None][feat] Add per-request stream_interval_ms support#5
quan-deepinfra wants to merge 3 commits intodeep-main-v1.3.0rc5-eagle3-k25visionfrom
interval-ms

Conversation

@quan-deepinfra
Copy link
Copy Markdown

No description provided.


# TODO: make this a per-request parameter
stream_interval: int = Field(
default=1,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

add validator here

@@ -3225,10 +3227,6 @@
if self.stream_interval <= 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

then you can remove this

)

# Resolve effective intervals (per-request > engine > default)
token_interval = request.py_stream_interval or self.stream_interval
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

move out of loop[

# Check triggers
token_triggered = request.py_last_stream_emit_iter >= token_interval
time_triggered = (
time_interval_ms > 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

reformat

quan-deepinfra and others added 3 commits April 5, 2026 23:57
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Quan Truong <quan@deepinfra.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Quan Truong <quan@deepinfra.com>
…dd type annotation

Replace model_validator with ge=1 on Field for stream_interval.
Add Optional[float] type annotation to py_last_stream_emit_time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Quan Truong <quan@deepinfra.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.

2 participants