Skip to content

Add stream interval#9

Open
quan-deepinfra wants to merge 2 commits intoreleases/v0.15.1from
add-stream-interval
Open

Add stream interval#9
quan-deepinfra wants to merge 2 commits intoreleases/v0.15.1from
add-stream-interval

Conversation

@quan-deepinfra
Copy link

@quan-deepinfra quan-deepinfra commented Feb 6, 2026

Purpose

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

…rottling

Add per-request stream_interval (token-count) and stream_interval_ms
(time-based, in milliseconds) to the OpenAI API's StreamOptions. This
allows clients to control streaming granularity per request without
changing server config.

- Add stream_interval and stream_interval_ms fields to StreamOptions
  in the OpenAI-compatible API protocol
- Add stream_interval_ms global config to SchedulerConfig with
  --stream-interval-ms CLI argument (default 0, disabled)
- Add optional stream_interval and stream_interval_ms fields to
  SamplingParams for per-request overrides
- Inject stream_options values into SamplingParams in both
  chat completion and completion serving layers
- Implement "whichever first" emission logic in OutputProcessor:
  when both token-count and time-based intervals are configured,
  emit on whichever threshold is reached first
- Per-request values override global config; if not specified,
  fall back to global defaults (stream every 1 token, no time limit)

Signed-off-by: Quan Truong <quan@deepinfra.com>
…hrottling

Add three tests for the stream interval feature:
- test_stream_interval_ms: validates time-based throttling at global level
- test_per_request_stream_interval_override: validates per-request
  token-count override via SamplingParams
- test_both_intervals_whichever_first: validates combined token+time
  "whichever first" emission logic

Signed-off-by: Quan Truong <quan@deepinfra.com>
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

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