Introducing LangSmith Fine-Tuning
LangSmith Fine-Tuning and its `smithtune` CLI turn agent trajectories recorded in LangSmith into supervised fine-tuned models in one workflow. The workflow covers curating and labeling golden trajectories, LoRA training on Fireworks or Baseten with checkpoint selection by validation loss, and replay-based evaluation against the base model. Trajectories record the exact context, including tool availability, the model saw at each turn. In internal tests, SFT lifted Kimi K3 from 90.0 to 96.0 on an issue-detection benchmark, and raised Qwen-3.8-27B's code-review F1 from 48.9% to 53.7% with about 30% fewer model and tool calls. Data selection was decisive, since a less curated training set lowered F1, and the recommendation is to exhaust harness engineering before trying SFT.
Related posts
- How Podium optimized agent behavior and reduced engineering intervention by 90% with LangSmith
LangChain easyNovicePodium used LangSmith tracing and evaluation to improve its AI Employee agent, which makes 20-30 LLM calls per customer interaction. To fix the agent's failure to recognize when conversations ended, the team curated metadata-enriched datasets from traces and distilled a larger model into a smaller fine-tuned one. Pairwise evaluation showed F1 rising from 91.7% to 98.6%, above their 98% threshold. Giving support staff trace access let them classify issues as application bugs, missing context, misaligned instructions or LLM errors, which cut engineering intervention by 90%.
- CoderForge-Preview: SOTA open dataset for training efficient coding agents
Together AI hardMasterCoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench. The trajectories were generated with Qwen3-Coder-480B in OpenHands Docker environments, filtered by rejection sampling and permissive-license audits, and cost about $130K to produce at a ~90% prompt cache hit rate. Fine-tuning Qwen3-32B on the passing trajectories, using Ulysses sequence parallelism, multipacking and token-level loss normalization at 128K context, reaches 59.4% pass@1 on SWE-Bench Verified, and a 4B model reaches 43.0%. Ablations show a repetition penalty helps only early checkpoints, so later checkpoints should be run without one.
- Sidekick's continual learning loop
Shopify Engineering hardMasterShopify'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%.
- Training and Finetuning Embedding Models with Sentence Transformers
Hugging Face mediumAdeptSentence Transformers v3 trains and finetunes embedding models through a SentenceTransformerTrainer that combines Hugging Face datasets, a loss function, optional training arguments and evaluators. Finetuning matters because each task needs its own notion of similarity. Dataset column order must match the chosen loss's inputs, with an optional "label" or "score" column, and extraneous columns must be removed. A worked example finetunes MPNet on AllNLI triplets with MultipleNegativesRankingLoss and a no-duplicates batch sampler, and evaluates with TripletEvaluator and EmbeddingSimilarityEvaluator on STSb.
- Flow generation through natural language: An agentic modeling approach
Shopify Engineering mediumAdeptShopify 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.