Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TokenMeter: Enterprise LLM Cost & Quota Proxy

GitHub License GitHub Stars GitHub Issues PHP Version

Enterprise gateway proxy metering model token usage across OpenAI, Anthropic, and Gemini with dynamic team budget controls.


🚀 Key Architectural Highlights

  • Production Resilience: Engineered with decoupled interfaces, structured exception trees, and strict typings.
  • High Concurrency Ready: Built to eliminate latency bottlenecks, memory spikes, and race conditions.
  • Enterprise Standards: Zero-dependency core logic with clean service provider adapters.
  • Full Observability: Embedded metrics telemetry and structured contextual logging.

🛠️ Architecture & Lifecycle Workflow

graph TD
    Client[Incoming Event / API Trigger] --> Gate[Input Validation & Policy Guard]
    Gate --> CoreEngine[TokenMeter: Enterprise LLM Cost & Quota Proxy]
    CoreEngine --> Adapter[External Storage / Cluster / State Provider]
    CoreEngine --> Observer[Telemetry & Audit Logger]
Loading

📦 Installation & Setup

Requirements

  • PHP: ^8.2 or later
  • Composer: Modern Composer v2+

Installation via Composer

composer require smit-backend/llm-token-cost-telemetry

⚙️ Configuration & Quick Start

Publish configuration and default assets:

php artisan vendor:publish --tag="llm-token-cost-telemetry-config"

Sample configuration excerpt (config/llm-token-cost-telemetry.php):

return [
    'enabled' => env('LLM_TOKEN_COST_TELEMETRY_ENABLED', true),
    'timeout' => env('LLM_TOKEN_COST_TELEMETRY_TIMEOUT', 30),
    'log_channel' => env('LLM_TOKEN_COST_TELEMETRY_LOG', 'stack'),
];

🧪 Testing

Run test suites locally:

composer test

🛡️ Security & Contributing

If you discover any security-related issues, please open an issue or email directly via GitHub. Contributions via pull requests are always welcome!


📄 License

This package is open-sourced software licensed under the MIT License.

Developed and maintained with ❤️ by smit-backend.

About

Enterprise gateway proxy metering model token usage across OpenAI, Anthropic, and Gemini with dynamic team budget controls.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages