Overview
EmbeddingGemma is Google’s 300M-parameter text embedding model. SGLang detects its bidirectional Gemma 3 encoder, applies normalized mean pooling, and serves embeddings through the OpenAI-compatible/v1/embeddings endpoint.
On NVIDIA CUDA, SGLang uses breakable CUDA graph (BCG) for its complete prefill by default. It also disables prefix caching and chunked prefill, which are incompatible with this bidirectional encoder.
Prerequisites
- NVIDIA CUDA GPU.
- A Hugging Face account that has accepted the EmbeddingGemma license.
- A Hugging Face access token. Export it before starting the server so it can download the gated checkpoint:
Start the server
The standard configuration detects EmbeddingGemma and enables embedding mode, BCG, and the checkpoint’s BF16 dtype automatically:Hopper performance defaults
On H100 and H200, SGLang automatically selects FA3 and captures BCG through 16,384 tokens, covering eight 2K embedding requests in one replay. No extra performance flags are required for this workload. To capture larger aggregate prefills, raise the BCG tier explicitly:Create embeddings
Send one string or a batch of strings to the OpenAI-compatible endpoint:Deployment behavior
EmbeddingGemma performs bidirectional attention over the complete input, so reusing a prefix KV cache or splitting the input into chunked prefills would produce incorrect attention states. SGLang applies the required settings automatically:- disables RadixAttention prefix caching;
- disables chunked prefill;
- disables the decode CUDA graph because this is an embedding-only model;
- uses BCG for CUDA prefill;
- uses the FlashAttention raw-K/V path when the prefill backend is FA3 or FA4 on supported Hopper and Blackwell CUDA GPUs.
