Add return routed experts to the completions and chat/completions endpoints (#17434)

This commit is contained in:
Mansoor
2026-01-23 15:12:36 -05:00
committed by GitHub
parent 5438cd20ce
commit bdaa3de075
8 changed files with 225 additions and 33 deletions

View File

@@ -25,6 +25,7 @@ The `/generate` endpoint accepts the following parameters in JSON format. For de
| lora_path | `Optional[Union[List[Optional[str]], Optional[str]]] = None` | The path to the LoRA. |
| custom_logit_processor | `Optional[Union[List[Optional[str]], str]] = None` | Custom logit processor for advanced sampling control. Must be a serialized instance of `CustomLogitProcessor` using its `to_str()` method. For usage see below. |
| return_hidden_states | `Union[List[bool], bool] = False` | Whether to return hidden states. |
| return_routed_experts | `bool = False` | Whether to return routed experts for MoE models. Requires `--enable-return-routed-experts` server flag. Returns base64-encoded int32 expert IDs as a flattened array with logical shape `[num_tokens, num_layers, top_k]`. |
## Sampling parameters