Summary
LiteLLM's Python SDK ships a documented batch-inference execution surface — litellm.batch_completion() — which fans a single set of messages (or a list of prompt lists) out to concurrent completion() calls across one or more models and returns the list of responses. The Braintrust LiteLLM integration (py/src/braintrust/integrations/litellm/) instruments 18 top-level LiteLLM entry points (completion/acompletion, text_completion/atext_completion, responses/aresponses, image_generation/aimage_generation, embedding/aembedding, moderation/amoderation, speech/aspeech, transcription/atranscription, rerank/arerank), but has no patcher for batch_completion, batch_completion_models, or batch_completion_models_all_responses. Calls made through these batch entry points produce zero Braintrust spans — no input/output, no token usage, no cost.
What is missing
| LiteLLM function |
Description |
Instrumented? |
litellm.completion / .acompletion |
Single-call chat completion |
Yes |
litellm.batch_completion |
Fans a list of message lists out to concurrent completion() calls against one model, returns list of responses |
No |
litellm.batch_completion_models |
Parallel calls across multiple models, returns first response |
No |
litellm.batch_completion_models_all_responses |
Parallel calls across multiple models, returns all responses |
No |
Source of the function list: litellm/batch_completion/main.py and the Batching Completion() docs:
from litellm import batch_completion
responses = batch_completion(
model="claude-2",
messages=[
[{"role": "user", "content": "good morning?"}],
[{"role": "user", "content": "what's the time?"}],
],
)
Each element of messages is dispatched as an independent completion()-shaped call (concurrently, via a thread pool, max_workers configurable), so this is a distinct execution surface from the already-instrumented single-shot completion/acompletion, not just a client-side loop the user writes themselves — the concurrency and result aggregation happen inside LiteLLM.
Braintrust docs status
not_found. The Braintrust LiteLLM integration page states Braintrust "patches LiteLLM's top-level call entry points and creates an LLM-typed span per call," and explicitly lists the entry points covered: completion, acompletion, text_completion, atext_completion, responses, aresponses, image_generation, aimage_generation, embedding, aembedding, moderation, amoderation, speech, aspeech, transcription, atranscription, rerank, arerank. batch_completion and its variants are not mentioned anywhere on the page.
Upstream sources
Local repo files inspected
py/src/braintrust/integrations/litellm/patchers.py — defines LiteLLMCompletionPatcher through LiteLLMArerankPatcher (18 patchers total); no batch_completion patcher exists. Grep for batch_completion across the entire litellm/ integration directory returns zero matches.
py/src/braintrust/integrations/litellm/integration.py — LiteLLMIntegration.patchers = _ALL_LITELLM_PATCHERS, sourced entirely from patchers.py.
py/src/braintrust/integrations/litellm/tracing.py — wrapper implementations for all 18 patched entry points; no batch_completion wrapper.
py/src/braintrust/integrations/litellm/test_litellm.py — test_litellm_async_parallel_requests exercises concurrent acompletion() calls via asyncio.gather, not the batch_completion API; no test references batch_completion.
py/pyproject.toml [tool.braintrust.matrix.litellm] (line 398-402): latest = "litellm==1.100.0", floor "1.74.0" = "litellm==1.74.0" — both versions ship batch_completion.
Summary
LiteLLM's Python SDK ships a documented batch-inference execution surface —
litellm.batch_completion()— which fans a single set ofmessages(or a list of prompt lists) out to concurrentcompletion()calls across one or more models and returns the list of responses. The Braintrust LiteLLM integration (py/src/braintrust/integrations/litellm/) instruments 18 top-level LiteLLM entry points (completion/acompletion,text_completion/atext_completion,responses/aresponses,image_generation/aimage_generation,embedding/aembedding,moderation/amoderation,speech/aspeech,transcription/atranscription,rerank/arerank), but has no patcher forbatch_completion,batch_completion_models, orbatch_completion_models_all_responses. Calls made through these batch entry points produce zero Braintrust spans — no input/output, no token usage, no cost.What is missing
litellm.completion/.acompletionlitellm.batch_completioncompletion()calls against one model, returns list of responseslitellm.batch_completion_modelslitellm.batch_completion_models_all_responsesSource of the function list:
litellm/batch_completion/main.pyand the Batching Completion() docs:Each element of
messagesis dispatched as an independentcompletion()-shaped call (concurrently, via a thread pool,max_workersconfigurable), so this is a distinct execution surface from the already-instrumented single-shotcompletion/acompletion, not just a client-side loop the user writes themselves — the concurrency and result aggregation happen inside LiteLLM.Braintrust docs status
not_found. The Braintrust LiteLLM integration page states Braintrust "patches LiteLLM's top-level call entry points and creates an LLM-typed span per call," and explicitly lists the entry points covered:
completion,acompletion,text_completion,atext_completion,responses,aresponses,image_generation,aimage_generation,embedding,aembedding,moderation,amoderation,speech,aspeech,transcription,atranscription,rerank,arerank.batch_completionand its variants are not mentioned anywhere on the page.Upstream sources
Local repo files inspected
py/src/braintrust/integrations/litellm/patchers.py— definesLiteLLMCompletionPatcherthroughLiteLLMArerankPatcher(18 patchers total); nobatch_completionpatcher exists. Grep forbatch_completionacross the entirelitellm/integration directory returns zero matches.py/src/braintrust/integrations/litellm/integration.py—LiteLLMIntegration.patchers = _ALL_LITELLM_PATCHERS, sourced entirely frompatchers.py.py/src/braintrust/integrations/litellm/tracing.py— wrapper implementations for all 18 patched entry points; nobatch_completionwrapper.py/src/braintrust/integrations/litellm/test_litellm.py—test_litellm_async_parallel_requestsexercises concurrentacompletion()calls viaasyncio.gather, not thebatch_completionAPI; no test referencesbatch_completion.py/pyproject.toml[tool.braintrust.matrix.litellm](line 398-402):latest = "litellm==1.100.0", floor"1.74.0" = "litellm==1.74.0"— both versions shipbatch_completion.