Skip to content

Update doc for server arguments #2742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
452a766
Added model arguments
simveit Jan 4, 2025
0a288d7
Added sections on tensor and data parallelism
simveit Jan 6, 2025
b939c56
Shortened existing texts, added more parameters
simveit Jan 8, 2025
9084cfe
Merge remote-tracking branch 'upstream/main' into feature/server-argu…
simveit Jan 9, 2025
4c0ae15
Added arguments
simveit Jan 12, 2025
17819d2
Merge remote-tracking branch 'upstream/main' into feature/server-argu…
simveit Jan 12, 2025
49b0815
Merge remote-tracking branch 'origin/feature/server-arguments-docs' i…
simveit Jan 12, 2025
5cf32be
Merge branch 'main' into feature/server-arguments-docs
zhaochenyang20 Jan 14, 2025
15a3e87
Merge branch 'sgl-project:main' into feature/server-arguments-docs
simveit Jan 15, 2025
ce845c4
Adjusted descriptions
simveit Jan 15, 2025
efa4e9c
Merge branch 'sgl-project:main' into feature/server-arguments-docs
simveit Jan 16, 2025
d190c6e
Merge branch 'feature/server-arguments-docs' of github.com:simveit/sg…
simveit Jan 16, 2025
30e818e
Completed all arguments
simveit Jan 16, 2025
8759299
Remove argument
simveit Jan 16, 2025
342aa20
Refined argument description
simveit Jan 18, 2025
95ce466
Merge branch 'main' into feature/server-arguments-docs
simveit Jan 18, 2025
452acac
Adjusted descriptions.
simveit Jan 18, 2025
9e4788b
Merge branch 'main' into feature/server-arguments-docs
zhaochenyang20 Jan 18, 2025
9d20887
Merge branch 'main' into feature/server-arguments-docs
zhyncs Jan 20, 2025
e5ef947
Merge branch 'main' into feature/server-arguments-docs
simveit Jan 23, 2025
3e64a3f
Added common launch commands from previous doc.
simveit Jan 23, 2025
93ae630
Merge branch 'feature/server-arguments-docs' of github.com:simveit/sg…
simveit Jan 23, 2025
4425c28
Linted
simveit Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/backend/server_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In this document we aim to give an overview of the possible arguments when deplo
* `kv_cache_dtype`: Dtype of the kv cache, defaults to the `dtype`.
* `context_length`: The number of tokens our model can process *including the input*. Not that extending the default might lead to strange behavior.
* `device`: The device we put the model, defaults to `cuda`.
* `chat_template`: The chat template to use. Deviating from the default might lead to unexpected responses.
* `chat_template`: The chat template to use. Deviating from the default might lead to unexpected responses. For multi-modal chat templates, refer to [here](https://docs.sglang.ai/backend/openai_api_vision.html#Chat-Template).
* `is_embedding`: Set to true to perform [embedding](https://docs.sglang.ai/backend/openai_api_embeddings.html) / [enocode](https://docs.sglang.ai/backend/native_api.html#Encode-(embedding-model)) and [reward](https://docs.sglang.ai/backend/native_api.html#Classify-(reward-model)) tasks.
* `revision`: Adjust if a specific version of the model should be used.
* `skip_tokenizer_init`: Set to true to provide the tokens to the engine and get the output tokens directly, typically used in RLHF.
Expand All @@ -28,7 +28,7 @@ In this document we aim to give an overview of the possible arguments when deplo

### API configuration

* `api_key`: Sets an API key for the server or the OpenAI-compatible API.
* `api_key`: Sets an API key for the server and the OpenAI-compatible API.
* `file_storage_pth`: Directory for storing uploaded or generated files from API calls.
* `enable_cache_report`: If set, includes detailed usage of cached tokens in the response usage.

Expand All @@ -49,10 +49,10 @@ In this document we aim to give an overview of the possible arguments when deplo

## Memory and scheduling

* `mem_fraction_static`: Fraction of the free GPU memory used for static memory like model weights and KV cache. If build KV cache failed, should be increased. In case of OOM should be decreased.
* `mem_fraction_static`: Fraction of the free GPU memory used for static memory like model weights and KV cache. If building KV cache fails, it should be increased. If CUDA runs out of memory, it should be decreased.
* `max_running_requests`: The maximum number of requests to run concurrently.
* `max_total_tokens`: The maximum number of tokens that can be stored into the KV cache. Use mainly for debugging.
* `chunked_prefill_size`: Perform the prefill in chunks of these size. Larger chunk size speeds up the prefill phase but increases the VRAM consumption. In case of OOM should be decreased.
* `chunked_prefill_size`: Perform the prefill in chunks of these size. Larger chunk size speeds up the prefill phase but increases the VRAM consumption. If CUDA runs out of memory, it should be decreased.
* `max_prefill_tokens`: Token budget of how many tokens to accept in one prefill batch. The actual number is the max of this parameter and the `context_length`.
* `schedule_policy`: The scheduling policy to control the processing order of waiting prefill requests in a single engine.
* `schedule_conservativeness`: Can be used to decrease/increase the conservativeness of the server when taking new requests. Highly conservative behavior leads to starvation, but low conservativeness leads to slowed-down performance.
Expand All @@ -66,7 +66,7 @@ In this document we aim to give an overview of the possible arguments when deplo
* `watchdog_timeout`: Adjusts the watchdog thread’s timeout before killing the server if batch generation takes too long.
* `download_dir`: Use to override the default Hugging Face cache directory for model weights.
* `base_gpu_id`: Use to adjust first GPU used to distribute the model across available GPUs.

* `allow_auto_truncate`: Automatically truncate requests that exceed the maximum input length.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!


## Logging

Expand All @@ -86,7 +86,7 @@ In this document we aim to give an overview of the possible arguments when deplo

## LoRA

* `lora_paths`: You may provide a list of adapters to your model as a list. Each batch element will get model response with the corresponding lora adapter applied. Currently `cuda_graph` and `radix_attention` are not supportet with this option so you need to disable them manually. We are still working on through these [issues](https://github.com/sgl-project/sglang/issues?q=is%3Aissue%20lora%20).
* `lora_paths`: You may provide a list of adapters to your model as a list. Each batch element will get model response with the corresponding lora adapter applied. Currently `cuda_graph` and `radix_attention` are not supportet with this option so you need to disable them manually. We are still working on through these [issues](https://github.com/sgl-project/sglang/issues/2929).
* `max_loras_per_batch`: Maximum number of LoRAs in a running batch including base model.

## Kernel backend
Expand All @@ -97,6 +97,7 @@ In this document we aim to give an overview of the possible arguments when deplo
## Constrained Decoding

* `grammar_backend`: The grammar backend for constraint decoding. Detailed usage can be found in this [document](https://docs.sglang.ai/backend/structured_outputs.html).
* `constrained_json_whitespace_pattern`: Use with `Outlines` grammar backend to allow JSON with syntatic newlines, tabs or multiple spaces. Details can be found [here](https://dottxt-ai.github.io/outlines/latest/reference/generation/json/#using-pydantic).

## Speculative decoding

Expand Down
Loading