01Para gerçekte nereye gidiyorWhere the money actually goes
Üretimdeki bir yapay zekâ özelliğinin faturasını kalem kalem açtığımızda tablo genellikle aynıdır: maliyetin büyük kısmı modelin ürettiği cevaptan değil, ona tekrar tekrar gönderilen girdiden gelir.
Open up the line items of an AI feature in production and the picture is usually the same: most of the cost comes not from the answers the model produces, but from the input you send it again and again.
- Bağlam şişmesi. API'ler durumsuzdur: system prompt, tool tanımları ve konuşma geçmişi her istekte yeniden gönderilir ve yeniden fiyatlanır. Kullanıcı tek cümle yazar; siz her seferinde on binlerce token'lık aynı paketi ödersiniz.
- Context bloat. The APIs are stateless: the system prompt, tool definitions and conversation history are resent — and repriced — on every request. The user types one sentence; you pay for the same tens-of-thousands-of-tokens package every time.
- Sessiz retry'lar. Timeout veya geçici hata sonrası istemci sessizce yeniden dener. Cevap tektir, fatura çifttir — ve retry'lar ayrı loglanmıyorsa kimse fark etmez.
- Silent retries. After a timeout or transient error, the client quietly tries again. One answer, double the bill — and if retries aren't logged separately, nobody notices.
- Stajyer işi yapan frontier model. Sınıflandırma, alan çıkarımı, kısa özet gibi işler en pahalı modelde koşar — çünkü entegrasyon önce onunla yapılmıştır ve kimse geri dönüp bakmamıştır.
- Frontier models doing intern work. Classification, field extraction and short summaries run on the most expensive model — because that's what the integration was built with, and nobody ever went back.
- Sınırsız agent döngüleri. Tavanı olmayan bir tool döngüsü, model "emin olana kadar" tur atar; her tur, büyüyen geçmişin tamamını yeniden işler.
- Unbounded agent loops. A tool loop with no ceiling keeps circling until the model is "sure" — and every lap reprocesses the entire growing history.
LLM maliyeti bir fiyat sorunu değil, mimari sorunudur.
LLM cost isn't a pricing problem. It's an architecture problem.
02Prompt cache: önek disipliniPrompt caching: prefix discipline
Prompt cache tek kurala dayanır: önek eşleşmesi. Sağlayıcı, isteğin başından itibaren byte byte aynı olan bölümü cache'ten okur; öneğin herhangi bir yerindeki tek bir değişiklik, o noktadan sonraki her şeyi geçersiz kılar. Bu yüzden cache bir parametre değil, bir sıralama disiplinidir.
Prompt caching rests on one rule: prefix matching. The provider serves from cache whatever is byte-for-byte identical from the start of the request; a single change anywhere in the prefix invalidates everything after it. Which is why caching is a matter of ordering discipline, not a parameter.
- Sabitler öne, değişkenler sona. Donmuş system prompt ve deterministik sıralanmış tool listesi isteğin başında durur; tarih, kullanıcı bilgisi ve asıl soru en sona gider. System prompt'un içine timestamp basmak, arkasındaki her şeyin cache'ini bozar.
- Stable content first, volatile content last. A frozen system prompt and a deterministically ordered tool list sit at the front; the date, user details and the actual question go at the end. Interpolating a timestamp into the system prompt invalidates the cache for everything behind it.
- Görünmez bozucular. İstek ID'leri, anahtarları sıralanmadan serialize edilen JSON, istekten isteğe değişen tool seti, oturum ortasında model değişimi — hepsi öneği her istekte benzersiz yapar ve cache'i sessizce sıfırlar.
- Silent invalidators. Request IDs, JSON serialized without sorted keys, a tool set that varies between requests, a mid-session model switch — each makes the prefix unique per request and silently zeroes out the cache.
- Ölçmeden inanmayın. Cevabın usage alanındaki cache okuma sayacı art arda isteklerde sıfırsa, bir bozucu iş başındadır. Cache'ten okunan token, tam fiyatlı token'dan kat kat ucuzdur; önek disiplini tek başına faturanın en büyük kalemini düşürür.
- Verify, don't assume. If the cache-read counter in the response usage stays at zero across consecutive requests, an invalidator is at work. A cached token costs a fraction of a full-price one; prefix discipline alone cuts the biggest line on the bill.
03Model routing ve bağlam diyetiModel routing and the context diet
Her isteğin en güçlü modeli hak ettiği varsayımı, faturadaki en pahalı varsayımdır. Routing'in kuralı basit: önce küçük ve ucuz model; belirli sinyallerde yükselt. Bu kaliteden feragat değildir — doğru işi doğru kapasiteye vermektir.
The assumption that every request deserves the strongest model is the most expensive assumption on the bill. The routing rule is simple: cheap and small first; escalate on signals.
- Ucuz model önce. Sınıflandırma, yönlendirme, alan çıkarımı ve kısa özet küçük modelin işidir. Frontier model ancak sinyal geldiğinde devreye girer: düşük güven skoru, çok adımlı akıl yürütme, kritik bir akış ya da kullanıcının açık talebi.
- Cheap model first. Classification, routing, field extraction and short summaries are small-model work. The frontier model steps in only on a signal: a low confidence score, multi-step reasoning, a critical flow, or an explicit user request.
- Bağlam diyeti. Routing kadar önemlisi, modele ne kadar bağlam taşındığıdır. Geçmişe sabit bir kesme (truncation) politikası koyun; eski turları özetleyip atın (summarize-then-discard); "her belgeyi context'e bas" yerine retrieval ile yalnızca ilgili parçayı getirin.
- The context diet. Just as important as routing is how much context you haul to the model. Set a fixed truncation policy on history; summarize old turns then discard them; and instead of stuffing every document into context, retrieve only the relevant chunk.
- Döngülere tavan. Agent'lara tur ve token tavanı verin. Tavan dolduğunda döngü durur, iş insana ya da daha ucuz bir yola düşer — açık uçlu döngü, açık uçlu fatura demektir.
- Caps on loops. Give agents a turn and token ceiling. When the cap is hit, the loop stops and the work falls to a human or a cheaper path — an open-ended loop is an open-ended invoice.
04Bütçeler ve birim ekonomiBudgets and unit economics
Aylık fatura bir yönetim aracı değildir; çok geç gelir ve hangi özelliğin yaktığını söylemez. Doğru birim, istek / kullanıcı / özellik başına maliyettir. Her LLM özelliğine kendi token bütçesini verin ve eşiğe alarm bağlayın — kesinti değil, uyarı: önce görün, sonra karar verin. Bütçe aşımı çoğu zaman bir hata değil, keşfedilmemiş bir bağlam sızıntısıdır.
The monthly invoice is not a management tool; it arrives too late and doesn't say which feature is burning. The right unit is cost per request / user / feature. Give every LLM feature its own token budget and wire an alert to the threshold — an alert, not a cutoff: see it first, then decide.
# özellik başına / per feature feature: "destek-cevap / support-answer" route: default: small # sınıflandır, çıkar, özetle / classify, extract, summarize escalate_if: [low_confidence, multi_step, critical_flow] budget: per_request_tokens: 8000 alert_at: "80%" # kesme değil, uyarı / alert, don't cut cache_prefix: [system, tools] # değişkenler sona / volatile goes last batch_lane: [gecelik_ozet, reindex]
Son kalem, zamana toleranslı işler: gecelik özetler, yeniden indeksleme, toplu etiketleme gerçek zamanlı hattan çıkıp batch/async hatta gider. Sağlayıcılar batch işleri belirgin indirimle fiyatlar; kullanıcı beklemiyorsa siz de tam tarife ödemeyin.
The last item is latency-tolerant work: nightly summaries, reindexing and bulk labeling move off the real-time path into a batch/async lane. Providers price batch work at a significant discount; if no user is waiting, don't pay the full rate either.
