Integrating large language models (LLMs) into applications is often complicated and heavily coupled to a specific provider. LLMesh is a lightweight, framework-agnostic PHP SDK designed to standardize AI model integration across supported providers (like OpenAI and Anthropic Claude), allowing you to focus on building great AI features.
Here is what makes LLMesh a complete toolkit for PHP developers:
β¨ Key Features:
- π Unified Text Generation: Standardized interface for prompt customization across multiple providers.
- β‘οΈ Real-time Streaming: Stream text delta chunks in real time, with built-in Server-Sent Events (SSE) support.
- ποΈ Structured Outputs: Generate schema-conforming JSON objects natively, with automatic retry-on-failure loops.
- 𧬠Structured Extraction (Pydantic-style): Map unstructured text directly into fully-typed PHP class models with automatic type coercion (Dates, Enums, nested lists) and self-correction.
- π οΈ Tools & Function Calling: Bind local PHP closures and class methods as callable tools for the LLM.
- π€ Autonomous Agents: Multi-step reasoning loops that run and resolve tool calls dynamically.
- π§ Conversational Memory: Pluggable memory storage engines (In-Memory, Redis, Database) to handle stateful chats.
- π Retrieval-Augmented Generation (RAG): Complete document loaders, splitters, embeddings generator, and vector search pipelines.
π Framework Integration:
Fully framework-agnostic (pure PHP 8.1+) with first-class Laravel integration out-of-the-box.
π» GitHub Repository: https://github.com/fyunusa/llmesh
π¦ Packagist Package: https://packagist.org/packages/llmesh/core
Top comments (0)