Repository navigation
feat(grpc): add TokenSpeed gRPC backend end-to-end #1367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: 'Setup TokenSpeed Backend' | ||
| description: 'Create Python venv and install TokenSpeed (engine + kernel + scheduler) from source.' | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Setup Python venv | ||
| shell: bash | ||
| run: bash scripts/ci_setup_python_venv.sh | ||
|
|
||
| - name: Install TokenSpeed | ||
| shell: bash | ||
| run: bash scripts/ci_install_tokenspeed.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package tokenspeed.grpc.scheduler; | ||
|
|
||
| import "sglang_scheduler.proto"; | ||
| import "common.proto"; | ||
|
|
||
| // Service definition for TokenSpeed scheduler communication. | ||
| // | ||
| // Wire-level identity (package, service name) is distinct from SGLang so the | ||
| // gateway's backend detector, metrics, and operator tooling can tell a | ||
| // TokenSpeed worker apart from a real SGLang worker. Messages currently | ||
| // piggy-back on the SGLang proto via ``import`` because the two backends | ||
| // happen to share the same tokenized-request shape, sampling-param naming, | ||
| // and output-dict layout today — any future divergence (new fields, changed | ||
| // semantics) should land as a TokenSpeed-specific message defined here, not | ||
| // by mutating the shared SGLang message in-place. | ||
| service TokenSpeedScheduler { | ||
| rpc Generate(sglang.grpc.scheduler.GenerateRequest) | ||
| returns (stream sglang.grpc.scheduler.GenerateResponse); | ||
|
|
||
| rpc Embed(sglang.grpc.scheduler.EmbedRequest) | ||
| returns (sglang.grpc.scheduler.EmbedResponse); | ||
|
|
||
| rpc HealthCheck(sglang.grpc.scheduler.HealthCheckRequest) | ||
| returns (sglang.grpc.scheduler.HealthCheckResponse); | ||
|
|
||
| rpc Abort(sglang.grpc.scheduler.AbortRequest) | ||
| returns (sglang.grpc.scheduler.AbortResponse); | ||
|
|
||
| rpc GetModelInfo(sglang.grpc.scheduler.GetModelInfoRequest) | ||
| returns (sglang.grpc.scheduler.GetModelInfoResponse); | ||
|
|
||
| rpc GetServerInfo(sglang.grpc.scheduler.GetServerInfoRequest) | ||
| returns (sglang.grpc.scheduler.GetServerInfoResponse); | ||
|
|
||
| rpc GetLoads(sglang.grpc.scheduler.GetLoadsRequest) | ||
| returns (sglang.grpc.scheduler.GetLoadsResponse); | ||
|
|
||
| rpc GetTokenizer(smg.grpc.common.GetTokenizerRequest) | ||
| returns (stream smg.grpc.common.GetTokenizerChunk); | ||
|
|
||
| rpc SubscribeKvEvents(smg.grpc.common.SubscribeKvEventsRequest) | ||
| returns (stream smg.grpc.common.KvEventBatch); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
LGTM — 60-min timeout reasonable for from-source builds; consider caching in a follow-up.
The matrix addition is well-scoped and the timeout budget matches the documented build cost. If the installer script ends up dominating CI time, a follow-up that caches the TokenSpeed kernel/scheduler build outputs (keyed on
scripts/ci_install_tokenspeed.shhash) would materially speed up most runs. Not a blocker for this PR.🤖 Prompt for AI Agents