Weave 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

Llm Chain Laravel Package

php-llm/llm-chain

php-llm/llm-chain is a Laravel/PHP package for composing multi-step LLM workflows, chaining prompts and model calls into reusable pipelines with a fluent API. Build reliable AI features with structured, maintainable chains.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. php-llm/llm-chain is a framework-agnostic PHP LLM abstraction layer (providers, message contracts, memory), not a Laravel-first package. That is workable in a Laravel codebase — it binds through the container and is provider-agnostic — but it means we own the service-provider wiring, config publishing, and facade ergonomics that a native Laravel package would ship. The headline change in 0.25.0 is a governance and identity shift: "PHP LLM becomes Symfony AI" (PR #390, flagged breaking with chore!). Architecturally the code stays PHP, but the centre of gravity moves to the Symfony ecosystem. For a Laravel shop this is the single most important signal in the release: it raises the odds that first-class framework integration arrives as a Symfony bundle first, and that Laravel support is community-driven or absent.

Integration feasibility. Feasible in a spike, not yet in production. Three changes drive effort:

  • Rename/namespace move (breaking). Composer package name, PHP namespaces, and likely the repo URL change. Any use statements, config files, and CI references need updating, and we cannot know the new package identifier from these notes alone.
  • Runtime checks replacing composer suggest (#385). Optional dependencies are no longer documented via Composer's suggest metadata; missing ones now surface as runtime exceptions. This is good hygiene but shifts failure from install-time to request-time — it makes a correct composer require set our responsibility rather than the tool's.
  • Memory injection into the system prompt (#387). New capability for conversation state. Useful, but it is "basic setup," and it changes what gets sent to providers — directly affecting token spend, prompt-injection surface, and log/PII posture.
  • UID intersection types (#384). Message IDs are now typed as AbstractUid&TimeBasedUidInterface (ULID / UUIDv7). Any custom message class or stored conversation referencing plain strings will need adjustment, and persisted IDs may need a column type review.
  • Albert API provider (#366). Low risk, additive; only relevant if we need an EU/sovereign-hosted provider.

Technical risk: medium-high. Pre-1.0 (0.x) semver means breaking changes are permitted on minor bumps, and this release confirms the project will exercise that. The rename introduces a genuine abandonment question for the old package name — we must confirm whether php-llm/llm-chain receives security fixes post-rename or is a dead end. Secondary risks: provider SDK drift behind a thin abstraction, and a small-maintainer project taking on a larger org's release cadence and support expectations without yet having them.

Key questions to resolve before committing.

  1. What is the new Composer package name and PHP namespace, and is there a documented migration guide?
  2. Will php-llm/llm-chain 0.24.x receive security patches, and for how long?
  3. Is Laravel support an explicit goal, or is this Symfony-bundle-first from here?
  4. Minimum PHP version now required (intersection types imply 8.1+, but confirm 8.2/8.3 support against our fleet).
  5. Is there a published stability/LTS statement, or should we treat every minor as potentially breaking?

Integration Approach

Stack fit. Works with Laravel via a thin adapter: a service provider binding the client/chain factory as a singleton, a config file for provider credentials, and a facade for ergonomics. Budget roughly one sprint of engineering for the adapter plus one for evaluation. The abstraction is the right shape (swap providers without rewriting call sites), which is the main reason to accept the framework friction.

Migration path. Do not chase 0.25.0 on main. Pin to 0.24.1 for any in-flight work, then run a timeboxed spike on the renamed package in a branch: install, rewire namespaces, exercise two providers plus the memory-injection path, and measure the diff. Decision gate: if the new namespace is stable and a Laravel path is credible, migrate; if not, hold at 0.24.1 and keep the abstraction behind our own interface so a swap to a native Laravel solution stays cheap.

Compatibility. Verify PHP version constraints against our runtime images, confirm every optional dependency our code paths touch is explicitly required (not merely suggested — that safety net is gone), and check that stored conversation/message IDs survive the UID typing change. If we persist message IDs, plan a nullable-column migration or a cast rather than a hard type change.

Sequencing.

  1. Pin 0.24.1; freeze new feature work on this dependency.
  2. Spike the renamed package; capture the actual namespace/package delta.
  3. Wrap all provider calls behind an internal interface (LlmClient) so call sites never import vendor classes directly — this is the highest-value step and pays off regardless of the rename outcome.
  4. Migrate the adapter to the new package behind the interface; run side-by-side in staging.
  5. Only then enable memory injection, with a token-budget and redaction review before it reaches production prompts.

Operational Impact

Maintenance. The org shift to Symfony AI is, on balance, positive for longevity — more maintainers, an established release process, and a broader contributor base. But it resets our dependency-risk clock: we will be tracking a package that is still pre-1.0 and mid-rebrand, so expect at least one more namespace-touching release before things settle. Assign explicit ownership (one engineer as the named maintainer of our adapter layer).

Support. Upstream support is community/GitHub-issue driven; there is no commercial SLA. Our internal support story must therefore be "we can swap providers within X days," which the interface wrapper makes true. Do not let product teams build provider-specific assumptions on top of this dependency.

Scaling. No new scaling concerns: this is an HTTP-calling abstraction, so throughput and latency are governed by the provider, not the package. The one scaling-adjacent risk is the new memory injection — every injected memory token is billed on every turn. Cap injected memories, cache aggressively, and instrument token spend per request before rollout.

Failure modes.

  • Runtime dependency exceptions from the suggests→runtime-checks switch, appearing as 500s on untested code paths (e.g. a provider only exercised in one feature). Mitigate by requiring all optional deps and covering each provider in smoke tests.
  • Namespace/package churn on a future minor bump breaking our adapter — bounded by the interface wrapper.
  • Prompt-injection via injected memory: user-controlled or retrieved content entering the system prompt is a privilege escalation vector. Treat memories as untrusted data and sanitise before injection.
  • Silent provider behaviour drift behind the abstraction (different stop reasons, token accounting) — assert on normalised response contracts in tests.
  • Abandonment of the old package name if we fail to migrate and upstream stops patching it.

Ramp-up. Low-to-moderate: the API is small, but the team will need working familiarity with Symfony-style contracts and PSR service wiring to debug effectively. Budget a half-day knowledge transfer on the adapter layer, and document the provider onboarding checklist (credentials, required optional deps, smoke test) so adding or swapping a provider is a routine task rather than a research project.

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums