Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ai Gateway Bundle Laravel Package

ai-gateway/ai-gateway-bundle

Symfony bundle that turns your app into an AI gateway: unified /v1 API for chat/models, OpenAI-compatible + Anthropic providers, model fallback chains, per-key auth, budgets/rate limits, caching, cost tracking, SSE streaming, Prometheus metrics, dashboard and CLI.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Unified AI Infrastructure: Eliminates vendor lock-in by abstracting LLM provider APIs (OpenAI, Anthropic, etc.) into a single Symfony-compatible interface. Enables seamless switching between providers (e.g., OpenAI → Mistral → Ollama) without code changes.
  • Cost Optimization Roadmap: Built-in budget enforcement (daily/monthly limits), cost tracking, and fallback chains reduce waste by routing requests to the cheapest viable model automatically. Supports tiered pricing strategies (e.g., "use GPT-4 for critical tasks, fallback to GPT-3.5 for non-critical").
  • Build vs. Buy: Avoids reinventing LLM plumbing (auth, retries, rate limiting, caching) while offering extensibility via Symfony’s ecosystem. Ideal for teams prioritizing developer velocity over custom solutions.
  • Use Cases:
    • Internal AI Tools: Power chatbots, document processing, or code assistants with centralized cost controls.
    • Multi-Tenant SaaS: Isolate customer API keys/teams with hierarchical budgets (e.g., "Enterprise tier gets $500/month").
    • Hybrid Cloud/Local: Mix cloud providers (OpenAI) with local models (Ollama) via unified endpoints.
    • Observability: Prometheus metrics and dashboard provide real-time cost/usage insights for finops teams.

When to Consider This Package

  • Adopt if:
    • Your Symfony app needs >1 LLM provider (e.g., OpenAI + Anthropic + local models).
    • You require fine-grained cost controls (per-key budgets, rate limits).
    • Your team lacks dedicated backend resources to build/rely on provider SDKs.
    • You need fallback logic (e.g., "try GPT-4, then GPT-3.5 if unavailable").
    • Your use case involves streaming responses (SSE) or high request volumes (rate limiting).
  • Look elsewhere if:
    • You’re using a single provider with no need for fallbacks (e.g., only OpenAI).
    • Your stack isn’t Symfony/PHP (e.g., Node.js, Python).
    • You need advanced fine-tuning or custom model training (this is a proxy, not a training platform).
    • Your cost tracking is handled externally (e.g., via provider APIs like OpenAI’s usage logs).
    • You require serverless deployment (this needs a persistent database and Symfony runtime).

How to Pitch It (Stakeholders)

For Executives: *"This package turns our Symfony app into a self-service AI gateway—like a ‘Stripe for LLMs.’ It lets us:

  • Cut costs by 30–50% via smart fallback chains (e.g., use cheaper models when possible).
  • Stop reinventing auth/rate limiting—every team currently builds this from scratch.
  • Monitor AI spend in real-time with a built-in dashboard (budgets, usage, cost breakdowns).
  • Support hybrid workflows (e.g., cloud + local models) without rewriting code. For $500/month in dev effort, we avoid $5K/year in duplicated work and get enterprise-grade controls."

For Engineering: *"This is a Symfony-native way to:

  • Unify 100+ LLM providers under one /v1/chat/completions endpoint.
  • Enforce budgets per API key (e.g., team_enterprise gets $500/month).
  • Auto-failover between models (e.g., GPT-4 → GPT-3.5 if the first fails).
  • Cache responses (SHA-256 hashing) to slash redundant calls.
  • Get Prometheus metrics out of the box (ai_gateway_cost_dollars_total). No more YAML hell—manage everything via CLI or a dark-mode dashboard. Works with existing Symfony services via GatewayInterface."

For Product/FinOps: *"We’ll:

  • Stop overpaying for AI by routing requests to the cheapest viable model.
  • Set hard limits (e.g., ‘Dev team gets $20/day’) to prevent budget leaks.
  • Track costs per feature/team with granular logs and a dashboard.
  • Avoid vendor lock-in—switch providers (e.g., OpenAI → Mistral) without changing our app’s AI calls. Think of it as ‘Concourse for AI’—centralized, observable, and cost-aware."
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope