Articles

Blog, tutorials & changelog

Everything we're learning about LLM token optimization — and every update we ship.

LangSmith: LangChain's observability platform explained
Tracing, debugging, evaluation, and monitoring for LLM chains and agents. How it compares to Tokoscope and Helicone, and why they work well together rather than competing.
Fireworks AI: fast, cheap inference for open-source LLMs
Serverless and dedicated inference for Llama, Qwen, DeepSeek, and Mixtral. Pricing table, LoRA fine-tuning, and how it compares to Groq and Together AI.
LoRA explained: how Low-Rank Adaptation makes fine-tuning affordable
The math behind low-rank weight decomposition, why it's 10-100x cheaper than full fine-tuning, choosing the right rank, QLoRA, and serving multiple adapters in production.
MiniMax: the Chinese AI lab behind MiniMax-Text-01 and Hailuo video
456B MoE model with 1M context at $0.20/1M input. Lightning Attention architecture, Hailuo AI video generation, and how it stacks up vs DeepSeek and Kimi.
Claude Opus 5: near-Fable intelligence at half the price
Released July 24, 2026. Outperforms Fable 5 on 8 of 13 benchmarks at $5/$25 per million tokens. The effort dial, self-verification, mid-task model switching, and when to use Opus 5 vs Fable 5.
DeepSWE: the coding agent benchmark that fixes SWE-bench's blind spots
113 original tasks, zero contamination, behavior-focused prompts. GPT-5.5 leads at 67%, Opus 4.8 at 59%, Gemini 3.1 Pro at 12%. Why scores here are 20-40 points lower than SWE-bench — and why that's the point.
Unsloth: 2x faster LLM fine-tuning at half the memory
Custom CUDA kernels, memory-efficient backprop, and intelligent weight offloading. What hardware you actually need per model size, and how it exports to GGUF for Ollama.
Build an LLM from scratch: what it actually takes in 2026
The transformer architecture, tokenizer, data pipeline, and training loop — plus real cost numbers from $6K for a 1B model to $500M+ for a frontier model. And when you shouldn't bother.
LLM development: the full lifecycle from prototype to production
Seven stages: prototype, prompt engineering, RAG, evaluation, cost optimization, observability, and security. The decisions every team faces and the tools for each layer.
Gemini 3.6 Flash: Google's new workhorse model explained
Released July 21, 2026. Reasoning-capable, 65% fewer output tokens than 3.5 Flash, $1.50/$7.50 per million. How it compares to DeepSeek V4 Flash and what the three new Gemini models actually do.
DeepSeek R1: the open-source reasoning model that shook the AI industry
671B MoE trained with pure RL — no supervised reasoning traces. Matched o1 on AIME and MATH-500. MIT license, distilled variants from 1.5B to 70B. Here's how it works and when to use it.
DPO explained: the training technique replacing RLHF in modern LLMs
Direct Preference Optimization eliminates the reward model and RL entirely. How it works, DPO vs RLHF comparison, variants (IPO, KTO, SimPO), and its effect on output verbosity and token cost.
How to train an LLM: pre-training, fine-tuning, and alignment explained
The three stages of LLM training, what LoRA and QLoRA actually are, when fine-tuning beats RAG, and what training actually costs in 2026 — from $20 LoRA runs to $500M pre-training budgets.
DeepSeek V4 Flash: the fastest open-weight frontier model in 2026
284B MoE model, 13B active params, 1M context, $0.14/$0.28 per million tokens. Architecture breakdown, benchmarks vs GPT-4o, and when to use Flash vs Pro.
OpenCode Go: the affordable subscription plan for AI coding models
OpenCode Go is $10/month access to open coding models through OpenCode — not a Go-language tool. Here's what it includes, when it's cheaper than direct APIs, and when it's not.
Temperature in LLMs: what it is and how to set it
Temperature controls how random or deterministic an LLM's output is. The right setting by use case, how it differs from top_p, and its effect on output token costs.
LLM context window: what it is, why it matters, and how to use it well
How context windows work, the lost-in-the-middle problem, cost implications of long context, and strategies for managing context efficiently in production.
LLM security: how to protect AI applications from attacks and data leaks
Prompt injection, data leakage, excessive agency, model DoS — the full LLM threat model, practical defenses, and a production security checklist.
LLM tools in 2026: the full stack for building with language models
APIs, local inference, orchestration, coding assistants, RAG, observability, evals, and cost optimization — every category mapped with the leading tool in each.
LLMOps: what it is and how to operationalize LLMs in production
Prompt versioning, cost monitoring, output quality, safety guardrails, and model management — the full LLMOps practice and the tools that support it.
llama.cpp: the fastest way to run LLMs on CPU
How llama.cpp works, GGUF quantization levels and their tradeoffs, and when to use it over Ollama and vLLM. The only inference engine that works without a GPU.
Cline: the open-source AI coding agent for VS Code
Cline is an autonomous VS Code coding agent that supports any LLM provider. Here's how it compares to Claude Code and Copilot, and what it costs to run.
Free LLM APIs in 2026: what's actually free and what has limits
Google AI Studio, Groq, OpenAI credits, Mistral trial — what each provider actually gives you for free, the real rate limits, and how to stretch free quota further.
LLM for coding: which model, tool, and approach works best in 2026
Inline autocomplete, chat assistance, and agentic coding — which model fits each task, which tool to use, and how to keep AI coding costs manageable.
Best local LLM in 2026: complete guide by hardware and use case
What to run locally by VRAM tier — under 8GB, 8-20GB, 20-48GB, and 40GB+. Best models for coding, reasoning, vision, and general chat. When local beats cloud.
Azure LLM: how Azure OpenAI Service works and when to use it
Azure OpenAI vs direct OpenAI API — data residency, compliance, pricing, and model availability. When the enterprise setup overhead is worth it.
Bonsai LLM: the compact 27B model that punches above its weight
Bonsai 27B achieves near-Llama-70B quality at half the VRAM. Here's the benchmark breakdown, how it compares to Gemma 4 and Qwen, and when to use it over larger models.
Fable LLM: the AI model built for interactive storytelling
Fable's models are optimized for character consistency and narrative coherence — and reveal the unique token cost challenges of roleplay and interactive fiction AI.
Kimi K3: Moonshot AI's reasoning model challenging the frontier
Kimi K3 benchmarks close to GPT-4o and Claude Sonnet at ~$0.60/1M input tokens. Here's what it can do, how it compares to DeepSeek, and data privacy considerations.
Perplexity AI: the answer engine that's changing how developers search
How Perplexity's RAG-based answer engine works, how it compares to ChatGPT Search and Google AI Overviews, and how to use the Sonar API in your own apps.
Mesh LLM: what multi-agent LLM architectures look like in 2026
Sequential pipelines, parallel fan-out, hierarchical agents — the patterns, their token costs (up to 30x a single call), and how to keep mesh architectures affordable.
OpenClaw: the open-source agent framework for LLM workflows
OpenClaw focuses on explicit control flow and lower token overhead than LangChain. Here's how it compares to the main frameworks and how to track its costs.
Chat LLM: how to build conversational AI that doesn't cost a fortune
Context window accumulation is why chat apps get expensive fast. Here's how multi-turn conversation works, why costs compound, and the three architectures to manage them.
LLM architecture explained: transformers, attention, and what happens when you send a prompt
How tokenization, embeddings, attention, and autoregressive decoding work — and what each step means for inference cost.
Llama: Meta's open-source LLM explained
From Llama 1 to Llama 3.3 — the full timeline, benchmark comparisons, how to run it locally, and API options via Groq and Together AI.
Meta's LLM strategy: why they give Llama away for free
Meta is the world's largest open-source AI lab. Here's the business logic behind open-sourcing Llama and what it means for developers.
LLM stats: token usage benchmarks and cost data for 2026
Real production token counts, cache hit rates by use case, and cost per 1,000 API calls across providers. The numbers teams actually see.
Nous Hermes: the fine-tuned LLM built for instruction following
Hermes models are fine-tuned Llama and Mistral variants known for strong instruction following, low refusals, and reliable structured output.
Claude Opus: Anthropic's most capable model explained
When Opus justifies its 5x premium over Sonnet, when Sonnet is good enough, and how to route between them based on task complexity.
Google AI Studio: the free way to access Gemini models
AI Studio gives developers free Gemini API keys, a prompt testing UI, and code export. Here's what it offers and when to graduate to Vertex AI.
SLM vs LLM: what's the difference and which should you use?
Small language models are faster and cheaper than LLMs. Here's how they differ, when each makes sense, and the hybrid routing approach most teams end up using.
Best open-source LLM for coding in 2026
Qwen2.5-Coder, DeepSeek-Coder, StarCoder2, CodeLlama — which open-source coding model wins in 2026? Full benchmark breakdown with hardware requirements.
LLM evals: how to measure whether your AI is actually working
Evals test whether your model outputs meet quality standards. Here's how deterministic, model-based, and human evals work — and how to build a practical eval pipeline.
LLM SEO: how to optimize your content for AI search and citations
LLM SEO optimizes content to be cited by ChatGPT, Perplexity, and Claude. Here's what works: llms.txt, structured data, and content strategies that AI systems favor.
LLM-as-a-judge: using AI to evaluate AI output at scale
LLM-as-a-judge uses one model to evaluate another's outputs. Here's how it works, its known biases (verbosity, self-preference, position), and how to implement it.
vLLM: the fastest open-source LLM inference engine explained
vLLM's PagedAttention achieves 24x higher throughput on the same hardware. Here's how it works, how it compares to Ollama and TGI, and when to self-host.
OWASP LLM Top 10: the security risks every AI builder needs to know
Prompt injection, insecure output handling, excessive agency — the OWASP Top 10 for LLMs covers the critical security vulnerabilities in AI applications.
MCP (Model Context Protocol): what it is and why it matters for AI agents
Anthropic's Model Context Protocol is becoming the standard way to connect LLMs to external tools. Here's how it works and why it's replacing custom integrations.
LLM optimization: 8 techniques to cut costs without cutting quality
Semantic caching, prompt compression, model right-sizing, output constraints, batching — 8 practical LLM cost optimization techniques ranked by ROI.
LLM rankings in 2026: how to read the leaderboards and pick the right model
LMSYS Arena, HF Leaderboard, Scale HELM, LiveBench — what each ranking system measures, their limitations, and how to use them to make real model decisions.
LLM suite: what it means and the best AI tool suites in 2026
Enterprise suites (M365 Copilot, Google Workspace AI), developer suites (OpenAI, Anthropic, Google), and open-source suites — how to evaluate which fits your team.
Gemma 4: Google's open-source LLM — what's new and how it compares
Gemma 4 brings multimodal support and 128K context to Google's open-source line. Here's what changed, benchmark comparisons, and how to run it locally.
LLM inference explained: how models generate text (and what it costs)
Inference is where most LLM money goes. Here's how prefill, decoding, and the KV cache work — and how to cut inference costs in production.
LLM observability: what it is and why every production AI team needs it
Standard APM tools are blind to what's happening inside LLM calls. Here's what to track, the tool landscape, and how to get started in 2 minutes.
RAG explained: how retrieval-augmented generation works (and what it costs)
RAG connects LLMs to external knowledge without retraining. Here's how it works, when to use it, and how to keep token costs from exploding.
Fine-tuning LLMs: when it's worth it and when RAG is the better call
Fine-tuning customizes a model on your data. Most teams don't need it. Here's the decision tree, how it works, and when the ROI makes sense.
Qwen in 2026: Alibaba's LLM family explained
Qwen2.5, Qwen2.5-Coder, QwQ-32B — Alibaba's open-source models are competitive with Llama 3 and often beat it on coding and math.
Groq: the inference chip that makes LLMs run 10x faster
Groq's LPU delivers 500+ tokens/second. Here's how it works, what it costs, and when speed matters enough to justify it.
AnythingLLM: the open-source local RAG app explained
AnythingLLM lets you chat with your documents using local or cloud LLMs. Here's what it does, how to run it, and when to use it vs building custom.
OpenCode: the open-source AI coding agent for the terminal
OpenCode is a terminal-based AI coding agent supporting any LLM provider. Here's how it compares to Claude Code and Cursor, and what it costs to run.
Hugging Face: the GitHub of AI models (and what it costs to use it)
500K+ models, datasets, and Spaces. Here's how the Hub works, how to run models from it, and what the real token costs look like in production.
LangChain: powerful but expensive — the hidden token cost of abstraction
LangChain is the most popular LLM framework. It's also one of the most token-inefficient. Here's what's happening under the hood and how to fix it.
Best Ollama models in 2026: which to run for every use case
Llama 3, Qwen2.5-Coder, DeepSeek-R1, Mistral — here's the best Ollama model for chat, coding, reasoning, and constrained hardware.
LiteLLM: the open-source LLM proxy — when it makes sense
LiteLLM gives you a unified API for 100+ providers, self-hosted. Here's how it compares to OpenRouter and whether you should run it.
RLHF explained: how AI models learn to follow instructions (and why it makes them verbose)
RLHF trained GPT-4, Claude, and Gemini to be helpful. It also explains why LLMs over-explain — and why that costs you money at scale.
OpenAI Codex: what it was, what replaced it, and what's next for AI coding
Codex powered GitHub Copilot and started the AI coding revolution. It's been deprecated — here's what replaced it and where agentic coding is headed.
LLM Studio: what it is and how it compares to other local LLM tools
LLM Studio is rising fast in search. Here's what it does, how it compares to Ollama and LM Studio, and when you should use each.
NotebookLM explained: how it works and what it costs Google
Google's NotebookLM is one of the most instructive examples of building a focused, cost-efficient AI product. Here's what's happening under the hood.
DeepSeek: the open-source LLM that shocked the AI industry on cost
DeepSeek-R1 matched frontier performance at a fraction of the training cost. Here's what it means for LLM pricing and how to use it.
OpenRouter: one API for 100+ LLMs — is it worth it?
OpenRouter gives you a single API for every major LLM. Here's what it does well, where it falls short, and how to layer optimization on top.
Best local LLM for coding in 2026 (ranked by real-world performance)
Qwen2.5-Coder, DeepSeek-Coder, CodeLlama, Mistral — which local LLM is actually best for coding? The honest breakdown.
What is an LLM gateway? And do you actually need one?
LLM gateways route requests, add caching, and control costs. Here's what they do, when you need one, and how to get the same benefits in 2 lines of code.
How to run a local LLM (and what it costs vs cloud)
Ollama, LM Studio, llama.cpp — running local LLMs is free but not actually free. Here's the real cost comparison and how to track usage across both.
LLM benchmarks explained: what the leaderboard numbers actually mean
MMLU, HumanEval, GPQA, SWE-bench — here's what each benchmark measures, what they miss, and how to pick the right model for your use case.
GLM 5.2 has a 1M token context window. Here's what that does to your API bill.
Z.ai's GLM 5.2 is the most powerful open-weight LLM of 2026. But a 1M token context window cuts both ways — here's how to use it without destroying your budget.
We analyzed thousands of LLM API calls. Here's where the waste is hiding.
40–70% of tokens in the average production prompt are pure waste. We dug into the data to find the most common patterns — and how to fix them.
Semantic caching: why exact match isn't enough
Exact match caching only catches identical prompts. We built a semantic layer that catches similar ones — and it changes everything about LLM cost optimization.
Getting started with Tokoscope in 5 minutes
A step-by-step guide to integrating Tokoscope into your existing OpenAI, Anthropic, or Gemini app. No infrastructure changes required.
How to reduce your OpenAI API costs by 60%
A practical walkthrough of prompt compression, semantic caching, and cost attribution — three techniques that compound to dramatically cut your LLM spend.
v0.9.0
Python SDK
Jul 13, 2026

