When does the 'no framework' pattern beat reaching for LangChain or LlamaIndex?
When does the 'no framework' pattern, raw provider SDK plus your own small composition layer, beat reaching for LangChain or LlamaIndex? Give the concrete conditions, not generalities.
Raw SDK beats a framework when the surface is small, the team is tiny, the latency budget is tight, or you need a brand-new provider feature before the wrapper catches up.
Picture a single person making a sandwich for themselves. They open the bread bag, slap on cheese, done. Now picture them buying a 12-step sandwich-assembly machine for the same task. The machine has a process, settings, error logging, and a manual. For one sandwich a day it is silly. The setup time alone is longer than the task. The machine starts to earn its keep when you are making three hundred sandwiches with twelve different fillings for a catering company. That is when the structure stops being overhead and starts being help.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
The no-framework pattern is one of the most undersold defaults in modern LLM engineering. Teams reach for LangChain because everyone reaches for LangChain, often without asking whether the framework is actually absorbing anything for their specific workload.
This deep dive walks through what a framework actually absorbs, the four concrete conditions that favor raw SDK plus a thin wrapper, what that thin wrapper should contain, and where the framework genuinely earns its keep so you stop reaching for it everywhere.
What a framework actually absorbs
Before deciding whether the tax is justified, name what you would be paying for. A modern LLM framework absorbs four things.
Composition
A way to chain prompts, retrievers, tools, and parsers into pipelines. LangChain has LCEL; LlamaIndex has QueryEngines and Workflows; Vercel AI SDK has streamText plus tools. Composition is the framework's main job and the one place it almost always wins on long pipelines.
Provider abstraction
One API that swaps between OpenAI, Anthropic, Bedrock, Vertex, Mistral, local Ollama. The benefit is real until you need a feature one provider just shipped that the wrapper has not exposed yet. Then the abstraction is a barrier.
Observability hooks
Callbacks and spans that auto-instrument LangSmith, Langfuse, Phoenix, OpenTelemetry. The wiring is non-trivial; a framework that includes it saves real time.
Higher-order patterns
Agent loops, multi-agent coordination, structured-output parsing, retry with self repair. These are the patterns that take real effort to hand-roll.
The pattern
Notice that all four absorptions are about complexity that exists in the codebase. If the codebase has no chain composition, no multi-provider switching, no advanced observability, and no agent patterns, then the framework absorbs nothing. The tax is the entire cost.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Many YC startups in 2024-26 publicly described their first-version stacks as raw OpenAI SDK plus a 50-line internal helper.
- Vercel AI SDK is itself a deliberate thin-wrapper choice. Small surface, type-safe, eject-friendly.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide when an internal LLM helper has grown enough that it should become a framework?
When the helper exceeds roughly 500 lines, has its own concepts that need documentation, or imposes conventions on its callers, it has crossed into framework territory; at that point either accept it as your in-house framework or migrate to an external one.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Reaching for LangChain by reflex on a project with two prompts and one engineer, then paying the framework tax for years on something that never needed it.
60 second bullets to scan on the way to the call.
What a framework actually absorbs (composition, observability, provider abstraction, higher-order patterns)
The four conditions that favor raw SDK
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.