{"repo":"abhijitgunjal/token_guard","free":true,"listed":false,"github":"https://github.com/abhijitgunjal/token_guard","clone":"git clone https://github.com/abhijitgunjal/token_guard.git","description":"Track LLM token usage, enforce rate limit & budget policies, and trigger alerts across OpenAI, Groq, OpenRouter, and AWS Bedrock.","language":"Python","stars":20,"topics":["ai-governance","llm","python","rate-limiter","rate-limiting","token-counter","aws-bedrock","cost-control","dynamodb","fastapi"],"license":"MIT","category":"ai-agents","readme_excerpt":"TokenGuard Production-ready token tracking, policy evaluation engines, budget limits, and alerts for LLM applications. --- Quick Start 1. Direct Token Tracking & Policy Enforcement Track exact token usage reported by LLM API responses and enforce rate-limiting policies: 2. Async Tracking for Web Frameworks (FastAPI / Starlette) Use non-blocking async execution in web servers: --- Why TokenGuard? LLM API calls are billed per token (inputs + outputs). Uncontrolled application requests can quickly trigger unexpected cost spikes, upstream rate limit errors, or user abuse. TokenGuard operates as a lightweight, thread-safe, and event-loop-safe middleware layer: Flexible Policy Engine : Enforce Sliding Window, Token Bucket, Fixed Window, Leaky Bucket, Cost ($/day), Quota, or Role-based rate limits. Cost & Budget Protection : Enforce usage caps per user, model, tier, or session. Unified Multi-Provider Support : Track token metrics across OpenAI, Groq, OpenRouter, and AWS Bedrock under a single unified API. Pluggable Enterprise Storage : Keep state in-memory during development or swap to Redis, SQLite, PostgreSQL, or AWS DynamoDB in production with one config change. Real-time Alerts : Dispatch warnings and webhook notifications (Slack, console, webhooks) the moment limit thresholds are crossed. --- Features Feature Description --- --- Policy Engine Enforce Sliding Window, Token Bucket, Fixed Window, Leaky Bucket, Cost, Quota, and Role-based policies Multi-Provider Counting Exact tikt","default_branch":null,"files":null,"tree":[],"storefront":"/r/abhijitgunjal","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/abhijitgunjal/token_guard/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}