[Rust Frontend][gRPC] Preserve skip_special_tokens decoding option (#52384)
Signed-off-by: Biswa Panda <biswa.panda@gmail.com>
Biswa Panda committed
Aug 15, 2026 at 01:54 UTC
42156466db66f6d54cbea6075af82304cdfdaa6a
2 files changed
+5
-1
rust/proto/inference.proto
+2
@@ -107,6 +107,8 @@ message ResponseOptions {
107
bool output_token_ids = 5;
108
bool output_logprobs = 6;
109
optional CandidateTokens output_candidates = 7;
110
+ // Defaults to true when omitted.
111
+ optional bool skip_special_tokens = 8;
112
}
113
114
message KVCacheParameters {
rust/src/server/src/grpc/convert.rs
+3
-1
@@ -158,7 +158,9 @@ pub fn to_text_request(
158
}
159
160
let decode_options = TextDecodeOptions {
161
- skip_special_tokens: true,
161
+ skip_special_tokens: response
162
+ .and_then(|options| options.skip_special_tokens)
163
+ .unwrap_or(true),
164
include_stop_str_in_output: stopping.is_some_and(|s| s.include_stop_strings),
165
stop_strings: stopping.map(|s| &s.stop_strings).filter(|ss| !ss.is_empty()).cloned(),
166
min_tokens: stopping.map_or(0, |s| s.min_new_tokens),