Mistral support

  • Full Mistral AI provider support via MistralWrapper
  • chat.complete() and chat.complete_async() — tracked with caching
  • chat.stream() and chat.stream_async() — tracked via _MistralStreamWrapper
  • Auto-detected by wrap() from client class name
v0.8.0
JS SDK
Jul 13, 2026

Mistral support

  • Full Mistral AI provider support — detected by constructor.name === 'Mistral'
  • client.chat.complete() — tracked with caching
  • client.chat.stream() — tracked via wrapMistralStream, reads chunk.data.usage
v0.8.0
Python SDK
Jul 5, 2026

Anthropic + Gemini streaming

  • Anthropic streaming via create(stream=True) — reads message_start and message_delta events
  • Anthropic .stream() context manager — tracks from get_final_message() on exit
  • Gemini streaming via generate_content(stream=True) — reads usage_metadata from final chunk
  • All stream wrappers pass chunks through unchanged; tracking fires on stream end
v0.7.0
JS SDK
Jul 5, 2026

Anthropic + Gemini streaming

  • Anthropic streaming via messages.create({ stream: true }) — reads message_start / message_delta events
  • Anthropic messages.stream() helper — attaches 'end' listener, reads finalMessage()
  • Gemini streaming via generateContentStream() — tracks from aggregated response promise
  • Streaming responses skip cache (not cached in v1)
