Root cause: sequential execution of "chat.completions.create"
3 "openai.chat.completions.create" spans ran one after another — each started only after the previous one finished. Total: 5.6s, slowest single call: 2.2s. Running them concurrently saves 3.4s — a 2.6× speedup.
5.6s
~2.2s
Fix: run calls in parallel
from concurrent.futures import ThreadPoolExecutor
# Before — sequential, each call blocks the next:
for item in items:
result = process(item)
# After — all calls run concurrently:
with ThreadPoolExecutor(max_workers=8) as pool:
results = list(pool.map(process, items))
# Cost unchanged. Output unchanged. Time = slowest single call.Waterfall
agent.run
openai.chat.completions.create
Summarize the Q3 earnings report attached. Focus on revenue, margin, and guidance.
(answer to: Summarize the Q3 earnings report attache…)
openai.chat.completions.create
Given the customer ticket below, draft a refund response that follows policy P-204.
(answer to: Given the customer ticket below, draft a…)
openai.chat.completions.create
Translate the user manual section to Japanese, preserving the table structure.
(answer to: Translate the user manual section to Jap…)
tool.code_exec
tool.calculator
tool.web_fetch
Faithfulness · openai.chat.completions.create0.50
1 supported · 0 contradicted · 1 unsupported of 2 claims
- unsupported
All chapters were translated.
- supported
Tables were preserved in the output.