Introduction to LLM Magic
LLM Magic is a powerful PHP SDK for Laravel that enables you to work with Large Language Models (LLMs) using just a few lines of code. It provides a developer-friendly interface for interacting with multiple LLM providers and extracting structured data from various file formats.This project is still in development and not yet publicly released. The API may change!
Key Features
Simple Question Answering Ask questions and get instant answers with a single line of code usingMagic::ask().
Multi-Provider Support
Connect to multiple LLM providers including OpenAI, Anthropic, Google Gemini, Mistral, OpenRouter, TogetherAI, and more.
Advanced Chat Conversations
Build complex conversations with multi-modal inputs (text, images), tool calling, and streaming responses.
Structured Data Extraction
Extract validated JSON data from PDFs, Word documents, images, and other file formats with multiple extraction strategies.
Function Calling & Tools
Create custom tools and functions that LLMs can call during conversations, enabling dynamic interactions with your application.
Embeddings Support
Generate and work with text embeddings for semantic search, similarity matching, and more.
Streaming Responses
Stream LLM responses in real-time for better user experience.
Quick Example
Getting Started
Explore the documentation to learn how to use LLM Magic in your Laravel application:Installation
Install LLM Magic via Composer and configure your environment
Quick Start
Get up and running with your first LLM interactions
Configuration
Configure models, API keys, and advanced settings
Chat API
Learn about building conversations with LLMs