Skip to content

add the rust server tokenizer, detokenizer, and egress modules - #32872

Merged
merrymercy merged 2 commits into
mainfrom
rainj-me/rust-server-tokenization
Jul 30, 2026
Merged

merrymercy merged 2 commits into
mainfrom
rainj-me/rust-server-tokenization

Conversation

@rainj-me

@rainj-me rainj-me commented Jul 30, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Modifications

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ✅ Run #30511448692
Latest PR Test (Extra): ❌ Run #30512245462

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@rainj-me
rainj-me marked this pull request as ready for review July 30, 2026 03:31
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@rainj-me
rainj-me force-pushed the rainj-me/rust-server-tokenization branch from 53c9b4d to 029e8c9 Compare July 30, 2026 03:32
@rainj-me rainj-me mentioned this pull request Jul 30, 2026
13 of 30 tasks
@rainj-me rainj-me added the run-ci CI: run the baseline test suite on this PR label Jul 30, 2026
Base automatically changed from rainj-me/rust-server-cargo-lock to main July 30, 2026 19:32
@merrymercy
merrymercy merged commit 922d6e5 into main Jul 30, 2026
152 of 206 checks passed
@merrymercy
merrymercy deleted the rainj-me/rust-server-tokenization branch July 30, 2026 19:46
// Token id 0 is NOT a match: Python guards with `if not matched`, and 0 is
// falsy there, so it trims nothing. Trimming on 0 drops a real generated token
// for any model whose stop id happens to be 0.
if !no_stop_trim && matches!(matched, Some(Matched::Token(t)) if *t != 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can matched be Matched::Tokens(Vec) here?

let _ = st.sink.try_send(EgressItem::Control(payload));
// Egress FSM: a control request goes straight to Completed (no Streaming
// / Finalizing states — single response, never streamed).
st.fsm = RequestState::Completed;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: dead code, st was removed from table then immediately dropped.

let _ = st
.sink
.try_send(EgressItem::Error(Error::Internal(message)));
st.fsm = RequestState::Completed;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants