Product Decisions This Supports
- Feature investment decisions: Before greenlighting LLM-powered features, this gives you the cost-per-request, cost-per-user, and cost-per-team data to forecast unit economics and decide whether a feature is margin-accretive or a money pit.
- Build vs. buy: Ship observability in a day rather than staffing a "telemetry team." The package covers the entire loop — capture, cost calculation, quota enforcement, alerting, and a dashboard — that would otherwise consume weeks of engineering for a differentiating-but-undifferentiated capability.
- Monetization and packaging: Per-user/team attribution plus scoped quota enforcement (global, user, team, API key) is exactly the instrumentation needed to design tiered plans, per-tenant AI allowances, and metered billing.
- Roadmap sequencing: Because tracking is provider-agnostic (OpenAI, Anthropic, Ollama, custom), it de-risks provider strategy decisions — you can add or swap providers without losing your cost and usage baseline.
- Operational risk management: Alert rules on cost, error rate, and latency give you the guardrails to roll out LLM features to production without a runaway-bill incident or silent quality regression.
- Compliance and support readiness: Request-level logs with metadata provide the audit trail needed for customer questions ("why was I charged X?") and for debugging quality issues by model/user/timeframe.
- High-volume and multi-tenant product strategy: Sampling support for high-volume traffic and first-class multi-tenancy mean the decision to go after larger enterprise accounts doesn't require re-architecting telemetry later.
When to Consider This Package
Adopt it when most of the following hold:
- Your stack is Laravel 10.x/11.x on PHP 8.2+ and you're already using (or willing to use) Eloquent/Artisan conventions — the install path is
composer require + one migration.
- You are putting LLM features into a multi-user or multi-tenant product and need per-user/per-team attribution that's hard to retrofit later.
- You have cost exposure you don't currently measure — no per-request token and cost logging, or tracking scattered across provider dashboards.
- You need hard quota enforcement, not just reporting — middleware-level limits per user/team/API key, with scheduled resets.
- You want a PM- and stakeholder-visible dashboard without building one; the optional Filament 3.2+ UI is a meaningful accelerator for an internal ops console.
- You want alerting on cost/error/latency delivered through channels you already use (Laravel Notifications, webhooks with retry).
Look elsewhere when:
- You're not on Laravel, or you're on an older LTS with a hard PHP 8.1 ceiling — integration cost dominates.
- You need deep tracing/evals (spans, prompt versioning, dataset-based regression testing, LLM-as-judge). Dedicated platforms like Langfuse, Helicone, or Arize are the right tool; this package is cost/quota-centric, not an eval harness.
- You require enterprise procurement guarantees — SOC 2 attestation, vendor SLAs, support contracts. A v1.0.0 community package with a single maintainer is a dependency risk worth naming explicitly.
- You're at very large scale and need streaming-grade ingestion or a warehouse-native pipeline; a database-backed Laravel package may become a bottleneck versus a dedicated observability backend.
- Your organization has a standard APM/observability vendor (Datadog, New Relic) and prefers consolidating telemetry there rather than adding a second source of truth.
Recommended posture: pilot it behind one internal/low-risk LLM feature, validate cost accuracy against provider invoices, then expand. Treat the single-maintainer and v1.0.0 maturity risk as a mitigation item — pin versions and be prepared to fork.
How to Pitch It (Stakeholders)
For executives (business case):
We're adding AI features to our product, and right now we have no reliable answer to "what does this cost us per customer, per day, or per team?" That's a budgeting and pricing blind spot, and it's a real risk of a runaway API bill. This package is a one-day integration that gives us per-request cost tracking, hard spending limits, and alerts before costs spike — plus the per-customer usage data we need to price AI tiers confidently. It's open source and free to adopt, which lets us defer any platform-vendor commitment until we know our AI unit economics. Main caveat: it's a new v1.0.0 community package, so we'll pilot it on one feature first and pin the version.
For engineering (why it's low-risk to try):
It's a conventional Laravel package — Composer install, publish config, migrate. It hooks into request lifecycles the way our existing middleware does, supports sync and async recording so we can keep it off the hot path, and has sampling for volume. Tests are Pest-based with CI, pricing tables cover the major providers out of the box, and cost calculation is pluggable if we have custom or negotiated rates. The Filament dashboard is optional, so it doesn't force a UI dependency. The honest trade-off: it's cost/quota observability, not tracing or evals — if we later need prompt-level debugging and regression testing, we layer Langfuse or similar on top rather than replacing this.
For product/ops (day-to-day value):
We get a real dashboard for usage by provider, model, and user, plus configurable alerts wired into Slack/email through Laravel Notifications. When a customer disputes a charge or reports degraded quality, we can pull the actual request logs with metadata instead of guessing.