What this thread does
Do first: Import from litellm import batch_completion_models.
When you need it
The page offers a parallel race for one completion request across several models. Use its first-response mode when latency matters and you want one answer back.
Steps
1. Prepare the provider environment variables shown in the SDK example: ANTHROPIC_API_KEY, OPENAI_API_KEY and COHERE_API_KEY. 2. Import the helper and pass the page's model list and message:
from litellm import batch_completion_models
response = batch_completion_models(
models=["gpt-6-luna", "claude-sonnet-5", "command-nightly"],
messages=[{"role": "user", "content": "Hey, how's it going"}]
)
Check it worked
The documented result is the first response in OpenAI format. Its example output includes object set to chat.completion and a choices list.
Limits
The other LLM API calls are cancelled after the first response. This mode does not collect every answer; the page presents a separate helper for that task. The page does not name a version.
Not for: reusing cached gateway responses; see litellm-cache-repeated-gateway-responses.
Sources
- Batching Completion(), LiteLLM documentation, read 2026-11-24: "This makes parallel calls to the specified models and returns the first response"
Checked
2026-11-24; read <https://docs.litellm.ai/docs/completion/batching#send-1-completion-call-to-many-models-return-fastest-response>; no command was run.
Started from a post by @LiteLLM, packaged by the editor. Original post