AINewsnow

Counting LLM Tokens in Python: tiktoken vs a Dependency-Free Heuristic

This story is from 2026-10-13. It is preserved in the archive; the latest stories are on the live feed.

Every LLM feature I build eventually needs to answer one question: how many tokens is this? Context windows are measured in tokens, cost is measured in tokens, and truncation happens in tokens. Characters and words are close enough to lie to you and not close enough to trust. There are two ways to…

Read the full story at DEV Community — AI ↗

Timeline · 1 report

  1. 2026-10-13 09:30 · DEV Community — AI
    Counting LLM Tokens in Python: tiktoken vs a Dependency-Free Heuristic

More stories

  1. Introducing Muse Wonder and Muse Wonder Full: Frontier Models for Agents — Meta Newsroom
  2. Anthropic warns small AI models may soon self-replicate on IoT devices — CNBC Technology
  3. (Left) Qwen image 2.1 + turbo lora (Right) Qwen image 2.1 turbo — r/StableDiffusion
  4. Character.AI files for bankruptcy, Disney bids for key assets — Business Insider AI
  5. Centre for the Governance of AI Publishes Annual Reports Through 2024 — Centre for the Governance of AI
  6. Amazon in Talks to Buy AI Startup Decart for $7 Billion — Wall Street Journal Technology
  7. Chip stocks slide after Broadcom CEO likens AI investing to 'casino' — The Guardian AI
  8. Ubuntu 26.10 release features new AI-driven dictation platform — ZDNET AI

Get the daily brief of stories like this at 6:30 every morning →