Skip to content

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

Shopify Engineering 6 min read Case study mediumAdept

Sidekick’s Improved Streaming Experience

Shopify's Sidekick fixes two LLM chat streaming problems: Markdown rendering jank, where partial syntax shows up as raw text, and the long wait while tool calls finish. A character-level finite state machine in a Node.js Transform stream buffers ambiguous Markdown sequences, such as links and asterisks, until they either complete or prove to be false positives. The LLM is prompted to emit special "card:" Markdown links as placeholders. The same parser detects these links and kicks off asynchronous content resolution, which is multiplexed into one Server-Sent Events stream that the UI demultiplexes, so the main answer streams immediately and tool results fill in later.

Assumes: Markdown syntaxNode.js streamsLLM tool callingServer-Sent Events

Related posts

  • The making of the Yelp Assistant UI

    Yelp Engineering mediumAdept

    Yelp Assistant, Yelp's LLM-powered chat for scoping projects with local pros, uses a hybrid UI. Native code renders the top bar and text input, and Yelp's server-driven UI framework CHAOS renders the conversation, so changes reach every platform without waiting on app store releases. The client fetches a CHAOS view configuration once as a template, then hydrates it turn by turn with MessageEvents stored in datasets. Message types include user, bot, typing indicator, link and quick replies, and the flow uses optimistic inserts, retries for recoverable errors, CHAOS actions for taps, and backend-issued client actions such as DisableChat to end the session.

  • From OpenAI to Open LLMs with Messages API on Hugging Face

    Hugging Face mediumAdept

    Text Generation Inference 1.4.0 adds a Messages API compatible with OpenAI's Chat Completion API, so open LLMs on Inference Endpoints can be called from existing OpenAI client code by changing the base URL and token. The guide deploys Nous-Hermes-2-Mixtral-8x7B-DPO via huggingface_hub with TGI token-limit settings and then calls it from the OpenAI Python and JavaScript clients. It also plugs the endpoint into LangChain (ChatOpenAI) and LlamaIndex (OpenAILike) RAG pipelines. Limitations: no function calling, only models with a chat_template, and a subset of parameters (stream, max_tokens, temperature, top_p, seed, logprobs, frequency_penalty).

  • 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.

  • Flow generation through natural language: An agentic modeling approach

    Shopify Engineering mediumAdept

    Shopify fine-tuned Qwen3-32B into a tool-calling agent that turns natural-language requests into Shopify Flow automations for Sidekick, reporting 2.2x lower latency and 68% lower cost than the closed frontier model it replaced. Training data was bootstrapped by reverse-generating user queries and tool trajectories from real merchant workflows. Transpiling Flow's JSON DSL into Python, kept lossless by a round-trip transpiler, raised syntactic correctness by 22 points and semantic correctness by 13. Small train/serve mismatches in tool names, tool order and JSON key order measurably hurt accuracy, and a 1% production rollout exposed a 35% activation gap that offline benchmarks had hidden. That gap was closed with a human-calibrated LLM judge, slice tagging and a weekly retraining flywheel on H200 nodes with FSDP, orchestrated by Tangle.

  • Building Ghostwriter Chat

    Replit easyNovice

    Ghostwriter Chat is an LLM-powered pair programmer built into Replit's IDE and shipped in about 6-8 weeks after a January Hackweek. Streaming model output brings time-to-first-response under 500 ms, and a generic prompt-construction layer merges repl context, chat history and other sources into formats for different models and APIs. To fit within token limits it drops older chat messages, caps user messages at 500 characters, and prioritizes files the user is currently or recently editing over noise like .venv, linter and CI configs.

The quest for software engineering knowledge.

Look:
Layout: