LiteLLM async requests omit the configured EOS stop sequence

Author: sdivyanshu90Created Sep 29, 2026Updated Sep 29, 2026

Summary

The LiteLLM backend includes its configured tokenizer/EOS stop sequence in synchronous request payloads, but omits the same value when requests are sent through the asynchronous path. Enabling num_concurrent > 1 can therefore change generation stopping behavior for an otherwise identical evaluation.

Reproduction

Create a LiteLLM model with an explicit EOS string and capture the payloads sent by the sync and async request methods:

python
model = LiteLLMChatCompletion(
    model="gpt-4o-mini",
    eos_string="<EOS>",
    num_concurrent=2,
)

For identical generation arguments, the shared payload builder receives:

sync:  eos="<EOS>"
async: eos argument missing

The resulting synchronous payload contains stop: ["<EOS>"], while the asynchronous payload does not include that EOS stop unless it also happens to be supplied by the task's until setting.

Expected behavior

Sync and async LiteLLM requests should construct semantically identical generation payloads. The configured EOS string should be merged into stop sequences in both paths.

Root cause and impact

The synchronous method passes eos=self.eos_string to the inherited payload builder. The asynchronous method passes the same generation arguments and seed but omits eos. The payload builder already handles EOS merging correctly, so the async path bypasses existing behavior rather than requiring new stop logic.

This can let concurrent requests generate beyond the model-specific stop used by serial requests, changing output length, extracted answers, token usage, and evaluation scores solely because concurrency was enabled.

Proposed resolution

Forward self.eos_string from the async method just as the sync method does, and add a regression test that compares the actual sync and async LiteLLM payload stop lists.

Source: EleutherAI/lm-evaluation-harness