pub struct GenerateRequest {Show 35 fields
pub text: Option<String>,
pub model: Option<String>,
pub input_ids: Option<InputIds>,
pub input_embeds: Option<Value>,
pub image_data: Option<Value>,
pub video_data: Option<Value>,
pub audio_data: Option<Value>,
pub sampling_params: Option<SamplingParams>,
pub return_logprob: Option<bool>,
pub logprob_start_len: Option<i32>,
pub top_logprobs_num: Option<i32>,
pub token_ids_logprob: Option<Vec<u32>>,
pub return_text_in_logprobs: bool,
pub stream: bool,
pub log_metrics: bool,
pub return_hidden_states: bool,
pub modalities: Option<Vec<String>>,
pub session_params: Option<HashMap<String, Value>>,
pub lora_path: Option<String>,
pub lora_id: Option<String>,
pub custom_logit_processor: Option<String>,
pub bootstrap_host: Option<String>,
pub bootstrap_port: Option<i32>,
pub bootstrap_room: Option<i32>,
pub bootstrap_pair_key: Option<String>,
pub data_parallel_rank: Option<i32>,
pub background: bool,
pub conversation_id: Option<String>,
pub priority: Option<i32>,
pub extra_key: Option<String>,
pub no_logs: bool,
pub custom_labels: Option<HashMap<String, String>>,
pub return_bytes: bool,
pub return_entropy: bool,
pub rid: Option<String>,
}Fields§
§text: Option<String>Text input - SGLang native format
model: Option<String>§input_ids: Option<InputIds>Input IDs for tokenized input
input_embeds: Option<Value>Input embeddings for direct embedding input Can be a 2D array (single request) or 3D array (batch of requests) Placeholder for future use
image_data: Option<Value>Image input data Can be an image instance, file name, URL, or base64 encoded string Supports single images, lists of images, or nested lists for batch processing Placeholder for future use
video_data: Option<Value>Video input data Can be a file name, URL, or base64 encoded string Supports single videos, lists of videos, or nested lists for batch processing Placeholder for future use
audio_data: Option<Value>Audio input data Can be a file name, URL, or base64 encoded string Supports single audio files, lists of audio, or nested lists for batch processing Placeholder for future use
sampling_params: Option<SamplingParams>Sampling parameters (sglang style)
return_logprob: Option<bool>Whether to return logprobs
logprob_start_len: Option<i32>If return logprobs, the start location in the prompt for returning logprobs.
top_logprobs_num: Option<i32>If return logprobs, the number of top logprobs to return at each position.
token_ids_logprob: Option<Vec<u32>>If return logprobs, the token ids to return logprob for.
return_text_in_logprobs: boolWhether to detokenize tokens in text in the returned logprobs.
stream: boolWhether to stream the response
log_metrics: boolWhether to log metrics for this request (e.g. health_generate calls do not log metrics)
Return model hidden states
modalities: Option<Vec<String>>The modalities of the image data [image, multi-images, video]
session_params: Option<HashMap<String, Value>>Session parameters for continual prompting
lora_path: Option<String>Path to LoRA adapter(s) for model customization
lora_id: Option<String>LoRA adapter ID (if pre-loaded)
custom_logit_processor: Option<String>Custom logit processor for advanced sampling control. Must be a serialized instance
of CustomLogitProcessor in python/sglang/srt/sampling/custom_logit_processor.py
Use the processor’s to_str() method to generate the serialized string.
bootstrap_host: Option<String>For disaggregated inference
bootstrap_port: Option<i32>For disaggregated inference
bootstrap_room: Option<i32>For disaggregated inference
bootstrap_pair_key: Option<String>For disaggregated inference
data_parallel_rank: Option<i32>Data parallel rank routing
background: boolBackground response
conversation_id: Option<String>Conversation ID for tracking
priority: Option<i32>Priority for the request
extra_key: Option<String>Extra key for classifying the request (e.g. cache_salt)
no_logs: boolWhether to disallow logging for this request (e.g. due to ZDR)
custom_labels: Option<HashMap<String, String>>Custom metric labels
return_bytes: boolWhether to return bytes for image generation
return_entropy: boolWhether to return entropy
rid: Option<String>Request ID for tracking (inherited from BaseReq in Python)
Trait Implementations§
Source§impl Clone for GenerateRequest
impl Clone for GenerateRequest
Source§fn clone(&self) -> GenerateRequest
fn clone(&self) -> GenerateRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more