v0.6.0
Python SDK
Jun 28, 2026

Semantic caching + async support

  • Semantic caching with OpenAI embeddings for Python SDK
  • Async support via acreate() for OpenAI and Anthropic
  • Cache hit logging shows exact vs semantic match with similarity score
  • Thread-safe cache check works in both sync and async contexts
v0.5.0
JS + Python
Jun 27, 2026

Semantic caching

  • Two-layer cache: exact match + semantic similarity (85%+ threshold)
  • OpenAI embeddings used for semantic comparison
  • Cache hit type shown in console logs with similarity score
  • Cache TTL: 7 days
v0.4.0
JS + Python
Jun 25, 2026

Gemini support

  • Full Gemini support in JavaScript and Python SDKs
  • Gemini pricing for all models (1.5 Flash, 1.5 Pro, 2.0 Flash, 2.5 Pro)
  • Gemini provider shown in dashboard and top endpoints table
v0.3.0
JS + Python
Jun 23, 2026

Caching layer

  • 7-day exact match caching for all providers
  • Cache hit rate and tokens/cost saved shown on dashboard
  • Clear cache from Settings page
  • Cache stats widget in Settings
v0.2.0
JS + Python
Jun 21, 2026

Per-user tracking

  • Pass userId to track token usage per end user
  • New Users page in dashboard with full paginated list
  • Per-user waste score and cost breakdown
  • Search by user ID
v0.1.0
JS + Python
Jun 18, 2026

Initial release

  • OpenAI and Anthropic support
  • Token usage tracking and cost attribution
  • Automatic prompt compression via Claude
  • Waste scoring for every prompt
  • Budget alerts via email
  • Dashboard with usage charts and top endpoints