[sgl-router] Rename chat encoder to chat formatter (#39459)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kan Wu
2026-09-16 08:46:11 -07:00
committed by GitHub
co-authored by Claude Fable 5.1
parent 5aaa18207c
commit ad94978adf
8 changed files with 117 additions and 113 deletions
@@ -6,7 +6,7 @@
//! skips re-tokenizing the same prompt). Asserts the gating contract through
//! the real chat handler + a MockWorker backend:
//!
//! * A plain text chat request on the engine-equivalent chat-encoder path →
//! * A plain text chat request on the engine-equivalent chat-formatter path →
//! the forwarded body carries `input_ids` AND retains `messages`.
//! * A request carrying `tools` → `input_ids` omitted (the router's encoder
//! doesn't render tool schemas, so its ids would diverge from the engine).
@@ -35,8 +35,8 @@ fn build_ctx(url: String) -> Arc<AppContext> {
let cfg = config();
let tokenizers = Arc::new(TokenizerRegistry::load_from_config(&cfg).unwrap());
assert!(
tokenizers.has_chat_encoder(MODEL),
"deepseek-v4 model id must auto-attach the built-in chat encoder"
tokenizers.has_chat_formatter(MODEL),
"deepseek-v4 model id must auto-attach the built-in chat formatter"
);
let registry = Arc::new(WorkerRegistry::default());
let _ = registry.add(WorkerSpec {