承接 fr3on/laravel-ledger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fr3on/laravel-ledger

最新稳定版本:0.0.1

Composer 安装命令:

composer require fr3on/laravel-ledger

包简介

Token cost accounting and budget enforcement for AI-heavy Laravel applications. Supports OpenAI, Anthropic, Gemini, and more.

README 文档

README

GitHub license PHP Version Laravel Version Tests

Token cost accounting for AI-heavy Laravel applications. Tracks spend per user, per feature, and per model. Enforces budgets before calls are made.

Installation

composer require fr3on/laravel-ledger
php artisan migrate

Usage

Wrap your AI calls with the Ledger facade:

use Fr3on\Ledger\Facades\Ledger;

$result = Ledger::for(user: $user, feature: 'chat')
    ->budget()->dailyLimit(tokens: 50_000)->orFail()
    ->track(fn() => $ai->generate($prompt));

Expected Result

The ledger tracks token usage and calculates costs based on your pricing map. You can then generate reports:

php artisan ledger:report --period=month

Output Example:

Ledger Report — April 2026

  Feature          Requests   Tokens        Cost (USD)
  ──────────────────────────────────────────────────────
  chat              1,240      4,820,000     $72.30
  summarize           380        940,000     $14.10
  embed             2,100        210,000      $4.20
  ──────────────────────────────────────────────────────
  TOTAL             3,720      5,970,000     $90.60

Configuration

Publish the config file:

php artisan vendor:publish --tag=ledger-config

Define your model pricing and token drivers in config/ledger.php.

统计信息

  • 总下载量: 229
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固