Show HN: Tokencap – Token budget enforcement across your AI agents

Show HN (score: 5)
Found: April 04, 2026
ID: 4023

Description

Other
Show HN: Tokencap – Token budget enforcement across your AI agents I built this after hitting the same wall repeatedly — no good way to enforce token budgets in application code. Provider caps are account-level and tell you what happened, not what is happening.

Two ways to add it:

  # Direct client wrapper
  client = tokencap.wrap(anthropic.Anthropic(), limit=50_000)

  # LangChain, CrewAI, AutoGen, etc.
  tokencap.patch(limit=50_000)  
Four actions at configurable thresholds: WARN, DEGRADE (transparent model swap), BLOCK, and WEBHOOK. SQLite out of the box, Redis for multi-agent setups.

One design decision worth mentioning: tokencap tracks tokens, not dollars. Token counts come directly from the provider response and never drift with pricing changes.

Happy to answer any questions.

More from Show

Show HN: DocMason – Agent Knowledge Base for local complex office files

Show HN: DocMason – Agent Knowledge Base for local complex office files I think everyone has already read Karpathy&#x27;s Post about LLM Knowledge Bases. Actually for recent weeks I am already working on agent-native knowledge base for complex research (DocMason). And it is purely running in Codex&#x2F;Claude Code. I call this paradigm is: The repo is the app. Codex is the runtime.<p>During my daily working life, I have tons of office documents with knowledge from all teams, and as an IT Architect, I need to combine them altogether to handle complex deep research (which normal LLM definitely could not help). That is the originally reason I built DocMason, and I am using it in everyday which support me on lots of complex topics.<p>I have already open-sourced this repo. And I think it takes Karpathy&#x27;s concept a step further for real-world usage in three ways: 1. It could handle most kinds of office docs (pptx, docx, excels, even .eml). And really extract multimodal information from all IT architecture diagram or excel sheets. 2. It is running as a Real APP but not a naive RAG tool. DocMason could run smoothly and intelligently to prepare environment, auto update, and auto incrementally sync Knowledge base. 3. Most importantly it is running in Native AI Agents, which could leverage powerful AI Agents engine (e.g. Codex or Claude Code)<p>View detail architecture diagram in DocMason Readme, and then download have a try :) You will find it could help a lot during daily work. Would love to hear your feedback and issues in Github!

Show HN: Ownscribe – local meeting transcription, summarization and search

Show HN: Ownscribe – local meeting transcription, summarization and search ownscribe is an open-source, python-based CLI tool to transcribe, summarize, and search meetings – fully locally on your machine.<p>As someone who hates taking notes, but also forgets things easily, I found the idea of transcribing and summarizing meetings automatically neat. However, all the existing tools out there store everything on their servers, don&#x27;t work with every type of meeting, and cost $30&#x2F;month or more.<p>I wanted a tool that just runs locally and uses a very simple format (like .md) to integrate with my other workflows – but there wasn&#x27;t anything like that. That&#x27;s why I started to build ownscribe over the past few months and continuously improved it. It started as just a tool for transcription and summarization, and now even allows you to search past meetings with natural language (and a local LLM).<p>At the moment, it is mainly optimised for macOS (although Linux should also partially work). I&#x27;d love to have some more feedback on how to make it more useful!

No other tools from this source yet.