Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

incident.io 10 min read Case study mediumAdept

Break chatbot speed limits with speculative tool calls

incident.io cut its incident chatbot's response latency by about 50% (saving 2-3s per interaction) by speculatively executing LLM tool calls in both directions. Tools are started in parallel with the main chat prompt when simple keyword matching suggests they will be needed, and the follow-up chat prompt is run optimistically by assuming the tool succeeded, then re-run on error. Side effects are prevented with a Go write barrier: speculative tools do all their LLM 'thinking' but block before writing until the main prompt confirms the call, otherwise the context is cancelled. The tradeoff is occasional wasted LLM spend, which effectively lets the team buy speed with money.

Related posts

  • AI Agent Latency 101: How do I speed up my AI agent?

    LangChain easyNovice

    AI agent latency can be cut in five ways: find the bottleneck first (e.g. with per-step tracing and a waterfall view), reduce perceived latency through UX, make fewer LLM calls, make each call faster, and run calls in parallel. Streaming intermediate steps such as plans, retrieval results or thinking tokens can raise user satisfaction without changing total time, and event-triggered background agents hide latency entirely. General-purpose multi-agent supervisor or swarm setups make many LLM calls, so mixing code with explicitly routed calls reduces them. Smaller models and shorter context speed up individual calls at some cost to accuracy, and guardrail checks, multi-document extraction or multi-model calls can run concurrently.

  • Speeding up agentic workflows with WebSockets in the Responses API

    OpenAI mediumAdept

    OpenAI cut end-to-end latency of agentic loops on the Responses API by about 40% by adding a WebSocket mode that keeps a persistent connection with a connection-scoped in-memory cache of prior response state. Follow-up `response.create` calls with `previous_response_id` reuse cached rendered tokens, tool definitions and routing, so safety classifiers and validators process only new input, and postinference work like billing overlaps with later requests. An earlier prototype that modeled the whole rollout as one long-running response blocked on client tool calls was faster still, but it was dropped in favor of keeping the familiar API shape. Earlier sprint work (token and config caching, fewer network hops, faster safety checks) improved TTFT by about 45%, and the WebSocket mode let GPT-5.3-Codex-Spark reach 1,000+ TPS, with partners such as Cline, Vercel and Cursor reporting 30-40% speedups.

  • We used GPT-4 during a hackathon—here's what we learned

    incident.io mediumAdept

    A two-day hackathon at incident.io prototyped GPT-3.5/GPT-4 features: incident handover summaries generated from full Slack channels, a reply-with-❓ jargon explainer, and natural-language incident filters. The team dropped all of them for the same reasons. Responses took 20-30 seconds, and the 4,096-token context limit covers prompt plus response, so only about 35% of a Slack channel fit. Filters needed huge name-to-ID mappings, and chunked 'summarize the summaries' workarounds would multiply latency. The other lessons were that prompt engineering is brittle, data-privacy controls would be needed before shipping, and latency and context size are the things to watch before revisiting.

  • 2,000 robots walk into a shop...

    Shopify Engineering hardMaster

    SimGym runs simulated A/B tests on Shopify storefronts by sending up to 2,000 concurrent LLM-driven shopper agents through Browserbase cloud browsers. Because browsers bill per minute, inference latency directly drives cost: a ~20% latency cut lowered cost per merchant run by ~10%. The team self-hosted gpt-oss-120b on 48 B200 GPUs with vLLM and FlashInfer, using MXFP4 experts, an FP8 KV-cache, custom long-context speculative decoding kernels (EAGLE-3) and combined async/guided/speculative decoding. MIG partitioning cut latency ~20% and prefix-cache-friendly prompts added ~12% throughput, while lowering reasoning effort was rejected because error rates rose to as much as 10.9%.

  • Optimizing LLM prompts for low latency

    incident.io mediumAdept

    incident.io cut latency of an LLM prompt that plans Grafana dashboards for incident investigations from 11s to under 2.3s without changing its behaviour, mainly by shrinking output tokens. Dropping JSON reasoning fields halved output tokens (315 to 170) and saved about 40% latency. Replacing JSON dashboard definitions with a compact custom format cut input from 15k to 2k tokens but saved only about 20%. A terse non-JSON output format cut output tokens by a further 70% and latency by 60%, though the team held back from shipping it because models are more familiar with JSON and quality could suffer in subtle ways.

The quest for software engineering knowledge.

Look:
Layout: