Skip to content

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

Shopify Engineering 5 min read Case study hardMaster

How Shopify turns open models into task experts

Shopify's Sidekick keeps a frontier model for merchant conversation and planning but offloads token-heavy subagent work, such as GraphQL query generation, to open models it post-trains and self-hosts. Each model is built through a loop: a rubric and an LLM judge tuned with GEPA/ACE to match human agreement, an optimized frontier agent as the baseline, open-model selection, early inference benchmarking with AIPerf, nightly self-healing that converts failed conversations into training data via critic hints, and post-training with Megatron Bridge. For GraphQL, Nemotron 3.5 Lightning went from 37.7 to 74.5 on the judge after six loops and about 61,000 healed examples, beating the frontier model's 73. It also cut median latency from 6.50s to 0.87s and serving cost by about 90%, and Blackwell GPUs made both training and serving cheaper.

Related posts

  • Sidekick's continual learning loop

    Shopify Engineering hardMaster

    Shopify's Sidekick GraphQL agent improves daily through a continual learning loop that turns production failures into model weight updates, beating frontier-model quality while cutting estimated serving costs from about $27M to $1M per year (96%). The loop starts with a rubric validated by inter-annotator agreement (Cohen's kappa) and an LLM judge calibrated with DSPy using GEPA and ACE, then backtested against past A/B tests and degradation tests. An autoresearch agent tunes prompts, tools and harness code against the judge. Hard negatives from production are then repaired by a panel of frontier critics via hinting and replay, and the repaired trajectories train a smaller model through chain-of-thought SFT followed by GRPO with the judge as reward. Gist-token compression shrinks the ~6,000-token system prompt to ~1,500 tokens, cutting end-to-end latency about 38% and GPU needs about 14%.

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

  • Mubit + Neon AI Gateway: an agent that cuts its own frontier-model tokens by 73%

    Neon mediumAdept

    Mubit, a proxy placed in front of Neon AI Gateway, records an agent's model calls, groups recurring calls into tasks, and fine-tunes a small open-weight model once a task has at least 25 good replies. The tuned model must pass a held-out exam, then moves through shadow, canary and promotion stages, and is demoted if sampled quality drops. It also stores verified lessons tied to schema versions. On 20 CL-bench questions run against a Postgres analyst agent, gpt-5.5 input tokens fell 73% (21.7k to 5.9k per question) and latency fell 40% with roughly equal accuracy. SQL generation stayed on the frontier model because the small model matched only 8-10% of the time, and lessons doubled correct runs after a schema change. The template runs on Neon Functions with an outbox-style lesson queue and uses Neon branches to test before and after a migration.

  • Open-weight models are fast on Neon AI Gateway. Here's why

    Neon mediumAdept

    Neon AI Gateway serves open-weight models through Databricks Foundation Model APIs, so it gets that stack's inference optimizations: continuous batching with PagedAttention-style KV-cache paging and overlapped prefill/decode, a TensorRT-LLM backend with fused and GroupGEMM kernels for MoE, tensor parallelism, FP8 quantization, and per-GPU tuning. Prompt caching matters most for agent loops that resend a stable system prompt and tool schema. On gpt-oss in a production batch pipeline it raised per-replica input-token throughput 2.5× and cut P50 latency 3× at a ~30% hit rate. FP8 on H100 gave about 2.2× throughput over FP16. To benefit, keep prompt prefixes stable and point an OpenAI-compatible SDK at the gateway.

  • Together AI at ICML 2026: frontier research across the full stack

    Together AI hardMaster

    Together AI's nine ICML 2026 papers span the AI stack from agents to GPU kernels, each with a headline result. ThunderAgent makes multi-turn agent workflows visible to the inference scheduler for 1.5–3.6x throughput. Aurora trains speculative-decoding drafters online via asynchronous RL on accepted/rejected tokens, gaining 1.25x over a static speculator. Untied Ulysses chunks attention by head to fit 5M-token training on one 8xH100 node, and OEA recovers MoE sparsity under batching for up to 39% faster decode without retraining. The rest cover verifier-free reasoning (RARO), pairwise self-verification (V1), test-time RL for discovery (TTT-Discover), a data-science agent benchmark (DSGym), and a multi-GPU kernel generation benchmark where the best frontier model solves fewer than a third of 87 tasks.

The quest for software engineering knowledge.

Look:
Layout: